2005-03-21 08:12:49 +00:00
|
|
|
# $Id$
|
|
|
|
|
2005-03-06 03:34:52 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include ./linux.mk
|
2005-03-21 16:04:14 +00:00
|
|
|
include ./linux.config
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
PKG_BUILD_DIR := $(BUILD_DIR)/linux-modules
|
|
|
|
PKG_RELEASE := 1
|
|
|
|
|
|
|
|
TARGETS :=
|
|
|
|
INSTALL_TARGETS :=
|
|
|
|
|
2005-03-21 16:04:14 +00:00
|
|
|
|
2005-03-06 03:34:52 +00:00
|
|
|
define KMOD_template
|
2005-03-21 16:04:14 +00:00
|
|
|
ifeq ($$(strip $(4)),)
|
|
|
|
KDEPEND_$(1):=m
|
|
|
|
else
|
|
|
|
KDEPEND_$(1):=$($(4))
|
|
|
|
endif
|
|
|
|
|
2005-03-06 03:34:52 +00:00
|
|
|
PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
|
|
|
|
I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
|
2005-03-21 16:04:14 +00:00
|
|
|
|
|
|
|
ifeq ($$(KDEPEND_$(1)),m)
|
2005-03-06 03:34:52 +00:00
|
|
|
ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
|
|
|
|
TARGETS += $$(PKG_$(1))
|
|
|
|
endif
|
2005-03-07 07:57:43 +00:00
|
|
|
ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
|
2005-03-06 03:34:52 +00:00
|
|
|
INSTALL_TARGETS += $$(PKG_$(1))
|
|
|
|
endif
|
2005-03-21 16:04:14 +00:00
|
|
|
endif
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
$$(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 \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_IP_NF_ARPTABLES))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(eval $(call KMOD_template,EBT,ebtables,\
|
|
|
|
$(MODULES_DIR)/kernel/net/bridge/netfilter/*.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_BRIDGE_NF_EBTABLES))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(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 \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_IP6_NF_IPTABLES))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(eval $(call KMOD_template,IPV6,ipv6,\
|
|
|
|
$(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_IPV6))
|
2005-03-21 19:46:56 +00:00
|
|
|
$(eval $(call KMOD_template,CIFS,cifs,\
|
|
|
|
$(MODULES_DIR)/kernel/fs/cifs/cifs.o \
|
|
|
|
,CONFIG_CIFS))
|
2005-03-09 22:55:13 +00:00
|
|
|
$(eval $(call KMOD_template,NFS,nfs,\
|
|
|
|
$(MODULES_DIR)/kernel/fs/lockd/*.o \
|
|
|
|
$(MODULES_DIR)/kernel/fs/nfs/*.o \
|
|
|
|
$(MODULES_DIR)/kernel/net/sunrpc/*.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_NFS_FS))
|
2005-04-02 15:34:55 +00:00
|
|
|
$(eval $(call KMOD_template,USB,usb-core,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/usb/usbcore.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_USB))
|
2005-04-02 15:34:55 +00:00
|
|
|
$(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/usb/host/uhci.o \
|
|
|
|
,CONFIG_USB_UHCI_ALT))
|
|
|
|
$(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/usb/host/usb-ohci.o \
|
|
|
|
,CONFIG_USB_OHCI))
|
|
|
|
$(eval $(call KMOD_template,USB2,usb2,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.o \
|
|
|
|
,CONFIG_USB_EHCI_HCD))
|
|
|
|
$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/scsi/*.o \
|
|
|
|
$(MODULES_DIR)/kernel/drivers/usb/storage/*.o \
|
|
|
|
,CONFIG_USB_STORAGE))
|
|
|
|
$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/usb/printer.o \
|
|
|
|
,CONFIG_USB_PRINTER))
|
2005-03-17 00:28:36 +00:00
|
|
|
$(eval $(call KMOD_template,LP,lp,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/parport/parport.o \
|
2005-03-21 17:29:30 +00:00
|
|
|
$(MODULES_DIR)/kernel/drivers/parport/parport_splink.o \
|
2005-03-17 00:28:36 +00:00
|
|
|
$(MODULES_DIR)/kernel/drivers/char/lp.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_PARPORT))
|
2005-03-17 00:28:36 +00:00
|
|
|
$(eval $(call KMOD_template,VFAT,vfat,\
|
|
|
|
$(MODULES_DIR)/kernel/fs/vfat/vfat.o \
|
|
|
|
$(MODULES_DIR)/kernel/fs/fat/fat.o \
|
|
|
|
$(MODULES_DIR)/kernel/fs/msdos/msdos.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_VFAT_FS))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(eval $(call KMOD_template,CRYPTO,crypto,\
|
|
|
|
$(MODULES_DIR)/kernel/crypto/*.o \
|
|
|
|
))
|
2005-03-14 17:22:37 +00:00
|
|
|
$(eval $(call KMOD_template,PPP,ppp,\
|
2005-03-23 01:25:30 +00:00
|
|
|
$(MODULES_DIR)/kernel/drivers/net/ppp_async.o \
|
2005-03-14 17:22:37 +00:00
|
|
|
$(MODULES_DIR)/kernel/drivers/net/ppp_generic.o \
|
2005-03-16 16:14:14 +00:00
|
|
|
$(MODULES_DIR)/kernel/drivers/net/slhc.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_PPP))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(eval $(call KMOD_template,MPPE,mppe,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_PPP_MPPE_MPPC))
|
2005-03-23 01:25:30 +00:00
|
|
|
$(eval $(call KMOD_template,PPPOE,pppoe,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/net/pppoe.o \
|
|
|
|
$(MODULES_DIR)/kernel/drivers/net/pppox.o \
|
|
|
|
,CONFIG_PPPOE))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(eval $(call KMOD_template,TUN,tun,\
|
|
|
|
$(MODULES_DIR)/kernel/drivers/net/tun.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_TUN))
|
2005-03-06 03:53:29 +00:00
|
|
|
$(eval $(call KMOD_template,GRE,gre,\
|
|
|
|
$(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \
|
2005-03-21 16:04:14 +00:00
|
|
|
,CONFIG_NET_IPGRE))
|
2005-03-06 03:34:52 +00:00
|
|
|
$(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)
|