3 include $(TOPDIR
)/rules.mk
4 include .
/linux-2.4
/linux.mk
5 include .
/linux-2.4
/linux.config
7 PKG_BUILD_DIR
:= $(BUILD_DIR
)/linux-modules
16 ifeq ($$(strip $(4)),)
22 PKG_
$(1) := $(PACKAGE_DIR
)/kmod-
$(2)_
$(LINUX_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
23 I_
$(1) := $(PKG_BUILD_DIR
)/ipkg
/$(2)
25 ifeq ($$(KDEPEND_
$(1)),m
)
26 ifneq ($(BR2_PACKAGE_KMOD_
$(1)),)
27 TARGETS
+= $$(PKG_
$(1))
29 ifeq ($(BR2_PACKAGE_KMOD_
$(1)),y
)
30 INSTALL_TARGETS
+= $$(PKG_
$(1))
34 $$(PKG_
$(1)): $(LINUX_DIR
)/.modules_done
35 mkdir
-p
$$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
36 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(I_
$(1)) control
/kmod-
$(2).control
$(LINUX_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
37 cp
$(3) $$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
38 $(IPKG_BUILD
) $$(I_
$(1)) $(PACKAGE_DIR
)
42 $(eval
$(call KMOD_template
,DIAG
,diag
,\
43 $(MODULES_DIR
)/kernel
/drivers
/net
/diag
/diag.o \
45 $(eval
$(call KMOD_template
,BRCM_WL
,brcm-wl
,\
46 $(MODULES_DIR
)/kernel
/drivers
/net
/wl
/wl.o \
48 $(eval
$(call KMOD_template
,B44
,b44
,\
49 $(MODULES_DIR
)/kernel
/drivers
/net
/b44.o \
51 $(eval
$(call KMOD_template
,BRCM_ET
,brcm-et
,\
52 $(MODULES_DIR
)/kernel
/drivers
/net
/et
/et.o \
54 $(eval
$(call KMOD_template
,ARPT
,arptables
,\
55 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/arp
*.o \
56 ,CONFIG_IP_NF_ARPTABLES
))
57 $(eval
$(call KMOD_template
,EBT
,ebtables
,\
58 $(MODULES_DIR
)/kernel
/net
/bridge
/netfilter
/*.o \
59 ,CONFIG_BRIDGE_NF_EBTABLES
))
60 $(eval
$(call KMOD_template
,IPTABLES_V4
,iptables
,\
61 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ipt_state.o \
62 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/iptable_nat.o \
63 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip_nat_ftp.o \
64 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ipt_conntrack.o \
65 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip_conntrack.o \
66 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip_conntrack_ftp.o \
67 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ipt_MASQUERADE.o \
69 $(eval
$(call KMOD_template
,IPTABLES_V4_EXTRA
,iptables-extra
,\
70 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip
*.o \
72 $(eval
$(call KMOD_template
,IPTABLES_V6
,ip6tables
,\
73 $(MODULES_DIR
)/kernel
/net
/ipv6
/netfilter
/ip
*.o \
74 ,CONFIG_IP6_NF_IPTABLES
))
75 $(eval
$(call KMOD_template
,IPV6
,ipv6
,\
76 $(MODULES_DIR
)/kernel
/net
/ipv6
/ipv6.o \
78 $(eval
$(call KMOD_template
,CIFS
,cifs
,\
79 $(MODULES_DIR
)/kernel
/fs
/cifs
/cifs.o \
81 $(eval
$(call KMOD_template
,NFS
,nfs
,\
82 $(MODULES_DIR
)/kernel
/fs
/lockd
/*.o \
83 $(MODULES_DIR
)/kernel
/fs
/nfs
/*.o \
84 $(MODULES_DIR
)/kernel
/net
/sunrpc
/*.o \
86 $(eval
$(call KMOD_template
,USB
,usb-core
,\
87 $(MODULES_DIR
)/kernel
/drivers
/usb
/usbcore.o \
89 $(eval
$(call KMOD_template
,USB_UHCI
,usb-uhci
,\
90 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/uhci.o \
91 ,CONFIG_USB_UHCI_ALT
))
92 $(eval
$(call KMOD_template
,USB_OHCI
,usb-ohci
,\
93 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/usb-ohci.o \
95 $(eval
$(call KMOD_template
,USB2
,usb2
,\
96 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ehci-hcd.o \
97 ,CONFIG_USB_EHCI_HCD
))
98 $(eval
$(call KMOD_template
,USB_STORAGE
,usb-storage
,\
99 $(MODULES_DIR
)/kernel
/drivers
/scsi
/*.o \
100 $(MODULES_DIR
)/kernel
/drivers
/usb
/storage
/*.o \
101 ,CONFIG_USB_STORAGE
))
102 $(eval
$(call KMOD_template
,USB_PRINTER
,usb-printer
,\
103 $(MODULES_DIR
)/kernel
/drivers
/usb
/printer.o \
104 ,CONFIG_USB_PRINTER
))
105 $(eval
$(call KMOD_template
,LOOP
,loop
,\
106 $(MODULES_DIR
)/kernel
/drivers
/block
/loop.o \
107 ,CONFIG_BLK_DEV_LOOP
))
108 $(eval
$(call KMOD_template
,NBD
,nbd
,\
109 $(MODULES_DIR
)/kernel
/drivers
/block
/nbd.o \
110 ,CONFIG_BLK_DEV_NBD
))
111 $(eval
$(call KMOD_template
,LP
,lp
,\
112 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport.o \
113 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport_splink.o \
114 $(MODULES_DIR
)/kernel
/drivers
/char
/lp.o \
116 $(eval
$(call KMOD_template
,IDE
,ide
,\
117 $(MODULES_DIR
)/kernel
/drivers
/ide
/*.o \
118 $(MODULES_DIR
)/kernel
/drivers
/ide
/*/*.o \
120 $(eval
$(call KMOD_template
,EXT2
,ext2
,\
121 $(MODULES_DIR
)/kernel
/fs
/ext2
/*.o \
123 $(eval
$(call KMOD_template
,EXT3
,ext3
,\
124 $(MODULES_DIR
)/kernel
/fs
/ext3
/*.o \
125 $(MODULES_DIR
)/kernel
/fs
/jbd
/*.o \
127 $(eval
$(call KMOD_template
,XFS
,xfs
,\
128 $(MODULES_DIR
)/kernel
/fs
/xfs
/*.o \
130 $(eval
$(call KMOD_template
,HFSPLUS
,hfsplus
,\
131 $(MODULES_DIR
)/kernel
/fs
/hfsplus
/*.o \
133 $(eval
$(call KMOD_template
,VFAT
,vfat
,\
134 $(MODULES_DIR
)/kernel
/fs
/vfat
/vfat.o \
135 $(MODULES_DIR
)/kernel
/fs
/fat
/fat.o \
137 $(eval
$(call KMOD_template
,CRYPTO
,crypto
,\
138 $(MODULES_DIR
)/kernel
/crypto
/*.o \
140 $(eval
$(call KMOD_template
,PPP
,ppp
,\
141 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.o \
142 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_generic.o \
143 $(MODULES_DIR
)/kernel
/drivers
/net
/slhc.o \
145 $(eval
$(call KMOD_template
,MPPE
,mppe
,\
146 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_mppe_mppc.o \
147 ,CONFIG_PPP_MPPE_MPPC
))
148 $(eval
$(call KMOD_template
,PPPOE
,pppoe
,\
149 $(MODULES_DIR
)/kernel
/drivers
/net
/pppoe.o \
150 $(MODULES_DIR
)/kernel
/drivers
/net
/pppox.o \
152 $(eval
$(call KMOD_template
,TUN
,tun
,\
153 $(MODULES_DIR
)/kernel
/drivers
/net
/tun.o \
155 $(eval
$(call KMOD_template
,GRE
,gre
,\
156 $(MODULES_DIR
)/kernel
/net
/ipv4
/ip_gre.o \
158 $(eval
$(call KMOD_template
,SCHED
,sched
,\
159 $(MODULES_DIR
)/kernel
/net
/sched
/*.o \
162 $(TARGETS
): $(PACKAGE_DIR
)
165 mkdir
-p
$(PACKAGE_DIR
)
168 prepare
: $(LINUX_DIR
)/.configured
169 compile
: $(LINUX_DIR
)/.modules_done
$(TARGETS
)
171 install: compile
$(TARGET_MODULES_DIR
)
172 @
[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG
) install $(INSTALL_TARGETS
) || true
174 clean: linux-dirclean