Because of historical string munging during the kernel build process if you named your hardware table hwtable-something, when it was built the filename would look appropriate, but the actual module info would change the internal name to be hwtable_something, thus after an insmod with the filename you could not perform an rmmod with the same filename. As a result the naming scheme has been changed to hwtable_NAME, NAME being the hardware the table supports. Further, include files in the hardware table should be prefixed with the folder name, ie \#include "hwtable_NAME/my_header.h".
29 lines
888 B
Makefile
29 lines
888 B
Makefile
# -*- makefile -*-
|
|
export builddir = @abs_builddir@
|
|
export srcdir = @abs_srcdir@
|
|
export top_srcdir = @abs_top_srcdir@
|
|
export VERSION = @VERSION@
|
|
|
|
include $(srcdir)/../Modules.mk
|
|
include $(srcdir)/Modules.mk
|
|
include @HW_TABLES@
|
|
|
|
EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\"
|
|
EXTRA_CFLAGS += -I$(srcdir)/..
|
|
EXTRA_CFLAGS += -I$(builddir)/..
|
|
EXTRA_CFLAGS += -I$(top_srcdir)/include
|
|
EXTRA_CFLAGS += -I$(top_srcdir)/datapath
|
|
|
|
# These include directories have to go before -I$(KSRC)/include.
|
|
# NOSTDINC_FLAGS just happens to be a variable that goes in the
|
|
# right place, even though it's conceptually incorrect.
|
|
NOSTDINC_FLAGS += -I$(srcdir)/compat-2.6 -I$(srcdir)/compat-2.6/include
|
|
|
|
obj-m := $(patsubst %,%_mod.o,$(all_modules))
|
|
|
|
define module_template
|
|
$(1)_mod-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources)))
|
|
endef
|
|
|
|
$(foreach module,$(all_modules),$(eval $(call module_template,$(module))))
|