3 include $(TOPDIR
)/rules.mk
7 PKG_BUILD_DIR
:= $(BUILD_DIR
)/linux-modules
15 ifeq ($$(strip $(4)),)
21 PKG_
$(1) := $(PACKAGE_DIR
)/kmod-
$(2)_
$(LINUX_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
22 I_
$(1) := $(PKG_BUILD_DIR
)/ipkg
/$(2)
24 ifeq ($$(KDEPEND_
$(1)),m
)
25 ifneq ($(BR2_PACKAGE_KMOD_
$(1)),)
26 TARGETS
+= $$(PKG_
$(1))
28 ifeq ($(BR2_PACKAGE_KMOD_
$(1)),y
)
29 INSTALL_TARGETS
+= $$(PKG_
$(1))
33 $$(PKG_
$(1)): $(LINUX_DIR
)/.modules_done
34 mkdir
-p
$$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
35 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(I_
$(1)) control
/kmod-
$(2).control
$(LINUX_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
36 cp
$(3) $$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
37 $(IPKG_BUILD
) $$(I_
$(1)) $(PACKAGE_DIR
)
41 $(eval
$(call KMOD_template
,ARPT
,arptables
,\
42 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/arp
*.o \
43 ,CONFIG_IP_NF_ARPTABLES
))
44 $(eval
$(call KMOD_template
,EBT
,ebtables
,\
45 $(MODULES_DIR
)/kernel
/net
/bridge
/netfilter
/*.o \
46 ,CONFIG_BRIDGE_NF_EBTABLES
))
47 $(eval
$(call KMOD_template
,IPT4
,iptables-extra
,\
48 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip
*.o \
50 $(eval
$(call KMOD_template
,IPT6
,ip6tables
,\
51 $(MODULES_DIR
)/kernel
/net
/ipv6
/netfilter
/ip
*.o \
52 ,CONFIG_IP6_NF_IPTABLES
))
53 $(eval
$(call KMOD_template
,IPV6
,ipv6
,\
54 $(MODULES_DIR
)/kernel
/net
/ipv6
/ipv6.o \
56 $(eval
$(call KMOD_template
,SMBFS
,smbfs
,\
57 $(MODULES_DIR
)/kernel
/fs
/smbfs
/smbfs.o \
59 $(eval
$(call KMOD_template
,NFS
,nfs
,\
60 $(MODULES_DIR
)/kernel
/fs
/lockd
/*.o \
61 $(MODULES_DIR
)/kernel
/fs
/nfs
/*.o \
62 $(MODULES_DIR
)/kernel
/net
/sunrpc
/*.o \
64 $(eval
$(call KMOD_template
,USB
,usb
,\
65 $(MODULES_DIR
)/kernel
/drivers
/scsi
/*.o \
66 $(MODULES_DIR
)/kernel
/drivers
/usb
/*.o \
67 $(MODULES_DIR
)/kernel
/drivers
/usb
/*/*.o \
69 $(eval
$(call KMOD_template
,LP
,lp
,\
70 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport.o \
71 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport_splink.o \
72 $(MODULES_DIR
)/kernel
/drivers
/char
/lp.o \
74 $(eval
$(call KMOD_template
,VFAT
,vfat
,\
75 $(MODULES_DIR
)/kernel
/fs
/vfat
/vfat.o \
76 $(MODULES_DIR
)/kernel
/fs
/fat
/fat.o \
77 $(MODULES_DIR
)/kernel
/fs
/msdos
/msdos.o \
79 $(eval
$(call KMOD_template
,CRYPTO
,crypto
,\
80 $(MODULES_DIR
)/kernel
/crypto
/*.o \
82 $(eval
$(call KMOD_template
,PPP
,ppp
,\
83 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_generic.o \
84 $(MODULES_DIR
)/kernel
/drivers
/net
/slhc.o \
86 $(eval
$(call KMOD_template
,MPPE
,mppe
,\
87 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_mppe_mppc.o \
88 ,CONFIG_PPP_MPPE_MPPC
))
89 $(eval
$(call KMOD_template
,TUN
,tun
,\
90 $(MODULES_DIR
)/kernel
/drivers
/net
/tun.o \
92 $(eval
$(call KMOD_template
,GRE
,gre
,\
93 $(MODULES_DIR
)/kernel
/net
/ipv4
/ip_gre.o \
95 $(eval
$(call KMOD_template
,SCHED
,sched
,\
96 $(MODULES_DIR
)/kernel
/net
/sched
/*.o \
99 $(TARGETS
): $(PACKAGE_DIR
)
102 mkdir
-p
$(PACKAGE_DIR
)
105 prepare
: $(LINUX_DIR
)/.configured
106 compile
: $(LINUX_DIR
)/.modules_done
$(TARGETS
)
108 install: compile
$(TARGET_MODULES_DIR
)
109 @
[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG
) install $(INSTALL_TARGETS
) || true
111 clean: linux-dirclean