summaryrefslogtreecommitdiff
path: root/openwrt/target/linux/rules.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-05-28 09:17:29 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-05-28 09:17:29 +0000
commit269c7158041cbb548a602b9e17e8ee7779aeb44d (patch)
tree823ff43388135467a5c7a60589acf62d173cedc4 /openwrt/target/linux/rules.mk
parentca55f8d3da7f00f440f0b21d88b397f4c9554f73 (diff)
downloadmtk-20170518-269c7158041cbb548a602b9e17e8ee7779aeb44d.zip
mtk-20170518-269c7158041cbb548a602b9e17e8ee7779aeb44d.tar.gz
mtk-20170518-269c7158041cbb548a602b9e17e8ee7779aeb44d.tar.bz2
move package/linux into target/linux, use wbx' new kernel code. support building images with more than one kernel, split kernel module parts off of packages that use their own kernel modules (fuse, shfs, openswan). some cleanup in the image building process in target/. image builder is disabled for now, needs some fixing.
SVN-Revision: 1085
Diffstat (limited to 'openwrt/target/linux/rules.mk')
-rw-r--r--openwrt/target/linux/rules.mk28
1 files changed, 28 insertions, 0 deletions
diff --git a/openwrt/target/linux/rules.mk b/openwrt/target/linux/rules.mk
new file mode 100644
index 0000000..be10370
--- /dev/null
+++ b/openwrt/target/linux/rules.mk
@@ -0,0 +1,28 @@
+define KMOD_template
+ifeq ($$(strip $(4)),)
+KDEPEND_$(1):=m
+else
+KDEPEND_$(1):=$($(4))
+endif
+
+PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
+I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
+
+ifeq ($$(KDEPEND_$(1)),m)
+ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
+TARGETS += $$(PKG_$(1))
+endif
+ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
+INSTALL_TARGETS += $$(PKG_$(1))
+endif
+endif
+
+$$(PKG_$(1)): $(LINUX_DIR)/.modules_done
+ mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
+ $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(PKG_RELEASE) $(ARCH)
+ cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
+ $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
+
+endef
+
+