backport flash-map driver and serial setup from 2.6 for netgear wgt634, split flash...
[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.15-rc6
9 LINUX_KERNEL_MD5SUM:=eeead0b884811411fd2df8520744b253
10 LINUX_SITE=http://www.fi.kernel.org/pub/linux/kernel/v2.6/testing \
11 http://www.fr.kernel.org/pub/linux/kernel/v2.6/testing \
12 http://www.kernel.org/pub/linux/kernel/v2.6/testing \
13 http://www.de.kernel.org/pub/linux/kernel/v2.6/testing
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,$(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,$(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,$(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,$(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,$(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,$(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,$(IPT_NAT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).ko) \
144 ,,,40,$(IPT_NAT_EXTRA-m)))
145
146 $(eval $(call KMOD_template,IPT_QUEUE,ipt-queue,\
147 $(foreach mod,$(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,$(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.ko \
309 $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core.ko \
310 $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket.ko \
311 $(MODULES_DIR)/kernel/drivers/pcmcia/rsrc_nonstatic.ko \
312 ,CONFIG_PCMCIA,,50,pcmcia_core pcmcia yenta_socket rsrc_nonstatic))
313
314 $(eval $(call KMOD_template,PCMCIA_SERIAL,pcmcia-serial,\
315 $(MODULES_DIR)/kernel/drivers/serial/serial_cs.ko \
316 ,CONFIG_SERIAL_8250_CS))
317
318
319 # USB
320
321 $(eval $(call KMOD_template,USB,usb-core,\
322 $(MODULES_DIR)/kernel/drivers/usb/core/usbcore.ko \
323 ,CONFIG_USB,,50,usbcore))
324
325 $(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
326 $(MODULES_DIR)/kernel/drivers/usb/host/ohci-hcd.ko \
327 ,CONFIG_USB_OHCI_HCD,kmod-usb-core,60,ohci-hcd))
328
329 $(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
330 $(MODULES_DIR)/kernel/drivers/usb/host/uhci.ko \
331 ,CONFIG_USB_UHCI_ALT,kmod-usb-core,60,uhci))
332
333 $(eval $(call KMOD_template,USB2,usb2,\
334 $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.ko \
335 ,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
336
337 $(eval $(call KMOD_template,USB_ACM,usb-acm,\
338 $(MODULES_DIR)/kernel/drivers/usb/class/cdc-acm.ko \
339 ,CONFIG_USB_ACM))
340
341 #$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
342 # $(MODULES_DIR)/kernel/drivers/usb/class/audio.ko \
343 #,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
344
345 $(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
346 $(MODULES_DIR)/kernel/drivers/usb/class/usblp.ko \
347 ,CONFIG_USB_PRINTER,kmod-usb-core,60,usblp))
348
349 $(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
350 $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.ko \
351 ,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial))
352
353 $(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
354 $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.ko \
355 ,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa))
356
357 $(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\
358 $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.ko \
359 ,CONFIG_USB_SERIAL_FTDI_SIO,kmod-usb-serial,61,ftdi_sio))
360
361 $(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
362 $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.ko \
363 ,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232))
364
365 $(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
366 $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.ko \
367 ,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303))
368
369 $(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
370 $(MODULES_DIR)/kernel/drivers/scsi/scsi_mod.ko \
371 $(MODULES_DIR)/kernel/drivers/scsi/sd_mod.ko \
372 $(MODULES_DIR)/kernel/drivers/usb/storage/usb-storage.ko \
373 ,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
374
375
376 # Misc. devices
377
378 $(eval $(call KMOD_template,AX25,ax25,\
379 $(MODULES_DIR)/kernel/net/ax25/ax25.ko \
380 $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.ko \
381 ,CONFIG_AX25,,90,ax25 mkiss))
382
383 $(eval $(call KMOD_template,BLUETOOTH,bluetooth,\
384 $(MODULES_DIR)/kernel/net/bluetooth/bluetooth.ko \
385 $(MODULES_DIR)/kernel/net/bluetooth/l2cap.ko \
386 $(MODULES_DIR)/kernel/net/bluetooth/sco.ko \
387 $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/rfcomm.ko \
388 $(MODULES_DIR)/kernel/drivers/bluetooth/hci_uart.ko \
389 ,CONFIG_BLUEZ))
390
391
392 $(TARGETS): $(PACKAGE_DIR)
393
394 $(PACKAGE_DIR):
395 mkdir -p $(PACKAGE_DIR)
396
397 $(DL_DIR)/$(LINUX_SOURCE):
398 -mkdir -p $(DL_DIR)
399 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE) $(MAKE_TRACE)
400
401 $(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
402 -mkdir -p $(LINUX_BUILD_DIR)
403 bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(LINUX_BUILD_DIR) $(TAR_OPTIONS) -
404 rm -f $(LINUX_DIR)
405 ln -s $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR)
406 touch $(LINUX_DIR)/.unpacked
407
408 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
409 $(PATCH) $(LINUX_DIR) ./patches/generic $(MAKE_TRACE)
410 [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD) $(MAKE_TRACE)
411 touch $(LINUX_DIR)/.patched
412
413 $(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
414 -cp $(LINUX_KCONFIG) $(LINUX_DIR)/.config
415 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) oldconfig $(MAKE_TRACE)
416 touch $(LINUX_DIR)/.configured
417
418 $(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.configured
419 $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) $(MAKE_TRACE)
420
421 $(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
422 $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@ $(MAKE_TRACE)
423 touch -c $(LINUX_KERNEL)
424
425 $(LINUX_DIR)/.modules_done: $(LINUX_KERNEL) $(LINUX_IMAGE)
426 rm -rf $(LINUX_BUILD_DIR)/modules
427 $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) modules $(MAKE_TRACE)
428 $(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)
429 touch $(LINUX_DIR)/.modules_done
430
431 $(STAGING_DIR)/include/linux/version.h: $(LINUX_DIR)/.configured
432 mkdir -p $(STAGING_DIR)/include
433 tar -ch -C $(LINUX_DIR)/include -f - linux | tar -xf - -C $(STAGING_DIR)/include/
434 tar -ch -C $(LINUX_DIR)/include -f - asm | tar -xf - -C $(STAGING_DIR)/include/
435
436 $(STAMP_DIR)/.linux-compile: $(LINUX_DIR)/.modules_done
437 @mkdir -p $(STAMP_DIR)
438 @$(MAKE) $(TARGETS)
439 ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR)
440 @$(TRACE) target/linux/package
441 $(MAKE) -C $(TOPDIR)/target/linux/package \
442 $(KPKG_MAKEOPTS) \
443 compile
444 touch $@
445
446 $(TARGET_MODULES_DIR):
447 -mkdir -p $(TARGET_MODULES_DIR)
448
449 $(KERNEL_IPKG):
450 rm -rf $(KERNEL_IDIR)
451 mkdir -p $(KERNEL_IDIR)/etc
452 $(SCRIPT_DIR)/make-ipkg-dir.sh $(KERNEL_IDIR) ../control/kernel.control $(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE) $(ARCH)
453 if [ -f ./config/$(BOARD).modules ]; then \
454 cp ./config/$(BOARD).modules $(KERNEL_IDIR)/etc/modules; \
455 fi
456 $(IPKG_BUILD) $(KERNEL_IDIR) $(LINUX_BUILD_DIR) $(MAKE_TRACE)
457
458 source: $(DL_DIR)/$(LINUX_SOURCE)
459 prepare: $(LINUX_DIR)/.configured
460 compile:
461 $(MAKE) $(STAMP_DIR)/.linux-compile $(MAKE_TRACE)
462
463 install: compile $(TARGET_MODULES_DIR) $(KERNEL_IPKG)
464 rm -rf $(LINUX_BUILD_DIR)/root*
465 cp -fpR $(BUILD_DIR)/root $(LINUX_BUILD_DIR)/
466 echo -e 'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR)/ipkg.conf
467 $(MAKE) -C $(TOPDIR)/target/linux/package \
468 $(KPKG_MAKEOPTS) \
469 install
470 @{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL) install $(INSTALL_TARGETS) || true; } $(MAKE_TRACE)
471
472 mostlyclean:
473 rm -f $(STAMP_DIR)/.linux-compile
474 rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.modules_done
475 rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.drivers-unpacked
476 $(MAKE) -C $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) clean $(MAKE_TRACE)
477 rm -f $(LINUX_KERNEL) $(LINUX_IMAGE)
478
479 rebuild:
480 -$(MAKE) mostlyclean
481 if [ -f $(LINUX_KERNEL) ]; then \
482 $(MAKE) clean $(MAKE_TRACE); \
483 fi
484 $(MAKE) compile $(MAKE_TRACE)
485
486 clean:
487 rm -f $(STAMP_DIR)/.linux-compile
488 rm -rf $(LINUX_BUILD_DIR)
489 rm -f $(TARGETS)
This page took 0.068349 seconds and 5 git commands to generate.