compat: Backport prandom_u32_max().
[cascardo/ovs.git] / datapath / linux / 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 ccflags-y := -DVERSION=\"$(VERSION)\"
11 ccflags-y += -I$(srcdir)/..
12 ccflags-y += -I$(builddir)/..
13 ccflags-y += -g
14 ccflags-y += -include $(builddir)/kcompat.h
15
16 # These include directories have to go before -I$(KSRC)/include.
17 # NOSTDINC_FLAGS just happens to be a variable that goes in the
18 # right place, even though it's conceptually incorrect.
19 NOSTDINC_FLAGS += -I$(top_srcdir)/include -I$(srcdir)/compat -I$(srcdir)/compat/include
20
21 obj-m := $(subst _,-,$(patsubst %,%.o,$(build_modules)))
22
23 define module_template
24 $(1)-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources)))
25 endef
26
27 $(foreach module,$(build_multi_modules),$(eval $(call module_template,$(module))))