Added collectd, thanks to Florian Forster
[openwrt.git] / openwrt / target / linux / rules.mk
1 LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
2 -e 's/mipsel/mips/' \
3 -e 's/mipseb/mips/' \
4 -e 's/powerpc/ppc/' \
5 -e 's/sh[234]/sh/' \
6 )
7
8 ifeq ($(KERNEL),2.6)
9 LINUX_KMOD_SUFFIX=ko
10 else
11 LINUX_KMOD_SUFFIX=o
12 endif
13
14 define KMOD_template
15 ifeq ($$(strip $(4)),)
16 KDEPEND_$(1):=m
17 else
18 KDEPEND_$(1):=$($(4))
19 endif
20
21 IDEPEND_$(1):=kernel ($(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)) $(foreach pkg,$(5),", $(pkg)")
22
23 PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)_$(ARCH).ipk
24 I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
25
26 ifeq ($$(KDEPEND_$(1)),m)
27 ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
28 TARGETS += $$(PKG_$(1))
29 endif
30 ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
31 INSTALL_TARGETS += $$(PKG_$(1))
32 endif
33 endif
34
35 $$(PKG_$(1)): $(LINUX_DIR)/.modules_done
36 rm -rf $$(I_$(1))
37 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE) $(ARCH)
38 echo "Depends: $$(IDEPEND_$(1))" >> $$(I_$(1))/CONTROL/control
39 ifneq ($(strip $(3)),)
40 mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
41 cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
42 endif
43 ifneq ($(6),)
44 mkdir -p $$(I_$(1))/etc/modules.d
45 for module in $(7); do \
46 echo $$$$module >> $$(I_$(1))/etc/modules.d/$(6)-$(2); \
47 done
48 endif
49 $(8)
50 $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR) $(MAKE_TRACE)
51
52 endef
53
54
This page took 0.043683 seconds and 5 git commands to generate.