fix tgz image help
[openwrt.git] / target / linux / linux-2.6 / Makefile
1 # $Id$
2 # Linux 2.6 kernel target for the OpenWRT project
3
4 include $(TOPDIR)/rules.mk
5 include ../rules.mk
6
7 KERNEL:=2.6
8 LINUX_VERSION:=2.6.12.5
9 LINUX_KERNEL_MD5SUM:=076f0dc714112c764c790fbaef19e228
10 LINUX_SITE=http://www.fi.kernel.org/pub/linux/kernel/v2.6 \
11 http://www.fr.kernel.org/pub/linux/kernel/v2.6 \
12 http://www.kernel.org/pub/linux/kernel/v2.6 \
13 http://www.de.kernel.org/pub/linux/kernel/v2.6
14 MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
15 LINUX_KCONFIG:=./config/$(BOARD)
16 LINUX_BUILD_DIR:=$(BUILD_DIR)/linux-2.6-$(BOARD)
17 LINUX_TARGET_DIR:=$(LINUX_BUILD_DIR)/root
18 LINUX_KERNEL:=$(LINUX_BUILD_DIR)/vmlinux
19 LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
20 -e 's/mipsel/mips/' \
21 -e 's/powerpc/ppc/' \
22 -e 's/sh[234]/sh/' \
23 )
24
25 LINUX_SOURCE := linux-$(LINUX_VERSION).tar.bz2
26 LINUX_SOURCE_DIR := $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)
27 MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR)
28 TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/lib/modules/$(LINUX_VERSION)
29 IPKG_KERNEL:=IPKG_TMP=$(BUILD_DIR)/tmp IPKG_INSTROOT=$(LINUX_TARGET_DIR) IPKG_CONF_DIR=$(LINUX_BUILD_DIR) $(SCRIPT_DIR)/ipkg -force-defaults -force-depends
30
31 PKG_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules
32 PKG_RELEASE := 1
33
34 KERNEL_IPKG:=$(LINUX_BUILD_DIR)/kernel_$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)_$(ARCH).ipk
35 KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
36
37 KPKG_MAKEOPTS:= IPKG="$(IPKG_KERNEL)" \
38 BOARD="$(BOARD)" \
39 TARGET_DIR="$(LINUX_TARGET_DIR)" \
40 BUILD_DIR="$(LINUX_BUILD_DIR)" \
41 KERNEL_DIR="$(LINUX_SOURCE_DIR)" \
42 LINUX_VERSION="$(LINUX_VERSION)" \
43 KERNEL_RELEASE="$(PKG_RELEASE)"
44
45 include $(LINUX_KCONFIG)
46
47 INSTALL_TARGETS := $(KERNEL_IPKG)
48 TARGETS :=
49
50 ifeq ($(BOARD),x86)
51 include ./x86.mk
52 endif
53
54 include ../netfilter.mk
55
56 # Networking
57
58 $(eval $(call KMOD_template,ATM,atm,\
59 $(MODULES_DIR)/kernel/net/atm/atm.ko \
60 $(MODULES_DIR)/kernel/net/atm/br2684.ko \
61 ,CONFIG_ATM,,50,atm))
62
63 $(eval $(call KMOD_template,GRE,gre,\
64 $(MODULES_DIR)/kernel/net/ipv4/ip_gre.ko \
65 ,CONFIG_NET_IPGRE))
66
67 $(eval $(call KMOD_template,IMQ,imq,\
68 $(MODULES_DIR)/kernel/net/*/netfilter/*IMQ*.ko \
69 $(MODULES_DIR)/kernel/drivers/net/imq.ko \
70 ))
71
72 $(eval $(call KMOD_template,IPV6,ipv6,\
73 $(MODULES_DIR)/kernel/net/ipv6/ipv6.ko \
74 ,CONFIG_IPV6,,20,ipv6))
75
76 $(eval $(call KMOD_template,PPP,ppp,\
77 $(MODULES_DIR)/kernel/drivers/net/ppp_async.ko \
78 $(MODULES_DIR)/kernel/drivers/net/ppp_generic.ko \
79 $(MODULES_DIR)/kernel/drivers/net/slhc.ko \
80 ,CONFIG_PPP))
81
82 $(eval $(call KMOD_template,MPPE,mppe,\
83 $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.ko \
84 ,CONFIG_PPP_MPPE_MPPC))
85
86 $(eval $(call KMOD_template,PPPOATM,pppoatm,\
87 $(MODULES_DIR)/kernel/net/atm/pppoatm.ko \
88 ,CONFIG_PPPOATM))
89
90 $(eval $(call KMOD_template,PPPOE,pppoe,\
91 $(MODULES_DIR)/kernel/drivers/net/pppoe.ko \
92 $(MODULES_DIR)/kernel/drivers/net/pppox.ko \
93 ,CONFIG_PPPOE))
94
95 $(eval $(call KMOD_template,SCHED,sched,\
96 $(MODULES_DIR)/kernel/net/sched/*.ko \
97 ))
98
99 $(eval $(call KMOD_template,TUN,tun,\
100 $(MODULES_DIR)/kernel/drivers/net/tun.ko \
101 ,CONFIG_TUN,,20,tun))
102
103
104 # Filtering / Firewalling
105
106 $(eval $(call KMOD_template,ARPTABLES,arptables,\
107 $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.ko \
108 ,CONFIG_IP_NF_ARPTABLES))
109
110 $(eval $(call KMOD_template,EBTABLES,ebtables,\
111 $(MODULES_DIR)/kernel/net/bridge/netfilter/*.ko \
112 ,CONFIG_BRIDGE_NF_EBTABLES))
113
114 # metapackage for compatibility ...
115 $(eval $(call KMOD_template,IPTABLES_EXTRA,iptables-extra,\
116 ,,kmod-ipt-conntrack kmod-ipt-extra kmod-ipt-filter kmod-ipt-ipopt kmod-ipt-ipsec kmod-ipt-nat kmod-ipt-nat-extra kmod-ipt-queue kmod-ipt-ulogd))
117
118 $(eval $(call KMOD_template,IPT_CONNTRACK,ipt-conntrack,\
119 $(foreach mod,$(IPKG_KMOD_IPT_CONNTRACK-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
120 ))
121
122 $(eval $(call KMOD_template,IPT_EXTRA,ipt-extra,\
123 $(foreach mod,$(IPKG_KMOD_IPT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
124 ))
125
126 $(eval $(call KMOD_template,IPT_FILTER,ipt-filter,\
127 $(foreach mod,$(IPKG_KMOD_IPT_FILTER-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
128 ))
129
130 $(eval $(call KMOD_template,IPT_IPOPT,ipt-ipopt,\
131 $(foreach mod,$(IPKG_KMOD_IPT_IPOPT-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
132 ))
133
134 $(eval $(call KMOD_template,IPT_IPSEC,ipt-ipsec,\
135 $(foreach mod,$(IPKG_KMOD_IPT_IPSEC-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
136 ))
137
138 $(eval $(call KMOD_template,IPT_NAT,ipt-nat,\
139 $(foreach mod,$(IPKG_KMOD_IPT_NAT-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
140 ))
141
142 $(eval $(call KMOD_template,IPT_NAT_EXTRA,ipt-nat-extra,\
143 $(foreach mod,$(IPKG_KMOD_IPT_NAT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
144 ,,,40,$(IPKG_KMOD_IPT_NAT_EXTRA-m)))
145
146 $(eval $(call KMOD_template,IPT_QUEUE,ipt-queue,\
147 $(foreach mod,$(IPKG_KMOD_IPT_QUEUE-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
148 ))
149
150 $(eval $(call KMOD_template,IPT_ULOG,ipt-ulog,\
151 $(foreach mod,$(IPKG_KMOD_IPT_ULOG-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
152 ))
153
154 $(eval $(call KMOD_template,IP6TABLES,ip6tables,\
155 $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.ko \
156 ,CONFIG_IP6_NF_IPTABLES,kmod-ipv6))
157
158
159 # Block devices
160
161 $(eval $(call KMOD_template,IDE,ide,\
162 $(MODULES_DIR)/kernel/drivers/ide/*.ko \
163 $(MODULES_DIR)/kernel/drivers/ide/*/*.ko \
164 ,CONFIG_IDE))
165
166 $(eval $(call KMOD_template,LOOP,loop,\
167 $(MODULES_DIR)/kernel/drivers/block/loop.ko \
168 ,CONFIG_BLK_DEV_LOOP,,20,loop))
169
170 $(eval $(call KMOD_template,NBD,nbd,\
171 $(MODULES_DIR)/kernel/drivers/block/nbd.ko \
172 ,CONFIG_BLK_DEV_NBD,,20,nbd))
173
174
175 # Crypto
176
177 $(eval $(call KMOD_template,CRYPTO,crypto,\
178 $(MODULES_DIR)/kernel/crypto/*.ko \
179 ))
180
181
182 # Filesystems
183
184 $(eval $(call KMOD_template,FS_CIFS,fs-cifs,\
185 $(MODULES_DIR)/kernel/fs/cifs/cifs.ko \
186 ,CONFIG_CIFS,kmod-nls-base,30,cifs))
187
188 $(eval $(call KMOD_template,FS_EXT2,fs-ext2,\
189 $(MODULES_DIR)/kernel/fs/ext2/ext2.ko \
190 ,CONFIG_EXT2_FS,,30,ext2))
191
192 $(eval $(call KMOD_template,FS_EXT3,fs-ext3,\
193 $(MODULES_DIR)/kernel/fs/ext3/ext3.ko \
194 $(MODULES_DIR)/kernel/fs/jbd/jbd.ko \
195 ,CONFIG_EXT3_FS,,30,jbd ext3))
196
197 $(eval $(call KMOD_template,FS_HFSPLUS,fs-hfsplus,\
198 $(MODULES_DIR)/kernel/fs/hfsplus/hfsplus.ko \
199 ,CONFIG_HFSPLUS_FS,kmod-nls-base,30,hfsplus))
200
201 $(eval $(call KMOD_template,FS_NFS,fs-nfs,\
202 $(MODULES_DIR)/kernel/fs/lockd/lockd.ko \
203 $(MODULES_DIR)/kernel/fs/nfs/nfs.ko \
204 $(MODULES_DIR)/kernel/net/sunrpc/sunrpc.ko \
205 ,CONFIG_NFS_FS,,30,sunrpc lockd nfs))
206
207 $(eval $(call KMOD_template,FS_VFAT,fs-vfat,\
208 $(MODULES_DIR)/kernel/fs/fat/fat.ko \
209 $(MODULES_DIR)/kernel/fs/vfat/vfat.ko \
210 ,CONFIG_VFAT_FS,kmod-nls-base,30,fat vfat))
211
212 $(eval $(call KMOD_template,FS_XFS,fs-xfs,\
213 $(MODULES_DIR)/kernel/fs/xfs/xfs.ko \
214 ,CONFIG_XFS_FS,,30,xfs))
215
216
217 # Multimedia
218
219 $(eval $(call KMOD_template,PWC,pwc,\
220 $(MODULES_DIR)/kernel/drivers/usb/media/pwc/pwc.ko \
221 ,CONFIG_USB_PWC,kmod-videodev,63,pwc))
222
223 $(eval $(call KMOD_template,SOUNDCORE,soundcore,\
224 $(MODULES_DIR)/kernel/sound/soundcore.ko \
225 ,CONFIG_SOUND,,30,soundcore))
226
227 $(eval $(call KMOD_template,VIDEODEV,videodev,\
228 $(MODULES_DIR)/kernel/drivers/media/video/v4l1-compat.ko \
229 $(MODULES_DIR)/kernel/drivers/media/video/v4l2-common.ko \
230 $(MODULES_DIR)/kernel/drivers/media/video/videodev.ko \
231 ,CONFIG_VIDEO_DEV,,62,videodev))
232
233
234 # NLS
235
236 $(eval $(call KMOD_template,NLS_BASE,nls-base,\
237 $(MODULES_DIR)/kernel/fs/nls/nls_base.ko \
238 ,CONFIG_NLS,,20,nls_base))
239
240 $(eval $(call KMOD_template,NLS_CP437,nls-cp437,\
241 $(MODULES_DIR)/kernel/fs/nls/nls_cp437.ko \
242 ,CONFIG_NLS_CODEPAGE_437,,20,nls_cp437))
243
244 $(eval $(call KMOD_template,NLS_CP850,nls-cp850,\
245 $(MODULES_DIR)/kernel/fs/nls/nls_cp850.ko \
246 ,CONFIG_NLS_CODEPAGE_850,,20,nls_cp850))
247
248 $(eval $(call KMOD_template,NLS_ISO8859_1,nls-iso8859-1,\
249 $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-1.ko \
250 ,CONFIG_NLS_ISO8859_1,,20,nls_iso8859-1))
251
252 $(eval $(call KMOD_template,NLS_ISO8859_15,nls-iso8859-15,\
253 $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-15.ko \
254 ,CONFIG_NLS_ISO8859_15,,20,nls_iso8859-15))
255
256 $(eval $(call KMOD_template,NLS_UTF8,nls-utf8,\
257 $(MODULES_DIR)/kernel/fs/nls/nls_utf8.ko \
258 ,CONFIG_NLS_UTF8,,20,nls_utf8))
259
260
261 # Network devices
262
263 $(eval $(call KMOD_template,NET_3C59X,net-3c59x,\
264 $(MODULES_DIR)/kernel/drivers/net/3c59x.ko \
265 ,CONFIG_VORTEX,,10,3c59x))
266
267 $(eval $(call KMOD_template,NET_8139TOO,net-8139too,\
268 $(MODULES_DIR)/kernel/drivers/net/8139too.ko \
269 ,CONFIG_8139TOO,,10,8139too))
270
271 $(eval $(call KMOD_template,NET_AIRO,net-airo,\
272 $(MODULES_DIR)/kernel/drivers/net/wireless/airo.ko \
273 ,CONFIG_AIRO,,10,airo))
274
275 $(eval $(call KMOD_template,NET_B44,net-b44,\
276 $(MODULES_DIR)/kernel/drivers/net/b44.ko \
277 ,CONFIG_B44,,10,b44))
278
279 $(eval $(call KMOD_template,NET_E100,net-e100,\
280 $(MODULES_DIR)/kernel/drivers/net/e100.ko \
281 ,CONFIG_E100,,10,e100))
282
283 $(eval $(call KMOD_template,NET_HERMES,net-hermes,\
284 $(MODULES_DIR)/kernel/drivers/net/wireless/hermes.ko \
285 $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco.ko \
286 ,CONFIG_HERMES,,10,hermes orinoco))
287
288 $(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-pci,\
289 $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_pci.ko \
290 ,CONFIG_PCI_HERMES,kmod-net-hermes,11,orinoco_pci))
291
292 $(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-plx,\
293 $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_plx.ko \
294 ,CONFIG_PLX_HERMES,kmod-net-hermes,11,orinoco_plx))
295
296 $(eval $(call KMOD_template,NET_NATSEMI,net-natsemi,\
297 $(MODULES_DIR)/kernel/drivers/net/natsemi.ko \
298 ,CONFIG_NATSEMI,,10,natsemi))
299
300 $(eval $(call KMOD_template,NET_PRISM54,net-prism54,\
301 $(MODULES_DIR)/kernel/drivers/net/wireless/prism54/prism54.ko \
302 ,CONFIG_PRISM54,,10,prism54))
303
304
305 # PCMCIA/CardBus
306
307 $(eval $(call KMOD_template,PCMCIA_CORE,pcmcia-core,\
308 $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core.ko \
309 $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket.ko \
310 ,CONFIG_PCMCIA,,50,pcmcia_core))
311
312
313 # USB
314
315 $(eval $(call KMOD_template,USB,usb-core,\
316 $(MODULES_DIR)/kernel/drivers/usb/core/usbcore.ko \
317 ,CONFIG_USB,,50,usbcore))
318
319 $(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
320 $(MODULES_DIR)/kernel/drivers/usb/host/ohci-hcd.ko \
321 ,CONFIG_USB_OHCI_HCD,kmod-usb-core,60,ohci-hcd))
322
323 $(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
324 $(MODULES_DIR)/kernel/drivers/usb/host/uhci.ko \
325 ,CONFIG_USB_UHCI_ALT,kmod-usb-core,60,uhci))
326
327 $(eval $(call KMOD_template,USB2,usb2,\
328 $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.ko \
329 ,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
330
331 $(eval $(call KMOD_template,USB_ACM,usb-acm,\
332 $(MODULES_DIR)/kernel/drivers/usb/class/cdc-acm.ko \
333 ,CONFIG_USB_ACM))
334
335 $(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
336 $(MODULES_DIR)/kernel/drivers/usb/class/audio.ko \
337 ,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
338
339 $(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
340 $(MODULES_DIR)/kernel/drivers/usb/class/usblp.ko \
341 ,CONFIG_USB_PRINTER,kmod-usb-core,60,usblp))
342
343 $(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
344 $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.ko \
345 ,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial))
346
347 $(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
348 $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.ko \
349 ,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa))
350
351 $(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\
352 $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.ko \
353 ,CONFIG_USB_SERIAL_FTDI_SIO,kmod-usb-serial,61,ftdi_sio))
354
355 $(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
356 $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.ko \
357 ,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232))
358
359 $(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
360 $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.ko \
361 ,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303))
362
363 $(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
364 $(MODULES_DIR)/kernel/drivers/scsi/scsi_mod.ko \
365 $(MODULES_DIR)/kernel/drivers/scsi/sd_mod.ko \
366 $(MODULES_DIR)/kernel/drivers/usb/storage/usb-storage.ko \
367 ,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
368
369
370 # Misc. devices
371
372 $(eval $(call KMOD_template,AX25,ax25,\
373 $(MODULES_DIR)/kernel/net/ax25/ax25.ko \
374 $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.ko \
375 ,CONFIG_AX25,,90,ax25 mkiss))
376
377 $(eval $(call KMOD_template,BLUETOOTH,bluetooth,\
378 $(MODULES_DIR)/kernel/net/bluetooth/bluetooth.ko \
379 $(MODULES_DIR)/kernel/net/bluetooth/l2cap.ko \
380 $(MODULES_DIR)/kernel/net/bluetooth/sco.ko \
381 $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/rfcomm.ko \
382 $(MODULES_DIR)/kernel/drivers/bluetooth/hci_uart.ko \
383 ,CONFIG_BLUEZ))
384
385
386 $(TARGETS): $(PACKAGE_DIR)
387
388 $(PACKAGE_DIR):
389 mkdir -p $(PACKAGE_DIR)
390
391 $(DL_DIR)/$(LINUX_SOURCE):
392 -mkdir -p $(DL_DIR)
393 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE) $(MAKE_TRACE)
394
395 $(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
396 -mkdir -p $(LINUX_BUILD_DIR)
397 bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(LINUX_BUILD_DIR) $(TAR_OPTIONS) -
398 rm -f $(LINUX_DIR)
399 ln -s $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR)
400 touch $(LINUX_DIR)/.unpacked
401
402 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
403 $(PATCH) $(LINUX_DIR) ./patches/generic $(MAKE_TRACE)
404 [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD) $(MAKE_TRACE)
405 touch $(LINUX_DIR)/.patched
406
407 $(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
408 -cp $(LINUX_KCONFIG) $(LINUX_DIR)/.config
409 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) oldconfig $(MAKE_TRACE)
410 touch $(LINUX_DIR)/.configured
411
412 $(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.configured
413 $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) $(MAKE_TRACE)
414
415 $(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
416 $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@ $(MAKE_TRACE)
417 touch -c $(LINUX_KERNEL)
418
419 $(LINUX_DIR)/.modules_done: $(LINUX_KERNEL) $(LINUX_IMAGE)
420 rm -rf $(LINUX_BUILD_DIR)/modules
421 $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) modules $(MAKE_TRACE)
422 $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE)
423 touch $(LINUX_DIR)/.modules_done
424
425 $(STAGING_DIR)/include/linux/version.h: $(LINUX_DIR)/.configured
426 mkdir -p $(STAGING_DIR)/include
427 tar -ch -C $(LINUX_DIR)/include -f - linux | tar -xf - -C $(STAGING_DIR)/include/
428 tar -ch -C $(LINUX_DIR)/include -f - asm | tar -xf - -C $(STAGING_DIR)/include/
429
430 $(STAMP_DIR)/.linux-compile: $(LINUX_DIR)/.modules_done
431 @mkdir -p $(STAMP_DIR)
432 @$(MAKE) $(TARGETS)
433 ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR)
434 @$(TRACE) target/linux/package
435 $(MAKE) -C $(TOPDIR)/target/linux/package \
436 $(KPKG_MAKEOPTS) \
437 compile
438 touch $@
439
440 $(TARGET_MODULES_DIR):
441 -mkdir -p $(TARGET_MODULES_DIR)
442
443 $(KERNEL_IPKG):
444 rm -rf $(KERNEL_IDIR)
445 mkdir -p $(KERNEL_IDIR)/etc
446 $(SCRIPT_DIR)/make-ipkg-dir.sh $(KERNEL_IDIR) ../control/kernel.control $(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE) $(ARCH)
447 if [ -f ./config/$(BOARD).modules ]; then \
448 cp ./config/$(BOARD).modules $(KERNEL_IDIR)/etc/modules; \
449 fi
450 $(IPKG_BUILD) $(KERNEL_IDIR) $(LINUX_BUILD_DIR) $(MAKE_TRACE)
451
452 source: $(DL_DIR)/$(LINUX_SOURCE)
453 prepare: $(LINUX_DIR)/.configured
454 compile:
455 $(MAKE) $(STAMP_DIR)/.linux-compile $(MAKE_TRACE)
456
457 install: compile $(TARGET_MODULES_DIR) $(KERNEL_IPKG)
458 rm -rf $(LINUX_BUILD_DIR)/root*
459 cp -fpR $(BUILD_DIR)/root $(LINUX_BUILD_DIR)/
460 echo -e 'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR)/ipkg.conf
461 $(MAKE) -C $(TOPDIR)/target/linux/package \
462 $(KPKG_MAKEOPTS) \
463 install
464 @{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL) install $(INSTALL_TARGETS) || true; } $(MAKE_TRACE)
465
466 mostlyclean:
467 rm -f $(STAMP_DIR)/.linux-compile
468 rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.modules_done
469 rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.drivers-unpacked
470 $(MAKE) -C $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) clean $(MAKE_TRACE)
471 rm -f $(LINUX_KERNEL) $(LINUX_IMAGE)
472
473 rebuild:
474 -$(MAKE) mostlyclean
475 if [ -f $(LINUX_KERNEL) ]; then \
476 $(MAKE) clean $(MAKE_TRACE); \
477 fi
478 $(MAKE) compile $(MAKE_TRACE)
479
480 clean:
481 rm -f $(STAMP_DIR)/.linux-compile
482 rm -rf $(LINUX_BUILD_DIR)
483 rm -f $(TARGETS)
This page took 0.057277 seconds and 5 git commands to generate.