1 # Directories building kernel modules should have two files:
5 # MODULES := <module-name>
6 # <module-name>-objs := file1.o file2.o file3.o
16 # modulefs_DATA = <module-name>$(KMODEXT)
19 # DIST_SOURCES = $(<module-name>-objs:.o=.c) <other sources>
20 # MOSTLYCLEANFILES = *.o *.ko *.mod.c
22 ifeq ($(KERNELRELEASE),)
26 ifeq (@MODULES_TRUE@,)
27 $(foreach MODULE,$(MODULES),$(MODULE)@KMODEXT@): FORCE
28 $(MAKE) @ARCH_UM@ -C $(LINUX) SUBDIRS=$(PWD) modules
34 # we want to use -O0 for UML, unless it's already set (ie, in the
35 # socknal where we need to build with -O2 so that htonl etc. are
37 ifeq ($(filter -O%,$(EXTRA_CFLAGS)),)
38 EXTRA_CFLAGS += @UML_CFLAGS@
40 EXTRA_CFLAGS += @EXTRA_KCFLAGS@
42 obj-m := $(patsubst %,%.o,$(MODULES))
44 ifeq ($(PATCHLEVEL),4)
46 O_TARGET := $(firstword $(obj-m))
47 obj-y := $($(firstword $(MODULES))-objs)
48 export-objs := $(obj-y) $(filter-out $(O_TARGET),$(obj-m))
49 include $(TOPDIR)/Rules.make