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
28 include @LINUX_CONFIG@
30 EXTRA_CFLAGS := $(EXTRA_PRE_CFLAGS)
31 EXTRA_CFLAGS += @EXTRA_KCFLAGS@ @UML_CFLAGS@
32 EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS)
34 obj-m := $(patsubst %,%.o,$(MODULES))
36 ifeq ($(PATCHLEVEL),4)
38 O_TARGET := $(firstword $(obj-m))
39 obj-y := $($(firstword $(MODULES))-objs)
40 export-objs := $(obj-y) $(filter-out $(O_TARGET),$(obj-m))
41 include $(TOPDIR)/Rules.make