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)/..
14 EXTRA_CFLAGS += -I$(top_srcdir)/include
16 EXTRA_CFLAGS += -DBUILDNR=\"\"
18 EXTRA_CFLAGS += -DBUILDNR=\"+build$(BUILDNR)\"
21 EXTRA_CFLAGS += -include $(builddir)/kcompat.h
23 # These include directories have to go before -I$(KSRC)/include.
24 # NOSTDINC_FLAGS just happens to be a variable that goes in the
25 # right place, even though it's conceptually incorrect.
26 NOSTDINC_FLAGS += -I$(srcdir)/compat-2.6 -I$(srcdir)/compat-2.6/include
28 obj-m := $(patsubst %,%_mod.o,$(build_modules))
30 define module_template
31 $(1)_mod-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources)))
34 $(foreach module,$(build_modules),$(eval $(call module_template,$(module))))