diff options
author | Mike Baker <mbm@openwrt.org> | 2005-03-06 03:34:52 +0000 |
---|---|---|
committer | Mike Baker <mbm@openwrt.org> | 2005-03-06 03:34:52 +0000 |
commit | 6b93231c4f64a61103dfc16acebedd18b4c25171 (patch) | |
tree | aad933069e7dedf29eb70dbfd81e9ca95d9b578f /openwrt/package/linux/Makefile | |
parent | 14e0fec336fca0766605968fe9dd7eef2448736f (diff) | |
download | mtk-20170518-6b93231c4f64a61103dfc16acebedd18b4c25171.zip mtk-20170518-6b93231c4f64a61103dfc16acebedd18b4c25171.tar.gz mtk-20170518-6b93231c4f64a61103dfc16acebedd18b4c25171.tar.bz2 |
nbd's makefile/menuconfig rewrite
SVN-Revision: 307
Diffstat (limited to 'openwrt/package/linux/Makefile')
-rw-r--r-- | openwrt/package/linux/Makefile | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/openwrt/package/linux/Makefile b/openwrt/package/linux/Makefile new file mode 100644 index 0000000..90fb5ac --- /dev/null +++ b/openwrt/package/linux/Makefile @@ -0,0 +1,74 @@ +include $(TOPDIR)/rules.mk +include ./linux.mk + +PKG_BUILD_DIR := $(BUILD_DIR)/linux-modules +PKG_RELEASE := 1 + +TARGETS := +INSTALL_TARGETS := + +define KMOD_template +PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk +I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2) +ifneq ($(BR2_PACKAGE_KMOD_$(1)),) +TARGETS += $$(PKG_$(1)) +endif +ifeq ($(BR2_PACLAGE_KMOD_$(1)),y) +INSTALL_TARGETS += $$(PKG_$(1)) +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 + +$(eval $(call KMOD_template,ARPT,arptables,\ + $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.o \ +)) +$(eval $(call KMOD_template,EBT,ebtables,\ + $(MODULES_DIR)/kernel/net/bridge/netfilter/*.o \ +)) +$(eval $(call KMOD_template,IPT4,iptables-extra,\ + $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip*.o \ +)) +$(eval $(call KMOD_template,IPT6,ip6tables,\ + $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.o \ +)) +$(eval $(call KMOD_template,IPV6,ipv6,\ + $(MODULES_DIR)/kernel/net/ipv6/ipv6.o \ +)) +$(eval $(call KMOD_template,USB,usb,\ + $(MODULES_DIR)/kernel/drivers/scsi/*.o \ + $(MODULES_DIR)/kernel/drivers/usb/*.o \ + $(MODULES_DIR)/kernel/drivers/usb/*/*.o \ +)) +$(eval $(call KMOD_template,CRYPTO,crypto,\ + $(MODULES_DIR)/kernel/crypto/*.o \ +)) +$(eval $(call KMOD_template,MPPE,mppe,\ + $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.o \ +)) +$(eval $(call KMOD_template,TUN,tun,\ + $(MODULES_DIR)/kernel/drivers/net/tun.o \ +)) +$(eval $(call KMOD_template,SCHED,sched,\ + $(MODULES_DIR)/kernel/net/sched/*.o \ +)) + +$(TARGETS): $(PACKAGE_DIR) + +$(PACKAGE_DIR): + mkdir -p $(PACKAGE_DIR) + +source: linux-source +prepare: $(LINUX_DIR)/.configured +compile: $(LINUX_DIR)/.modules_done $(TARGETS) + +install: compile $(TARGET_MODULES_DIR) + @[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG) install $(INSTALL_TARGETS) || true + +clean: linux-dirclean + rm -f $(TARGETS) |