2 export builddir = @abs_builddir@
3 export srcdir = @abs_srcdir@
4 export top_srcdir = @abs_top_srcdir@
5 export VERSION = @VERSION@
6 export BUILDNR = @BUILDNR@
8 include $(srcdir)/../Modules.mk
9 include $(srcdir)/Modules.mk
11 EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\"
12 EXTRA_CFLAGS += -I$(srcdir)/..
13 EXTRA_CFLAGS += -I$(builddir)/..
15 EXTRA_CFLAGS += -DBUILDNR=\"\"
17 EXTRA_CFLAGS += -DBUILDNR=\"+build$(BUILDNR)\"
20 EXTRA_CFLAGS += -include $(builddir)/kcompat.h
22 # These include directories have to go before -I$(KSRC)/include.
23 # NOSTDINC_FLAGS just happens to be a variable that goes in the
24 # right place, even though it's conceptually incorrect.
25 NOSTDINC_FLAGS += -I$(top_srcdir)/include -I$(srcdir)/compat -I$(srcdir)/compat/include
27 obj-m := $(patsubst %,%_mod.o,$(build_modules))
29 define module_template
30 $(1)_mod-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources)))
33 $(foreach module,$(build_modules),$(eval $(call module_template,$(module))))