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
27 rm -f $(top_srcdir)/TAGS
28 ETAGSF=`etags --version | grep -iq exuberant && \
29 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
30 find $(top_srcdir) -name '*.[hc]' | xargs etags $$ETAGSF -a
32 rm -f $(top_srcdir)/tags
33 CTAGSF=`ctags --version | grep -iq exuberant && \
34 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
35 find $(top_srcdir) -name '*.[hc]' | xargs ctags $$CTAGSF -a
39 include @LINUX_CONFIG@
41 EXTRA_CFLAGS := $(EXTRA_PRE_CFLAGS)
42 EXTRA_CFLAGS += @EXTRA_KCFLAGS@ @UML_CFLAGS@
43 EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS)
45 obj-m := $(patsubst %,%.o,$(MODULES))
47 ifeq ($(PATCHLEVEL),4)
49 O_TARGET := $(firstword $(obj-m))
50 obj-y := $($(firstword $(MODULES))-objs)
51 export-objs := $(obj-y) $(filter-out $(O_TARGET),$(obj-m))
52 include $(TOPDIR)/Rules.make