add pattern for AG214
[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/powerpc/ppc/' \
4 -e 's/sh[234]/sh/' \
5 )
6
7
8 define KMOD_template
9 ifeq ($$(strip $(4)),)
10 KDEPEND_$(1):=m
11 else
12 KDEPEND_$(1):=$($(4))
13 endif
14
15 ifeq ($$(strip $(5)),)
16 IDEPEND_$(1):=kernel-$(LINUX_VERSION)-$(BOARD) ($(PKG_RELEASE))
17 else
18 IDEPEND_$(1):=kernel-$(LINUX_VERSION)-$(BOARD) ($(PKG_RELEASE)), $(5)
19 endif
20
21 PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)_$(ARCH).ipk
22 I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
23
24 ifeq ($$(KDEPEND_$(1)),m)
25 ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
26 TARGETS += $$(PKG_$(1))
27 endif
28 ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
29 INSTALL_TARGETS += $$(PKG_$(1))
30 endif
31 endif
32
33 $$(PKG_$(1)): $(LINUX_DIR)/.modules_done
34 rm -rf $$(I_$(1))
35 mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
36 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE) $(ARCH)
37 echo "Depends: $$(IDEPEND_$(1))" >> $$(I_$(1))/CONTROL/control
38 cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
39 ifneq ($(6),)
40 mkdir -p $$(I_$(1))/etc/modules.d
41 for module in $(7); do \
42 echo $$$$module >> $$(I_$(1))/etc/modules.d/$(6)-$(2); \
43 done
44 endif
45 $(8)
46 $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
47
48 endef
49
50
This page took 0.049237 seconds and 5 git commands to generate.