Add build directory to include path.
[sliver-openvswitch.git] / datapath / linux-2.6 / Kbuild.in
1 # -*- makefile -*-
2 export builddir = @abs_builddir@
3 export srcdir = @abs_srcdir@
4 export top_srcdir = @abs_top_srcdir@
5 export VERSION = @VERSION@
6
7 include $(srcdir)/../Modules.mk
8 include $(srcdir)/Modules.mk
9
10 EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\"
11 EXTRA_CFLAGS += -I$(srcdir)/.. 
12 EXTRA_CFLAGS += -I$(builddir)/..
13 EXTRA_CFLAGS += -I$(top_srcdir)/include
14
15 # These include directories have to go before -I$(KSRC)/include.
16 # NOSTDINC_FLAGS just happens to be a variable that goes in the
17 # right place, even though it's conceptually incorrect.
18 NOSTDINC_FLAGS += -I$(srcdir)/compat-2.6 -I$(srcdir)/compat-2.6/include 
19
20 obj-m := $(patsubst %,%_mod.o,$(all_modules))
21
22 define module_template
23 $(1)_mod-y = $$(patsubst %.c,%.o,$($(1)_sources))
24 endef
25
26 $(foreach module,$(all_modules),$(eval $(call module_template,$(module))))