add md5sums
[openwrt.git] / openwrt / package / linux / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4 include ./linux.mk
5
6 PKG_BUILD_DIR := $(BUILD_DIR)/linux-modules
7 PKG_RELEASE := 1
8
9 TARGETS :=
10 INSTALL_TARGETS :=
11
12 define KMOD_template
13 PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
14 I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
15 ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
16 TARGETS += $$(PKG_$(1))
17 endif
18 ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
19 INSTALL_TARGETS += $$(PKG_$(1))
20 endif
21
22 $$(PKG_$(1)): $(LINUX_DIR)/.modules_done
23 mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
24 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) control/kmod-$(2).control $(LINUX_VERSION)-$(PKG_RELEASE) $(ARCH)
25 cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
26 $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
27
28 endef
29
30 $(eval $(call KMOD_template,ARPT,arptables,\
31 $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.o \
32 ))
33 $(eval $(call KMOD_template,EBT,ebtables,\
34 $(MODULES_DIR)/kernel/net/bridge/netfilter/*.o \
35 ))
36 $(eval $(call KMOD_template,IPT4,iptables-extra,\
37 $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip*.o \
38 ))
39 $(eval $(call KMOD_template,IPT6,ip6tables,\
40 $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.o \
41 ))
42 $(eval $(call KMOD_template,IPV6,ipv6,\
43 $(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
44 ))
45 $(eval $(call KMOD_template,SMBFS,smbfs,\
46 $(MODULES_DIR)/kernel/fs/smbfs/smbfs.o \
47 ))
48 $(eval $(call KMOD_template,NFS,nfs,\
49 $(MODULES_DIR)/kernel/fs/lockd/*.o \
50 $(MODULES_DIR)/kernel/fs/nfs/*.o \
51 $(MODULES_DIR)/kernel/net/sunrpc/*.o \
52 ))
53 $(eval $(call KMOD_template,USB,usb,\
54 $(MODULES_DIR)/kernel/drivers/scsi/*.o \
55 $(MODULES_DIR)/kernel/drivers/usb/*.o \
56 $(MODULES_DIR)/kernel/drivers/usb/*/*.o \
57 ))
58 $(eval $(call KMOD_template,LP,lp,\
59 $(MODULES_DIR)/kernel/drivers/parport/parport.o \
60 $(MODULES_DIR)/kernel/drivers/char/lp.o \
61 ))
62 $(eval $(call KMOD_template,VFAT,vfat,\
63 $(MODULES_DIR)/kernel/fs/vfat/vfat.o \
64 $(MODULES_DIR)/kernel/fs/fat/fat.o \
65 $(MODULES_DIR)/kernel/fs/msdos/msdos.o \
66 ))
67 $(eval $(call KMOD_template,CRYPTO,crypto,\
68 $(MODULES_DIR)/kernel/crypto/*.o \
69 ))
70 $(eval $(call KMOD_template,PPP,ppp,\
71 $(MODULES_DIR)/kernel/drivers/net/ppp_generic.o \
72 $(MODULES_DIR)/kernel/drivers/net/slhc.o \
73 ))
74 $(eval $(call KMOD_template,MPPE,mppe,\
75 $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.o \
76 ))
77 $(eval $(call KMOD_template,TUN,tun,\
78 $(MODULES_DIR)/kernel/drivers/net/tun.o \
79 ))
80 $(eval $(call KMOD_template,GRE,gre,\
81 $(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \
82 ))
83 $(eval $(call KMOD_template,SCHED,sched,\
84 $(MODULES_DIR)/kernel/net/sched/*.o \
85 ))
86
87 $(TARGETS): $(PACKAGE_DIR)
88
89 $(PACKAGE_DIR):
90 mkdir -p $(PACKAGE_DIR)
91
92 source: linux-source
93 prepare: $(LINUX_DIR)/.configured
94 compile: $(LINUX_DIR)/.modules_done $(TARGETS)
95
96 install: compile $(TARGET_MODULES_DIR)
97 @[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG) install $(INSTALL_TARGETS) || true
98
99 clean: linux-dirclean
100 rm -f $(TARGETS)
This page took 0.04893 seconds and 5 git commands to generate.