source: src/router/Makefile.x86 @ 17870

Last change on this file since 17870 was 17870, checked in by BrainSlayer, 20 months ago

x86 makefile update

File size: 17.7 KB
Line 
1#
2# Broadcom Linux Router Makefile
3#
4# Copyright 2001-2003, Broadcom Corporation
5# All Rights Reserved.
6#
7# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11#
12# $Id: Makefile,v 1.2 2005/09/26 11:06:58 seg Exp $
13#
14
15include .config
16ifneq ($(wildcard ../cy_conf.mak),)
17  include ../cy_conf.mak
18endif
19
20#
21# Paths
22#
23OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec auth auth_db nathelper
24OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),openser/modules/$(module)/$(module).so)
25OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
26OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
27
28# Source bases
29
30export PLATFORM LINUXDIR LIBDIR USRLIBDIR
31export TOP := $(shell pwd)
32export SRCBASE := $(shell (cd $(TOP)/.. && pwd -P))
33
34
35# Set the HAL directory if you have the HAL sources
36
37# Set the Atheros Rate Control directory if you have the proprietary rate control
38export ATH_RATE=ath_rate/sample
39
40#
41# Cross-compile environment variables
42#
43
44# Build platform
45export BUILD := i486-pc-linux-gnu
46export HOSTCC := gcc
47
48# uClibc wrapper
49export ARCH:=$(PLATFORM)
50ifeq ($(CONFIG_UCLIBC),y)
51export PLATFORM := $(PLATFORM)-uclibc
52endif
53
54#export LINUXDIR := $(SRCBASE)/linux/linux.v24
55ifeq ($(ARCH),mips)
56export LINUXDIR := $(SRCBASE)/linux/brcm63xx/linux-2.6.17
57endif
58#ifeq ($(ARCH),i386)
59#export LINUXDIR := $(SRCBASE)/linux/x86/linux-2.6.29
60#endif
61ifeq ($(ARCH),armeb)
62export LINUXDIR := $(SRCBASE)/linux/xscale/linux-2.6.17
63endif
64ifeq ($(ARCH),mipsel)
65export LINUXDIR := $(SRCBASE)/kernel/rb500/linux-2.6.17-rc5
66endif
67
68#export KERNELRELEASE = $(shell cat $(LINUXDIR)/.kernelrelease 2> /dev/null)
69export KRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
70
71#ifeq ($(PLATFORM),mipsel)
72#export CROSS_COMPILE := mipsel-linux-
73#export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
74#export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/../mipsel-linux && pwd -P)
75#endif
76
77#ifeq ($(PLATFORM),mipsel-uclibc)
78export CROSS_COMPILE := i486-linux-uclibc-
79export CONFIGURE := ./configure $(ARCH)-linux --build=$(BUILD)
80export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
81#endif
82
83#ifeq ($(CONFIG_BCMWPA2),y)
84#export CFLAGS += -DBCMWPA2
85#endif
86
87export BASEOPT:=-Os
88#export ARCH:= mipsel
89
90ifeq ($(ARCH),mipsel)
91export COPTS:=$(BASEOPT) -pipe -mips32 -mtune=mips32 -funit-at-a-time
92endif
93ifeq ($(ARCH),armeb)
94export COPTS:=$(BASEOPT) -pipe -mtune=xscale -march=armv5te -Wa,-mcpu=xscale -mno-thumb-interwork -mno-thumb -funit-at-a-time
95endif
96ifeq ($(ARCH),mips)
97export COPTS:=$(BASEOPT) -pipe -mips32 -mtune=mips32 -funit-at-a-time
98endif
99ifeq ($(ARCH),i386)
100export COPTS:=$(BASEOPT) -pipe -march=i486 -mtune=i486 -fno-caller-saves -D_FILE_OFFSET_BITS=64
101endif
102
103export CC := $(CROSS_COMPILE)gcc
104export CXX := $(CROSS_COMPILE)g++
105export AR := $(CROSS_COMPILE)ar
106export AS := $(CROSS_COMPILE)as
107export LD := $(CROSS_COMPILE)ld
108export NM := $(CROSS_COMPILE)nm
109export RANLIB := $(CROSS_COMPILE)ranlib
110export STRIP := $(CROSS_COMPILE)strip
111export SIZE := $(CROSS_COMPILE)size
112
113export CFLAGS := $(COPTS)
114
115#
116# Install and target directories
117#
118
119export PLATFORMDIR := $(TOP)/$(PLATFORM)
120export INSTALLDIR := $(PLATFORMDIR)/install
121export TARGETDIR := $(PLATFORMDIR)/target
122
123ifeq ($(PLATFORM),mipsel)
124obj-y += libcrypto
125endif
126#
127# Configuration
128#
129CONFIG_IPTABLES=y
130include rules/configs.mk
131
132obj-clean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-clean)
133obj-install := $(foreach obj,$(obj-y),$(obj)-install)
134obj-distclean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-distclean)
135
136#
137# Basic rules
138#
139
140
141all: build_date clean_target $(obj-y) $(LINUXDIR)/.config kernel
142
143build_date:
144        echo "#define BUILD_DATE \"$(shell date +%D)\"" > ../../opt/build.h
145
146
147kernel:
148        # Also build kernel
149        # Also build kernel
150ifeq ($(CONFIG_ISOFS),y)
151        cp $(LINUXDIR)/.config_isofs $(LINUXDIR)/.config
152endif
153ifeq ($(CONFIG_EOP_TUNNEL),y)
154        echo CONFIG_NET_ETHERIP=m >> $(LINUXDIR)/.config
155else
156        echo "# CONFIG_NET_ETHERIP is not set" >> $(LINUXDIR)/.config
157endif
158        make -C $(LINUXDIR) oldconfig
159        if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
160            $(MAKE) -j 4 -C $(LINUXDIR) bzImage CROSS_COMPILE=i486-linux-uclibc- ; \
161        fi
162        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
163            $(MAKE) -j 4 -C $(LINUXDIR) modules CROSS_COMPILE=i486-linux-uclibc- ; \
164        fi
165        #armeb-linux-uclibc-strip --remove-section=.note --remove-section=.comment $(LINUXDIR)/vmlinux
166        #armeb-linux-uclibc-objcopy -O binary $(LINUXDIR)/vmlinux vmlinux.bin
167        #cmplzma -k -3 $(LINUXDIR)/vmlinux vmlinux.bin $(PLATFORMDIR)/vmlinux.lz
168       
169#       cat $(LINUXDIR)/vmlinus | lzma e -si -so -eos -lc1 -lp2 -pb2 > lzma-loader/rb500/vmlinux.lzma
170#       make -C lzma-loader/rb500 clean
171#       make -C lzma-loader/rb500
172#       cp lzma-loader/rb500/lzma.elf $(ARCH)-uclibc/vmlinux
173
174       
175realclean: $(obj-clean)
176        rm -f .config.old .config.cmd
177        #umount $(TARGETDIR)
178        rm -rf $(INSTALLDIR)
179        rm -rf $(TARGETDIR)
180        rm -f $(TARGETDIR)/*
181        -rm -f $(ARCH)-uclibc/*
182
183       
184clean: rc-clean httpd-clean services-clean shared-clean libutils-clean nvram-clean madwifi-clean madwifi_mimo-clean busybox-clean pppd-clean
185        rm -f .config.old .config.cmd
186        #umount $(TARGETDIR)
187        rm -rf $(INSTALLDIR)
188        rm -rf $(TARGETDIR)
189        rm -f $(TARGETDIR)/*
190        -rm -f $(ARCH)-uclibc/*
191
192clean_target:
193        #umount $(TARGETDIR)
194        rm -rf $(TARGETDIR)
195        rm -rf $(INSTALLDIR)
196#       rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.squashfs
197
198distclean mrproper: $(obj-distclean) clean_target
199        rm -rf $(INSTALLDIR)
200        $(MAKE) -C $(LINUXDIR) distclean
201        $(MAKE) -C $(LINUXDIR)/arch/mips/bcm947xx/compressed clean
202        #rm -f $(PLATFORMDIR)/zImage $(PLATFORMDIR)/linux.bin
203        $(MAKE) -C config clean
204        rm -f .config $(LINUXDIR)/.config
205        rm -f .config.old .config.cmd
206
207optimize-lib:
208        make -f Makefile.x86 lib.i486-install
209        cp lib.i486/pics/* $(TARGETDIR)/lib
210        cp lib.i486/libgcc_s.so.1 $(TARGETDIR)/lib
211
212
213        relink-lib.sh \
214                "$(ARCH)-linux-" \
215                "lib.i486/libc_so.a" \
216                "lib.i486/libc_so.a" \
217                "$(ARCH)-uclibc/target/lib/libc.so.0" \
218                -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 \
219                lib.i486/libgcc_s.so.*
220
221        relink-lib.sh \
222                "$(ARCH)-linux-" \
223                "$(wildcard lib.i486/libcrypt-*.so)" \
224                "lib.i486/libcrypt_pic.a" \
225                "$(ARCH)-uclibc/target/lib/libcrypt.so.0" \
226                lib.i486/libgcc_s.so.* \
227                -Wl,-soname=libcrypt.so.0
228
229        relink-lib.sh \
230                "$(ARCH)-linux-" \
231                "$(wildcard lib.i486/libm-*.so)" \
232                "lib.i486/libm_pic.a" \
233                "$(ARCH)-uclibc/target/lib/libm.so.0" \
234                lib.i486/libgcc_s.so.* \
235                -Wl,-soname=libm.so.0
236
237        relink-lib.sh \
238                "$(ARCH)-linux-" \
239                "$(wildcard lib.i486/libpthread-*.so)" \
240                "lib.i486/libpthread_so.a" \
241                "$(ARCH)-uclibc/target/lib/libpthread.so.0" \
242                -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal \
243                lib.i486/libgcc_s.so.* \
244                -Wl,-soname=libpthread.so.0
245
246ifneq ($(CONFIG_NOOPT),y)
247        rm -rf $(ARCH)-uclibc/tmp/mklibs-out
248        rm -f $(ARCH)-uclibc/tmp/mklibs-progs
249        mkdir -p $(ARCH)-uclibc/tmp/mklibs-out
250        find $(TARGETDIR) -type f -perm +100 -exec \
251                file -r -N -F '' {} + | \
252                awk ' /executable.*dynamically/ { print $$1 }' > $(ARCH)-uclibc/tmp/mklibs-progs
253
254        find $(TARGETDIR) -type f -name \*.so\* -exec \
255                file -r -N -F '' {} + | \
256                awk ' /shared object/ { print $$1 }' >> $(ARCH)-uclibc/tmp/mklibs-progs
257
258        mkdir -p $(ARCH)-uclibc/tmp/mklibs-out
259        mklibs.py -D \
260                -d $(ARCH)-uclibc/tmp/mklibs-out \
261                --sysroot $(TARGETDIR) \
262                -L /lib \
263                -L /usr/lib \
264                --ldlib /lib/ld-uClibc.so.0 \
265                --target $(ARCH)-linux-uclibc \
266                `cat $(ARCH)-uclibc/tmp/mklibs-progs` 2>&1
267        cp $(ARCH)-uclibc/tmp/mklibs-out/* $(TARGETDIR)/lib
268endif
269        rm -f $(TARGETDIR)/lib/*.a
270        rm -f $(TARGETDIR)/lib/*.map
271#       cp lib.$(ARCH)/libresolv.so.0 $(TARGETDIR)/lib
272#       cp lib.$(ARCH)/libgcc_s.so.1 $(TARGETDIR)/lib
273
274
275install package: clean_target $(filter-out lib.i486-install,$(obj-install)) $(LINUXDIR)/.config
276        # Install binaries into target directory
277        # Install binaries into target directory
278#       make -C viarhine clean
279#       make -C viarhine       
280        #umount -f $(TARGETDIR)
281        #dd if=/dev/zero of=mipsel-uclibc/root.fs bs=1024 count=27392
282        #mke2fs -F -b 1024 mipsel-uclibc/root.fs
283        #mkfs.ext3 -F -b 1024 mipsel-uclibc/root.fs
284        install -d $(TARGETDIR)
285        #mount mipsel-uclibc/root.fs -o loop=/dev/loop1 $(TARGETDIR)
286#       $(ARCH)-linux-strip $(LINUXDIR)/vmlinux -o $(ARCH)-uclibc/vmlinux
287#       cp $(LINUXDIR)/vmlinus mipsel-uclibc/vmlinux
288#       gunzip -c base.img.gz>image.img
289#       ../tools/write $(ARCH)-uclibc/vmlinux image.img 16384
290        #dd if=$(LINUXDIR)/vmlinux of=/dev/loop0 bs=512 seek=32
291        for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
292            (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
293        done
294        mkdir -p $(ARCH)-uclibc/target/etc/config
295        mkdir -p $(ARCH)-uclibc/target/etc/kaid
296        mkdir -p $(ARCH)-uclibc/target/etc/langpack
297        cp ./opt/bin/ipkg $(ARCH)-uclibc/target/bin
298        cd  $(ARCH)-uclibc/target/lib
299#       ln -s libgcc_s.so.1 libgcc_s.so
300#       cd ../../../../../opt
301        cp ./opt/etc/preinit $(ARCH)-uclibc/target/etc
302        cp ./opt/etc/postinit $(ARCH)-uclibc/target/etc
303        cp ./opt/etc/ipkg.conf $(ARCH)-uclibc/target/etc
304        cp ./opt/etc/config/* $(ARCH)-uclibc/target/etc/config
305        cp ./opt/usr/lib/smb.conf $(ARCH)-uclibc/target/usr/lib
306        ln -sf ../tmp/smbshare $(ARCH)-uclibc/target/www/smb
307
308        # optimize the crypto library by removing unneeded symbols
309        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
310        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
311        # Install (and possibly optimize) C library
312        $(MAKE) -f Makefile.x86 lib.i486-install
313        # optimize the others library by removing unneeded symbols
314        $(MAKE) -f Makefile.x86 optimize-lib
315        # Install modules into filesystem
316        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
317            $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR) ; \
318        fi
319ifeq ($(CONFIG_MADWIFI),y)
320        rm -rf $(TARGETDIR)/lib/modules/$(KRELEASE)/kernel/drivers/net/wl
321endif
322#       mkdir -p $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
323#       cp ../wl/ctmisc/ctmisc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
324        ##not used yet
325        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
326        #cp ./switch/switch-core.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
327        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
328#       cp ./viarhine/via-rhine.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net
329
330        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
331        #cp ./switch/switch-adm.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
332        cp lib.i486/libgcc_s.so.1 $(TARGETDIR)/lib
333        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
334        #cp ./switch/switch-robo.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
335       
336        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc1/kernel/drivers/net/et
337        #cp ../et/linux/et.o $(TARGETDIR)/lib/modules/2.4.32-rc1/kernel/drivers/net/et
338       
339        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/et.4702
340        #cp ../et.4702/linux/4702et.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/et.4702
341        # robo switch
342        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/robo
343        #cp ../robo/linux/robo.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/robo
344       
345        find $(TARGETDIR) -name "wl_*.o"  | xargs rm -rf
346        # quick n dirty - stuff Nikki's module where it belongs
347        #mkdir $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996
348#       if [ "$(CONFIG_MMC)" = "y" ] ; then \
349#       mkdir $(TARGETDIR)/lib/modules/2.4.32/kernel/fs/mmc ; \
350#       cp mmc/mmc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/fs/mmc ; \
351#       fi ;
352#ifeq ($(CONFIG_MSSID),y)
353#       cp adm6996.v24/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
354#else   
355#       cp adm6996/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
356#endif
357ifneq ($(CONFIG_USB),y)
358        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/class
359        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/core
360        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/host
361        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/storage
362        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/scsi
363        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext2
364#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3
365        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fat
366#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd
367        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/msdos
368        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/vfat
369        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs
370#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/mbcache.ko
371endif
372ifneq ($(CONFIG_USB_ADVANCED),y)
373        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/serial
374        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3
375        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext4
376        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/btrfs
377        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd       
378        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd2     
379endif
380ifneq ($(CONFIG_NTFS3G),y)
381        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fuse
382endif
383ifneq ($(CONFIG_USB),y)
384ifneq ($(CONFIG_SAMBA),y)
385        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/nls
386endif
387endif
388ifneq ($(CONFIG_IPV6),y)
389        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv6
390endif
391ifneq ($(CONFIG_3G),y)
392        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/usb
393endif
394ifneq ($(CONFIG_SAMBA),y)
395        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/cifs
396endif
397ifneq ($(CONFIG_JFFS2),y)
398        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jffs2
399endif
400
401        rm -f $(TARGETDIR)/lib/modules/$(KRELEASE)/build
402        rm -f $(TARGETDIR)/lib/modules/$(KRELEASE)/source
403       
404       
405       
406        # Prepare filesystem
407        cd $(TARGETDIR) && $(TOP)/misc/rootprep.sh
408        # Make sure mksquashfs-2.0 is used
409#       $(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs
410        cd $(TARGETDIR)  &&  find . -iname "CVS" | xargs rm -rf
411        cd $(TARGETDIR)  &&  find . -iname ".svn" | xargs rm -rf
412#       cp viarhine/pci-scan.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/pci-scan.o
413#       cp -f test/* $(TARGETDIR)/lib/modules/2.4.33-pre1/kernel/drivers/net
414       
415#       mknod $(TARGETDIR)/dev/cfa b 13 0
416#       mknod $(TARGETDIR)/dev/cfa1 b 13 1
417#       mknod $(TARGETDIR)/dev/cfa2 b 13 2
418#       mknod $(TARGETDIR)/dev/cfa3 b 13 3
419#       mknod $(TARGETDIR)/dev/cfa4 b 13 4
420#       umount $(TARGETDIR)
421#find $(TARGETDIR)/lib/modules -name *.ko -exec mipsel-linux-strip --strip-unneeded --remove-section=.comment {} +             
422        #e2fsck -y -f $(ARCH)-uclibc/root.fs
423        ./busybox/examples/depmod.pl -F $(LINUXDIR)/System.map -b $(ARCH)-uclibc/target/lib/modules
424        #cd $(TARGETDIR)
425#       tar --directory=$(TARGETDIR) --remove-files -cvvjf $(TARGETDIR)/etc/local.tar.bz2 usr/local
426        rm -rf $(TARGETDIR)/usr/local
427        mkdir $(TARGETDIR)/usr/local
428ifeq ($(CONFIG_KAID),y)
429        cp kaid/kaid $(TARGETDIR)/usr/sbin
430endif
431        mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib
432        ./strip_libs.sh $(ARCH)
433
434        cd grub && ./configure --host=i386-linux --target=i386-linux CC="/xfs/toolchains/staging_dir_i386.4.2.1/bin/i386-linux-gcc" LDFLAGS="-static" CFLAGS="-Os -DNEED_PRINTF"
435        make -C grub clean DESTDIR=$(INSTALLDIR)/grub   
436        make -C grub DESTDIR=$(INSTALLDIR)/grub
437        make -C grub install DESTDIR=$(INSTALLDIR)/grub
438        $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -noappend -le
439#       $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -noappend -root-owned -le -b 262144 -nopad
440        mkfs.jffs2 --pad --big-endian --squash -e 0x20000 -o $(ARCH)-uclibc/dd-wrt.jffs2 -d $(ARCH)-uclibc/target
441        mkdir -p $(ARCH)-uclibc/root.grub/boot/grub
442        cp \
443                $(INSTALLDIR)/grub/usr/local/lib/grub/i386-pc/stage1 \
444                $(INSTALLDIR)/grub/usr/local/lib/grub/i386-pc/stage2 \
445                $(INSTALLDIR)/grub/usr/local/lib/grub/i386-pc/e2fs_stage1_5 \
446                $(ARCH)-uclibc/root.grub/boot/grub/
447        cp grub/menu_serial.lst $(ARCH)-uclibc/root.grub/boot/grub/menu.lst
448        cp $(LINUXDIR)/arch/i386/boot/bzImage $(ARCH)-uclibc/root.grub/boot/vmlinuz
449
450ifeq ($(CONFIG_FULL),y)
451        -PATH="$(INSTALLDIR)/grub/usr/local/sbin:$(INSTALLDIR)/grub/usr/local/bin:$(PATH)" ./gen_image.sh $(ARCH)-uclibc/dd-wrt_serial.image 3 $(ARCH)-uclibc/root.grub 32 $(ARCH)-uclibc/root.fs 32
452        cp grub/menu_vga.lst $(ARCH)-uclibc/root.grub/boot/grub/menu.lst
453        -PATH="$(INSTALLDIR)/grub/usr/local/sbin:$(INSTALLDIR)/grub/usr/local/bin:$(PATH)" ./gen_image.sh $(ARCH)-uclibc/dd-wrt_vga.image 3 $(ARCH)-uclibc/root.grub 32 $(ARCH)-uclibc/root.fs 32
454else
455        -PATH="$(INSTALLDIR)/grub/usr/local/sbin:$(INSTALLDIR)/grub/usr/local/bin:$(PATH)" ./gen_image.sh $(ARCH)-uclibc/dd-wrt_serial.image 3 $(ARCH)-uclibc/root.grub 9 $(ARCH)-uclibc/root.fs 16
456        cp grub/menu_vga.lst $(ARCH)-uclibc/root.grub/boot/grub/menu.lst
457        -PATH="$(INSTALLDIR)/grub/usr/local/sbin:$(INSTALLDIR)/grub/usr/local/bin:$(PATH)" ./gen_image.sh $(ARCH)-uclibc/dd-wrt_vga.image 3 $(ARCH)-uclibc/root.grub 9 $(ARCH)-uclibc/root.fs 16
458endif
459        ./tools/wrap $(ARCH)-uclibc/dd-wrt_vga.image $(ARCH)-uclibc/dd-wrt-vga-webupgrade.bin
460        ./tools/wrap $(ARCH)-uclibc/dd-wrt_serial.image $(ARCH)-uclibc/dd-wrt-serial-webupgrade.bin
461
462#       mkdir -p $(TARGETDIR)/boot/grub
463#       cp $(INSTALLDIR)/grub/usr/local/lib/grub/i386-pc/stage2_eltorito $(TARGETDIR)/boot/grub
464#       mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot  -boot-load-size 4 -boot-info-table -o grub.iso $(TARGETDIR)
465       
466#endif
467#
468# Configuration rules
469#
470include rules/all.mk
471
472%:
473        [ ! -d $* ] || $(MAKE) -C $*
474
475%-distclean:
476        [ ! -d $* ] || $(MAKE) -C $* clean
477
478%-clean:
479        [ ! -d $* ] || $(MAKE) -C $* clean
480
481%-install:
482        [ ! -d $* ] || $(MAKE) -C $* install INSTALLDIR=$(INSTALLDIR)/$*
483
484$(obj-y) $(obj-n) $(obj-clean) $(obj-install): dummy
485
486.PHONY: all clean distclean mrproper install package
487.PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
488.PHONY: dummy fixkc libnet libpcap
489
490
491
Note: See TracBrowser for help on using the repository browser.