source: src/router/Makefile.brcm3x @ 30239

Last change on this file since 30239 was 30239, checked in by brainslayer, 9 months ago

fix rt-ac66 build since newer devices seem to use nand flash

File size: 44.8 KB
Line 
1# Broadcom Linux Router Makefile
2#
3# Copyright 2001-2003, Broadcom Corporation
4# All Rights Reserved.
5#
6# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
7# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10#
11# $Id: Makefile,v 1.2 2005/09/26 11:06:58 seg Exp $
12#
13
14include .config
15ifneq ($(wildcard ../cy_conf.mak),)
16  include ../cy_conf.mak
17endif
18
19#
20# Paths
21#
22OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec auth auth_db nathelper
23OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),openser/modules/$(module)/$(module).so)
24CONFIG_MUSL=y
25CONFIG_NOOPT=y
26
27# Source bases
28export PLATFORM LINUXDIR LIBDIR USRLIBDIR
29export TOP := $(shell pwd)
30export SRCBASE := $(shell (cd $(TOP)/.. && pwd -P))
31#
32# Cross-compile environment variables
33#
34
35# Build platform
36export BUILD := i386-pc-linux-gnu
37export HOSTCC := gcc
38
39# uClibc wrapper
40ifeq ($(CONFIG_UCLIBC),y)
41export PLATFORM := $(PLATFORM)-uclibc
42endif
43
44export LINUXVER = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
45
46export KERNELRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
47
48
49ifeq ($(PLATFORM),mipsel)
50export CROSS_COMPILE := mipsel-linux-
51export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
52export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/../mipsel-linux && pwd -P)
53endif
54
55ifeq ($(PLATFORM),mipsel-uclibc)
56export CROSS_COMPILE := mipsel-linux-uclibc-
57export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
58export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
59endif
60
61ifeq ($(CONFIG_BCMWPA2),y)
62export CFLAGS += -DBCMWPA2
63endif
64
65ifeq ($(CONFIG_BRANDING),y)
66export CFLAGS += -DCONFIG_BRANDING
67endif
68#ifeq ($(CONFIG_SPEED),y)
69export BASEOPT:=-Os
70#else
71#export BASEOPT:=-Os
72#endif
73
74
75export ARCH:= mipsel
76export ARCHITECTURE:= broadcom
77export COPTS:=$(BASEOPT) -pipe -mips32r2 -mtune=74kc -mdspr2 -fno-caller-saves  -msoft-float  -mno-branch-likely -fno-plt
78export CC := ccache $(CROSS_COMPILE)gcc
79export CXX := ccache $(CROSS_COMPILE)g++
80export AR := $(CROSS_COMPILE)ar
81export AS := $(CROSS_COMPILE)as
82export LD := $(CROSS_COMPILE)ld
83export NM := $(CROSS_COMPILE)nm
84export RANLIB := $(CROSS_COMPILE)ranlib
85export STRIP := @true
86export SIZE := $(CROSS_COMPILE)size
87export MIPS16_OPT:= -minterlink-mips16 -mips16
88
89export CFLAGS :=$(BASEOPT) -pipe -mips32r2 -mtune=74kc -mdspr2 -fno-caller-saves  -msoft-float  -mno-branch-likely -fno-plt
90export LDFLAGS :=
91
92#
93# Install and target directories
94#
95
96export PLATFORMDIR := $(TOP)/$(PLATFORM)
97export INSTALLDIR := $(PLATFORMDIR)/install
98export TARGETDIR := $(PLATFORMDIR)/target
99
100
101#obj-y += libcrypto
102#
103# Configuration
104#
105CONFIG_IPTABLES=y
106#CONFIG_WLC=y
107include rules/configs.mk
108
109obj-clean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-clean)
110obj-install := $(foreach obj,$(obj-y),$(obj)-install)
111obj-distclean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-distclean)
112
113
114build_date:
115        echo "#define BUILD_DATE \"$(shell date +%D)\"" > ../../opt/build.h
116        echo "CONFIG_MUSL=y" >> .config
117
118drop-sections   = .comment
119strip-flags     = $(addprefix --remove-section=,$(drop-sections))
120
121#
122# Basic rules
123#
124
125all: install_headers build_date clean_target $(obj-y) $(LINUXDIR)/.config kernel
126
127include kernel-features.mk
128
129kernel:
130        # Also build kernel
131ifeq ($(CONFIG_DIST),"micro")
132        cp $(LINUXDIR)/.config_micro $(LINUXDIR)/.config
133#       cd $(LINUXDIR) && make clean
134else
135ifeq ($(CONFIG_DIST),"micro-special")
136        cp $(LINUXDIR)/.config_micro $(LINUXDIR)/.config
137#       cd $(LINUXDIR) && make clean
138else
139ifeq ($(CONFIG_MADWIFI),y)
140        cp $(LINUXDIR)/.config_atheros $(LINUXDIR)/.config
141#       cd $(LINUXDIR) && make clean
142else
143        cp $(LINUXDIR)/.config_std $(LINUXDIR)/.config
144#       cd $(LINUXDIR) && make clean
145endif
146endif
147endif
148#ifeq ($(CONFIG_HIGHMEM),y)
149        cp $(LINUXDIR)/.config_std_highmem $(LINUXDIR)/.config
150#endif
151ifeq ($(CONFIG_NOAC),y)
152        cp $(LINUXDIR)/.config_std_noac $(LINUXDIR)/.config
153endif
154
155        $(kernelfeatures)
156ifeq ($(CONFIG_V25),y)
157        echo CONFIG_V25=y >> $(LINUXDIR)/.config
158else
159        echo "# CONFIG_V25" is not set >> $(LINUXDIR)/.config
160endif
161ifeq ($(CONFIG_NVRAM_60K),y)
162        echo CONFIG_NVRAM_60K=y >> $(LINUXDIR)/.config
163        echo "# CONFIG_NVRAM_64K" is not set >> $(LINUXDIR)/.config     
164else
165ifeq ($(CONFIG_NVRAM_64K),y)
166        echo "# CONFIG_NVRAM_60K" is not set >> $(LINUXDIR)/.config
167        echo CONFIG_NVRAM_64K=y >> $(LINUXDIR)/.config
168else
169        echo "# CONFIG_NVRAM_60K" is not set >> $(LINUXDIR)/.config
170        echo "# CONFIG_NVRAM_64K" is not set >> $(LINUXDIR)/.config
171endif
172endif
173
174#ifeq ($(CONFIG_REGISTER),y)
175#       cp $(LINUXDIR)/.config_register $(LINUXDIR)/.config
176#endif
177        $(MAKE) -C $(LINUXDIR) oldconfig       
178        $(MAKE) -j 4 -C $(LINUXDIR) vmlinux  CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-" KBUILD_MODPOST_WARN=1
179        $(MAKE) -j 4 -C $(LINUXDIR) modules  CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-" KBUILD_MODPOST_WARN=1
180
181        rm -rf $(TARGETDIR)/lib/modules
182        $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
183        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
184        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
185
186#       -$(MAKE) -f Makefile.brcm3x ath9k
187#       -$(MAKE) -f Makefile.brcm3x ath9k-install
188        -$(MAKE) -f Makefile.brcm3x emf
189        -$(MAKE) -f Makefile.brcm3x emf-install
190        -$(MAKE) -f Makefile.brcm3x libutils
191#       -$(MAKE) -f Makefile.brcm3x madwifi
192#       -$(MAKE) -f Makefile.brcm3x madwifi-install
193        -$(MAKE) -f Makefile.brcm3x emf
194        -$(MAKE) -f Makefile.brcm3x emf-install
195ifeq ($(CONFIG_BATMANADV),y)
196        -$(MAKE) -f Makefile.brcm3x batman-adv
197        -$(MAKE) -f Makefile.brcm3x batman-adv-install
198endif
199ifeq ($(CONFIG_OPENDPI),y)
200        -$(MAKE) -f Makefile.brcm3x opendpi
201        -$(MAKE) -f Makefile.brcm3x opendpi-install
202endif
203        -$(MAKE) -f Makefile.brcm3x uniwip-gpio
204        -$(MAKE) -f Makefile.brcm3x uniwip-gpio-install
205
206ifneq ($(CONFIG_USB),y)
207        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb
208        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/cdrom
209        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/staging
210        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/usb
211        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/storage
212        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/scsi
213        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext2
214        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3
215        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fat
216        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd
217        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/msdos
218        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs
219        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/vfat
220#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/mbcache.ko
221endif
222ifneq ($(CONFIG_USB_ADVANCED),y)
223        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3
224        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext4
225        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs
226        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/hfsplus
227        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/btrfs
228        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd       
229        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd2     
230endif
231ifeq ($(CONFIG_NOAC),y)
232        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs
233        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/btrfs
234endif
235ifneq ($(CONFIG_NTFS3G),y)
236        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fuse
237endif
238ifneq ($(CONFIG_USB),y)
239ifneq ($(CONFIG_SAMBA),y)
240        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/nls
241endif
242endif
243ifneq ($(CONFIG_IPV6),y)
244        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv6
245endif
246ifneq ($(CONFIG_3G),y)
247        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/usb
248endif
249ifneq ($(CONFIG_SAMBA),y)
250        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/cifs
251endif
252ifneq ($(CONFIG_JFFS2),y)
253        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jffs2
254endif
255        find $(ARCH)-uclibc/install $(ARCH)-uclibc/target  -name \*.ko | \
256                xargs $(ARCH)-linux-nm | \
257                awk '$$1 == "U" { print $$2 } ' | \
258                sort -u > $(LINUXDIR)/mod_symtab.txt
259        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' r __ksymtab' | sed -e 's,........ r __ksymtab_,,' > $(LINUXDIR)/kernel_symtab.txt
260        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' R __ksymtab' | sed -e 's,........ R __ksymtab_,,' >> $(LINUXDIR)/kernel_symtab.txt
261        grep -f $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_include.txt
262        grep -vf $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_exclude.txt
263        ( \
264                echo '#define SYMTAB_KEEP \'; \
265                cat $(LINUXDIR)/sym_include.txt | \
266                        awk '{print "KEEP(*(___ksymtab+" $$$$1 ")) \\" }'; \
267                echo; \
268                echo '#define SYMTAB_KEEP_GPL \'; \
269                cat $(LINUXDIR)/sym_include.txt | \
270                        awk '{print "KEEP(*(___ksymtab_gpl+" $$$$1 ")) \\" }'; \
271                echo; \
272                echo '#define SYMTAB_DISCARD \'; \
273                cat $(LINUXDIR)/sym_exclude.txt | \
274                        awk '{print "*(___ksymtab+" $$$$1 ") \\" }'; \
275                echo; \
276                echo '#define SYMTAB_DISCARD_GPL \'; \
277                cat $(LINUXDIR)/sym_exclude.txt | \
278                        awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
279                echo; \
280        ) > $(LINUXDIR)/symtab.h
281        rm -f $(LINUXDIR)/vmlinux
282        $(MAKE) -j 4 -C $(LINUXDIR) vmlinux EXTRA_LDSFLAGS="-I$(LINUXDIR) -include symtab.h" CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"  KBUILD_MODPOST_WARN=1
283
284        $(ARCH)-linux-objcopy -O binary $(strip-flags) -g $(LINUXDIR)/vmlinux $(ARCH)-uclibc/vmlinus
285        cat $(ARCH)-uclibc/vmlinus | lzma e -si -so -eos -lc2 -lp2 -pb2 -d25 > lzma-loader/broadcom/vmlinux.lzma
286        gzip -9 -c $(ARCH)-uclibc/vmlinus > $(ARCH)-uclibc/vmlinus.gzip
287        make -C lzma-loader/broadcom clean
288        make -C lzma-loader/broadcom
289        dd if=lzma-loader/broadcom/lzma.elf of=$(ARCH)-uclibc/lzma_vmlinux bs=65536 conv=sync
290        $(ARCH)-linux-objcopy -O binary $(ARCH)-uclibc/lzma_vmlinux $(ARCH)-uclibc/lzma_vmlinus
291
292install_headers:
293# important step, required for new kernels
294        -mkdir -p $(TOP)/kernel_headers/$(KERNELRELEASE)
295        $(MAKE) -C $(LINUXDIR) headers_install ARCH=mips INSTALL_HDR_PATH=$(TOP)/kernel_headers/$(KERNELRELEASE)
296
297
298bootloader:
299        $(MAKE) -C $(LINUXDIR) oldconfig       
300        if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
301            $(MAKE) -j 4 -C $(LINUXDIR) zImage ; \
302        fi
303        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
304            $(MAKE) -j 4 -C $(LINUXDIR) modules ; \
305        fi
306        /opt/3.3.4/bin/$(ARCH)-linux-objcopy -O binary $(LINUXDIR)/vmlinux $(ARCH)-uclibc/vmlinus
307        cat $(ARCH)-uclibc/vmlinus | lzma e -si -so -eos -lc2 -lp2 -pb2 -d25 > lzma-loader/broadcom/vmlinux.lzma
308        make -C lzma-loader/broadcom clean
309        make -C lzma-loader/broadcom
310        cp lzma-loader/broadcom/lzma.elf $(ARCH)-uclibc/lzma_vmlinux
311        $(ARCH)-linux-objcopy -O binary $(ARCH)-uclibc/lzma_vmlinux $(ARCH)-uclibc/lzma_vmlinus
312
313compress:
314        $(MAKE) -C compressed clean
315        $(MAKE) -C compressed
316
317realclean: $(obj-clean)
318        rm -f .config.old .config.cmd
319        #umount $(TARGETDIR)
320        rm -rf $(INSTALLDIR)
321        rm -rf $(TARGETDIR)
322        rm -f $(TARGETDIR)/*
323        -rm -f $(ARCH)-uclibc/*
324
325       
326clean: rc-clean httpd-clean services-clean shared-clean libutils-clean nvram-clean busybox-clean dnsmasq-clean iptables-clean pppd-clean iproute2-clean
327        rm -f .config.old .config.cmd
328        #umount $(TARGETDIR)
329        rm -rf $(INSTALLDIR)
330        rm -rf $(TARGETDIR)
331        rm -f $(TARGETDIR)/*
332        -rm -f $(ARCH)-uclibc/*
333
334clean_target:
335        rm -rf $(TARGETDIR)
336        rm -rf $(INSTALLDIR)
337        rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.squashfs
338
339distclean mrproper: $(obj-distclean) clean_target
340        rm -rf $(INSTALLDIR)
341        $(MAKE) -C $(LINUXDIR) distclean
342        $(MAKE) -C $(LINUXDIR)/arch/mips/bcm947xx/compressed clean
343        #rm -f $(PLATFORMDIR)/zImage $(PLATFORMDIR)/linux.bin
344        $(MAKE) -C config clean
345        rm -f .config $(LINUXDIR)/.config
346        rm -f .config.old .config.cmd
347
348optimize-lib:
349ifneq ($(CONFIG_MUSL),y)
350        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
351else
352        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so} $(ARCH)-uclibc/target/lib/libc.so
353#       cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.a} $(ARCH)-uclibc/target/lib/libc_pic.a
354endif
355ifneq ($(CONFIG_MUSL),y)
356        cp ${shell $(ARCH)-linux-gcc -print-file-name=ld-uClibc.so.0} $(ARCH)-uclibc/target/lib/ld-uClibc.so.0
357else
358        cd $(ARCH)-uclibc/target/lib && ln -sf libc.so ld-musl-mipsel-sf.so.1
359endif
360ifeq ($(CONFIG_LIBDL),y)
361        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libdl.so.0} $(ARCH)-uclibc/target/lib/libdl.so.0
362endif
363ifeq ($(CONFIG_LIBRT),y)
364        -cp ${shell $(ARCH)-linux-gcc -print-file-name=librt.so.0} $(ARCH)-uclibc/target/lib/librt.so.0
365endif
366ifeq ($(CONFIG_LIBNSL),y)
367        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libnsl.so.0} $(ARCH)-uclibc/target/lib/libnsl.so.0
368endif
369ifeq ($(CONFIG_LIBUTIL),y)
370        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libutil.so.0} $(ARCH)-uclibc/target/lib/libutil.so.0
371endif
372ifeq ($(CONFIG_LIBCPP),y)
373        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libstdc++.so.6} $(ARCH)-uclibc/target/lib/libstdc++.so.6
374endif
375ifeq ($(CONFIG_LIBCRYPT),y)
376        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libcrypt.so.0} $(ARCH)-uclibc/target/lib/libcrypt.so.0
377endif
378ifeq ($(CONFIG_LIBM),y)
379        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libm.so.0} $(ARCH)-uclibc/target/lib/libm.so.0
380endif
381ifeq ($(CONFIG_LIBRESOLV),y)
382        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libresolv.so.0} $(ARCH)-uclibc/target/lib/libresolv.so.0
383endif
384ifeq ($(CONFIG_LIBPTHREAD),y)
385        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libpthread.so.0} $(ARCH)-uclibc/target/lib/libpthread.so.0
386endif
387#       cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
388        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
389
390ifneq ($(CONFIG_NOOPT),y)
391
392        rm -rf /tmp/$(ARCHITECTURE)/mklibs-out
393        rm -f /tmp/$(ARCHITECTURE)/mklibs-progs
394        -mkdir -p /tmp/$(ARCHITECTURE)/
395        find $(TARGETDIR) -type f -perm /100 -exec \
396                file -r -N -F '' {} + | \
397                awk ' /executable.*dynamically/ { print $$1 }' > /tmp/$(ARCHITECTURE)/mklibs-progs
398
399        find $(TARGETDIR) -type f -name \*.so\* -exec \
400                file -r -N -F '' {} + | \
401                awk ' /shared object/ { print $$1 }' >> /tmp/$(ARCHITECTURE)/mklibs-progs
402
403        mkdir -p /tmp/$(ARCHITECTURE)/mklibs-out
404ifneq ($(CONFIG_MUSL),y)
405        mklibs.py -D \
406                -d /tmp/$(ARCHITECTURE)/mklibs-out \
407                --sysroot $(TARGETDIR) \
408                -L /lib \
409                -L /usr/lib \
410                --ldlib /lib/ld-uClibc.so.0 \
411                --target $(ARCH)-linux-uclibc \
412                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
413else
414        mklibs.py -D \
415                -d /tmp/$(ARCHITECTURE)/mklibs-out \
416                --sysroot $(TARGETDIR) \
417                -L /lib \
418                -L /usr/lib \
419                --ldlib /lib/ld-musl-mips-sf.so.1 \
420                --target $(ARCH)-linux-uclibc \
421                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
422
423endif
424        cp /tmp/$(ARCHITECTURE)/mklibs-out/* $(TARGETDIR)/lib
425endif
426
427
428install package: clean_target $(filter-out lib.mipsel-install,$(obj-install)) $(LINUXDIR)/.config
429        install -d $(TARGETDIR)
430        for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
431            (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
432        done
433        # optimize the crypto library by removing unneeded symbols
434        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
435        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
436        # Install (and possibly optimize) C library
437#       $(MAKE) -f Makefile.brcm26 lib.mipsel-install
438        # optimize the others library by removing unneeded symbols
439        $(MAKE) -f Makefile.brcm3x optimize-lib
440        # Install modules into filesystem
441        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
442            $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR) ; \
443        fi
444#ifeq ($(CONFIG_MADWIFI),y)
445#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wl
446#endif
447#       mkdir -p $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
448#       cp ../wl/ctmisc/ctmisc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
449       
450#       find $(TARGETDIR) -name "wl_*.o"  | xargs rm -rf
451        # quick n dirty - stuff Nikki's module where it belongs
452        #mkdir $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996
453#if [ "$(CONFIG_MMC)" = "y" ] ; then \
454#mkdir -p $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/mmc ; \
455#cp mmc/mmc.o $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/mmc ; \
456#fi ;
457#ifeq ($(CONFIG_MSSID),y)
458#       cp adm6996.v24/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
459#else   
460#       cp adm6996/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
461#endif
462
463        rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/build
464        rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/source
465        if test -d "$(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/diag"; then mv $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/diag/* $(TARGETDIR)/lib/modules/$(LINUXVER); fi
466#       mv $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/diag/* $(TARGETDIR)/lib/modules/$(LINUXVER)
467#ifneq ($(CONFIG_DIST),"micro")
468#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/led/* $(TARGETDIR)/lib/modules/$(LINUXVER)
469#endif
470#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/switch/* $(TARGETDIR)/lib/modules/$(LINUXVER)
471#ifeq ($(CONFIG_MSSID),y)
472#       cp ../wl/wl/wl_v24.o $(TARGETDIR)/lib/modules/2.4.33-rc1/wl.o
473#else
474#       if test -d "$(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wl"; then mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wl/* $(TARGETDIR)/lib/modules/$(LINUXVER); fi             
475#ifeq ($(CONFIG_VXOVER),y)
476#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/wl.o
477#endif
478
479#ifneq ($(CONFIG_DIST),"micro")
480#ifneq ($(CONFIG_DIST),"micro-special")
481#       if test -d "$(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wireless"; then mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wireless/* $(TARGETDIR)/lib/modules/$(LINUXVER); fi
482#endif
483#endif
484#ifeq ($(CONFIG_MSSID),y)
485#ifneq ($(CONFIG_BCM5354),y)
486#ifneq ($(CONFIG_DIST),"micro")
487#ifneq ($(CONFIG_DIST),"micro-special")
488#       cp bcm57xx/bcm57xx.o $(TARGETDIR)/lib/modules/$(LINUXVER)/bcm57xxlsys.o
489#       cp bcm57xx/bcm57xx300.o $(TARGETDIR)/lib/modules/$(LINUXVER)/bcm57xx300.o
490#endif
491#endif
492#endif
493#endif
494#endif
495#       mv $(TARGETDIR)/lib/modules/2.4.33-pre3/kernel/fs/fat/* $(TARGETDIR)/lib/modules/2.4.33-pre3
496#ifneq ($(CONFIG_DIST),"micro")
497#ifneq ($(CONFIG_DIST),"micro-special")
498#       if test -d "$(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jffs2"; then mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jffs2/* $(TARGETDIR)/lib/modules/$(LINUXVER); fi
499#ifeq ($(CONFIG_SAMBA),y)
500#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/cifs/* $(TARGETDIR)/lib/modules/$(LINUXVER)
501#endif
502#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext2/* $(TARGETDIR)/lib/modules/$(LINUXVER)
503#endif
504#endif
505#ifneq ($(CONFIG_E2FSPROGS),y)
506#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/ext2*
507#endif
508#ifeq ($(CONFIG_DIST),"mini")
509#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/cifs*
510#endif
511#       mv $(TARGETDIR)/lib/modules/2.4.33-pre3/kernel/fs/vfat/* $(TARGETDIR)/lib/modules/2.4.33-prc1re3
512#ifneq ($(CONFIG_DIST),"micro")
513#ifneq ($(CONFIG_DIST),"micro-special")
514#ifneq ($(CONFIG_MSSID),y)
515#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/lib/* $(TARGETDIR)/lib/modules/$(LINUXVER)
516#endif
517#endif
518#endif
519#ifneq ($(CONFIG_DIST),"micro")
520#ifneq ($(CONFIG_DIST),"micro-special")
521#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/bridge/netfilter/* $(TARGETDIR)/lib/modules/$(LINUXVER)
522#endif
523#endif
524#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv4/netfilter/* $(TARGETDIR)/lib/modules/$(LINUXVER)
525#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv4/* $(TARGETDIR)/lib/modules/$(LINUXVER)
526#ifneq ($(CONFIG_DIST),"micro")
527#ifneq ($(CONFIG_DIST),"micro-special")
528#ifeq ($(CONFIG_IPV6),y)
529#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv6/* $(TARGETDIR)/lib/modules/$(LINUXVER)
530#endif
531#endif
532#endif
533#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/imq.o $(TARGETDIR)/lib/modules/$(LINUXVER)
534#ifeq ($(CONFIG_MSSID),y)
535#ifeq ($(CONFIG_USB),y)
536#ifeq ($(CONFIG_USB_ADVANCED),y)
537#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3/* $(TARGETDIR)/lib/modules/$(LINUXVER)
538#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd/* $(TARGETDIR)/lib/modules/$(LINUXVER)
539#endif
540#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fat/* $(TARGETDIR)/lib/modules/$(LINUXVER)
541#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/vfat/* $(TARGETDIR)/lib/modules/$(LINUXVER)
542#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs/* $(TARGETDIR)/lib/modules/$(LINUXVER)
543#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/cdrom/* $(TARGETDIR)/lib/modules/$(LINUXVER)
544#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/ide/pci/* $(TARGETDIR)/lib/modules/$(LINUXVER)
545#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/ide/* $(TARGETDIR)/lib/modules/$(LINUXVER)
546#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/scsi/* $(TARGETDIR)/lib/modules/$(LINUXVER)
547#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/host/* $(TARGETDIR)/lib/modules/$(LINUXVER)
548#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/storage/* $(TARGETDIR)/lib/modules/$(LINUXVER)
549#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/* $(TARGETDIR)/lib/modules/$(LINUXVER)
550#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/host
551#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/pci
552#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/storage
553#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/sr_mod.o
554#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/ide-scsi.o
555#endif
556#endif
557ifneq ($(CONFIG_USB),y)
558        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb
559        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/cdrom
560        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/staging
561        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/usb
562        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/storage
563        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/scsi
564        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext2
565        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3
566        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fat
567        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd
568        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/msdos
569        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs
570        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/vfat
571#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/mbcache.ko
572endif
573ifneq ($(CONFIG_USB_ADVANCED),y)
574        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3
575        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext4
576        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs
577        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/hfsplus
578        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/btrfs
579        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd       
580        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd2     
581endif
582ifneq ($(CONFIG_NTFS3G),y)
583        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fuse
584endif
585ifneq ($(CONFIG_USB),y)
586ifneq ($(CONFIG_SAMBA),y)
587        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/nls
588endif
589endif
590ifneq ($(CONFIG_IPV6),y)
591        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv6
592endif
593ifneq ($(CONFIG_3G),y)
594        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/usb
595endif
596ifneq ($(CONFIG_SAMBA),y)
597        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/cifs
598endif
599ifneq ($(CONFIG_JFFS2),y)
600        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jffs2
601endif
602#ifneq ($(CONFIG_ADM6996),y)
603        rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/switch/switch-adm.ko
604#endif
605
606#ifeq ($(CONFIG_PCMCIA),y)
607#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/pcmcia
608#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/pcmcia/* $(TARGETDIR)/lib/modules/$(LINUXVER)
609#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/char/pcmcia/* $(TARGETDIR)/lib/modules/$(LINUXVER)
610#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/char/* $(TARGETDIR)/lib/modules/$(LINUXVER)
611#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/host/* $(TARGETDIR)/lib/modules/$(LINUXVER)
612#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/serial/* $(TARGETDIR)/lib/modules/$(LINUXVER)
613#       mv -f $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/* $(TARGETDIR)/lib/modules/$(LINUXVER)
614#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/host
615#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/serial
616#endif
617#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel
618#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/pcmcia
619#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)/netfilter
620#ifneq ($(CONFIG_JFFS2),y)
621#       rm -f $(TARGETDIR)/lib/modules/$(LINUXVER)/jffs2.o
622#endif
623        rm -f $(TARGETDIR)/usr/lib/libpcap.so
624        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/scsi/*.ko   
625        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/bridge/netfilter/*.ko
626        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv4/netfilter/*.ko
627        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/ipv6/netfilter/*.ko
628        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/net/netfilter/*.ko
629        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/*.ko
630        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext2/*.ko
631        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/ext3/*.ko
632        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/fat/*.ko
633        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/msdos/*.ko
634        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/xfs/*.ko
635        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jbd/*.ko
636        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/vfat/*.ko
637        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/nls/*.ko
638        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/cifs/*.ko
639        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/fs/jffs2/*.ko
640        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/driver/net/*.ko
641        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/driver/net/usb/*.ko
642        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/driver/net/switch/*.ko
643        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/bcm57xx/*.ko
644        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/class/*.ko
645        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/host/*.ko
646        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/core/*.ko
647        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/storage/*.ko
648        -mipsel-linux-strip --strip-unneeded --remove-section=.comment $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/usb/serial/*.ko
649#ifeq ($(CONFIG_MMC),y)
650#       cp ./mmc/mmc.o $(TARGETDIR)/lib/modules/$(LINUXVER)
651#endif
652#       tar -cvf $(TARGETDIR)/lib/modules/modules.tar $(TARGETDIR)/lib/modules/$(LINUXVER)/*
653#       rm -rf $(TARGETDIR)/lib/modules/$(LINUXVER)
654
655        # Prepare filesystem
656ifeq ($(CONFIG_DIST),"micro")
657        cd $(TARGETDIR) && $(TOP)/misc/rootprep_micro.sh
658else
659ifeq ($(CONFIG_DIST),"micro-special")
660        cd $(TARGETDIR) && $(TOP)/misc/rootprep_micro.sh
661else
662        cd $(TARGETDIR) && $(TOP)/misc/rootprep.sh
663endif
664endif
665        # Make sure mksquashfs-2.0 is used
666#       $(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs
667        cd $(TARGETDIR)  &&  find . -iname "CVS" | xargs rm -rf
668        cd $(TARGETDIR)  &&  find . -iname ".svn" | xargs rm -rf
669ifeq ($(CONFIG_OPENSSL),y)
670ifneq ($(CONFIG_FREERADIUS),y)
671        rm -f $(TARGETDIR)/usr/sbin/openssl
672endif
673endif
674ifeq ($(CONFIG_KAID),y)
675        make -C kaid/src
676        cp kaid/kaid $(TARGETDIR)/usr/sbin
677endif
678        mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib
679        $(ARCH)-linux-objcopy -O binary $(LINUXDIR)/vmlinux $(ARCH)-uclibc/vmlinux.bin
680        ../../opt/loader-0.02/lzma e -lc3 -lp2 -pb2 -d25 mipsel-uclibc/vmlinux.bin mipsel-uclibc/vmlinuz
681        cp ../../opt/etc/preinit mipsel-uclibc/target/etc
682        cp ../../opt/etc/postinit mipsel-uclibc/target/etc
683ifneq ($(CONFIG_DIST),"micro")
684ifneq ($(CONFIG_DIST),"micro-special")
685        cp ../../opt/bin/ipkg mipsel-uclibc/target/bin
686        cp ../../opt/etc/ipkg.conf mipsel-uclibc/target/etc
687endif
688endif
689        cp ../../opt/etc/config/* mipsel-uclibc/target/etc/config
690        ../../tools/process_nvramconfigfile mipsel-uclibc/target/etc/config/*.nvramconfig
691
692        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
693        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
694        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel
695        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net
696        #e2fsck -y -f $(ARCH)-uclibc/root.fs
697        ./busybox/examples/depmod.pl -F $(LINUXDIR)/System.map -b $(ARCH)-uclibc/target/lib/modules
698
699
700        export STRIP_KMOD="$(LINUXDIR)/scripts/strip-kmod.sh" && \
701        export STRIP="sstrip" && \
702        $(LINUXDIR)/scripts/rstrip.sh $(TARGETDIR)
703        $(TOP)/../../tools/removewhitespace.sh $(TOP)/../../tools $(TARGETDIR)/etc/config
704        $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/rootfs.squashfs -noappend -root-owned -le
705#       $(MAKE) -C compressed clean
706#       $(MAKE) -C compressed
707#       gzip -c9 compressed/zImage > compressed/zImage.gzip
708        gzip -c9 mipsel-uclibc/lzma_vmlinus > mipsel-uclibc/lzma_vmlinuz
709        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3-nandboot.trx $(ARCH)-uclibc/lzma_vmlinuz  -a 1024 $(ARCH)-uclibc/rootfs.squashfs
710#       ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K26.trx $(ARCH)-uclibc/vmlinus.gzip  -a 1024 $(ARCH)-uclibc/rootfs.squashfs
711#       ../../opt/asus/asustrx-rt66u -p RT-AC66U -v 3.0.0.1 -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-AC66U.trx $(ARCH)-uclibc/lzma_vmlinuz -a 1024 $(ARCH)-uclibc/rootfs.squashfs
712        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 1024 $(ARCH)-uclibc/rootfs.squashfs
713
714        -./tools/trx_asus -i $(ARCH)-uclibc/dd-wrt.v24-K3-nandboot.trx -r RT-AC66U,3.0.0.4,380,3264,$(ARCH)-uclibc/dd-wrt.v24-K3_RT-AC66U.trx
715ifeq ($(CONFIG_NOAC),y)
716
717#       ../../opt/asus/asustrx-rt66u -p RT-AC66U -v 3.0.0.1 -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K26_RT-AC66U.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz $(ARCH)-uclibc/rootfs.squashfs
718#       ../../opt/asus/asustrx-rt66u -p RT-AC66U -v 3.0.0.1 -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K26_RT-AC66U.trx $(ARCH)-uclibc/lzma_vmlinuz $(ARCH)-uclibc/rootfs.squashfs
719
720
721        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
722        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 0.6 RT-N16 1.00 1.05 $(ARCH)-uclibc/vmlinuz
723        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
724        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N16.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
725        rm -f $(ARCH)-uclibc/asusver   
726        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
727# end Asus RT-N16
728# Asus RT-N53
729        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
730        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 0.6 RT-N53 1.00 1.05 $(ARCH)-uclibc/vmlinuz
731        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
732        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N53.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
733        rm -f $(ARCH)-uclibc/asusver   
734        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
735# end Asus RT-N53
736# Asus RT-N12
737        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
738        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 0.6 RT-N12 1.00 1.05 $(ARCH)-uclibc/vmlinuz
739        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
740        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N12.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
741        rm -f $(ARCH)-uclibc/asusver   
742        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
743# end Asus RT-N12
744# Asus RT-N12B1
745        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
746        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 1.6 RT-N12B1 1.00 1.00 $(ARCH)-uclibc/vmlinuz
747        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
748        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N12B1.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
749        rm -f $(ARCH)-uclibc/asusver   
750        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
751# end Asus RT-N12B1
752# Asus RT-N12C1
753        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
754        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 1.6 RT-N12C1 1.00 1.00 $(ARCH)-uclibc/vmlinuz
755        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
756        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N12C1.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
757        rm -f $(ARCH)-uclibc/asusver   
758        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
759# end Asus RT-N12C1
760# Asus RT-N10
761        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
762        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 0.8 RT-N10 1.00 1.05 $(ARCH)-uclibc/vmlinuz
763        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
764        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N10.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
765        rm -f $(ARCH)-uclibc/asusver   
766        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
767# end Asus RT-N10
768# Asus RT-N10U
769        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
770        ../../opt/asus/addver $(ARCH)-uclibc/asusver 1.0 0.8 RT-N10U 1.00 1.05 $(ARCH)-uclibc/vmlinuz
771        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
772        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N10U.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
773        rm -f $(ARCH)-uclibc/asusver   
774        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
775# end Asus RT-N10U
776# Asus RT-N10+ D1
777        dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
778        ../../opt/asus/addver $(ARCH)-uclibc/asusver 2.1 1.1 RT-N10+ 1.00 1.00 $(ARCH)-uclibc/vmlinuz
779        cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
780        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N10PLUSD1.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz  -a 4096 $(ARCH)-uclibc/rootfs.squashfs-asus
781        rm -f $(ARCH)-uclibc/asusver   
782        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
783# end Asus RT-N10+ D1
784# Asus RT-N66
785#       dd if=/dev/zero of=$(ARCH)-uclibc/asusver bs=1 count=4032
786#       ../../opt/asus/addver $(ARCH)-uclibc/asusver 3.0 0.1 RT-N66U 0.00 0.00 $(ARCH)-uclibc/vmlinuz
787#       cat $(ARCH)-uclibc/rootfs.squashfs $(ARCH)-uclibc/asusver > $(ARCH)-uclibc/rootfs.squashfs-asus
788# end Asus RT-N66
789
790# Belkin f7d3301-7301 / f7d3302-7302 / f7d4302-8302  / f5d8235v3
791        dd if=$(ARCH)-uclibc/dd-wrt.v24-K3.trx of=$(ARCH)-uclibc/dd-wrt.v24-K3.notrxhd bs=4 count=10000000 skip=1 conv=notrunc
792        printf '\x22\x03\x10\x20' > $(ARCH)-uclibc/f7d3301.hdr
793        cat $(ARCH)-uclibc/f7d3301.hdr $(ARCH)-uclibc/dd-wrt.v24-K3.notrxhd > $(ARCH)-uclibc/dd-wrt.v24-K3_f7d3301.bin
794        rm -rf $(ARCH)-uclibc/f7d3301.hdr
795        printf '\x28\x09\x09\x20' > $(ARCH)-uclibc/f7d3302.hdr
796        cat $(ARCH)-uclibc/f7d3302.hdr $(ARCH)-uclibc/dd-wrt.v24-K3.notrxhd > $(ARCH)-uclibc/dd-wrt.v24-K3_f7d3302.bin
797        rm -rf $(ARCH)-uclibc/f7d3302.hdr
798        printf '\x06\x10\x09\x20' > $(ARCH)-uclibc/f7d4302.hdr 
799        cat $(ARCH)-uclibc/f7d4302.hdr $(ARCH)-uclibc/dd-wrt.v24-K3.notrxhd > $(ARCH)-uclibc/dd-wrt.v24-K3_f7d4302.bin
800        rm -rf $(ARCH)-uclibc/f5d4302.hdr
801        printf '\x16\x71\x01\x00' > $(ARCH)-uclibc/f5d8235v3.hdr       
802        cat $(ARCH)-uclibc/f5d8235v3.hdr $(ARCH)-uclibc/dd-wrt.v24-K3.notrxhd > $(ARCH)-uclibc/dd-wrt.v24-K3_f5d8235v3.bin
803        rm -rf $(ARCH)-uclibc/f5d8235v3.hdr
804        rm -rf $(ARCH)-uclibc/dd-wrt.v24-K3.notrxhd
805# end Belkin  f7d3301 / f7d3302 / f7d4302 / f5d8235v3
806#       ../../opt/asus/asustrx-rt66u -p RT-N66U -v 3.0.0.1 -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-N66U.trx ../../opt/loader-0.02/loader.gz $(ARCH)-uclibc/vmlinuz $(ARCH)-uclibc/rootfs.squashfs
807        -./tools/trx_asus -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -r RT-N66U,3.0.0.4,380,3264,$(ARCH)-uclibc/dd-wrt.v24-K3_RT-N66U.trx
808        rm -f $(ARCH)-uclibc/asusver   
809        rm -f $(ARCH)-uclibc/rootfs.squashfs-asus
810
811# Netgear
812        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wnr3500v2.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr3500.h && \
813        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500v2.chk
814        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wnr3500v2_VC.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr3500.h && \
815        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500v2_VC.chk
816        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wnr3500L.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr3500.h && \
817        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500L.chk
818        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wnr3500Lv2.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr3500lv2.h && \
819        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500Lv2.chk
820        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wnr3500U.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr3500.h && \
821        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500U.chk
822        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wnr2000v2.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr2000v2.h && \
823        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR2000v2.chk
824        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wndr3400.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wndr3400.h && \
825        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNDR3400.chk
826        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wndr3700v3.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wndr3700v3.h && \
827        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNDR3700v3.chk
828        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wndr3400cvna.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wndr3400.h && \
829        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNDR3400_CVNA.chk
830        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3.trx -f netgear/emptyfile -b netgear/comp-wndr4000.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wndr4000.h && \
831        cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNDR4000.chk
832# end Netgear
833
834# Linksys
835        ../../opt/tools/addpattern -4 -p 320N -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_wrt320n.bin -g
836        ../../opt/tools/addpattern -0 -p N150 -v v3.0.02 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_wrt160nv3.bin -g
837        ../../opt/tools/addpattern -4 -p 610N -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_wrt610n.bin -g
838        ../../opt/tools/addpattern -4 -p 310N -v v2.0.00 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_wrt310n.bin -g
839        ../../opt/tools/addpattern -4 -p M010 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_m10.bin -g
840        ../../opt/tools/addpattern -4 -p M020 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_m20.bin -g
841        ../../opt/tools/addpattern -4 -p E100 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e1000v1.bin -g
842        ../../opt/tools/addpattern -4 -p E100 -r 2.0.0.0 -v v1.1.1 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e1000v2.bin -g
843        ../../opt/tools/addpattern -4 -p 1550 -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e1550.bin -g
844        ../../opt/tools/addpattern -4 -p 32XN -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e2000.bin -g
845        ../../opt/tools/addpattern -4 -p E25X -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e2500.bin -g
846        ../../opt/tools/addpattern -4 -p 61XN -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e3000.bin -g
847        ../../opt/tools/addpattern -4 -p 3200 -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e3200.bin -g
848        ../../opt/tools/addpattern -4 -p 4200 -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e4200.bin -g
849        ../../opt/tools/addpattern -4 -p E800 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e800.bin -g
850        ../../opt/tools/addpattern -4 -p E900 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e900.bin -g
851        ../../opt/tools/addpattern -4 -p E120 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e1200v1.bin -g
852        ../../opt/tools/addpattern -4 -p E122 -r 2.0.0.0 -v v1.1.1 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e1200v2.bin -g
853        ../../opt/tools/addpattern -4 -p E150 -v v1.0.99 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_e1500.bin -g
854
855# end Linksys
856
857# special
858#ifeq ($(CONFIG_NVRAM_60K),y)
859        ../../opt/tools/addpattern -4 -p NV60 -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_nv60k.bin -g
860#endif
861#ifeq ($(CONFIG_NVRAM_64K),y)
862        ../../opt/tools/addpattern -4 -p NV64 -v v4.20.6 -i $(ARCH)-uclibc/dd-wrt.v24-K3.trx -o $(ARCH)-uclibc/dd-wrt.v24-K3_nv64k.bin -g
863#endif
864endif
865        -tools/ubnt/src/mkfwimage -v BZ.bcm4706.v6.0.0.3000.150000.1500 -o mipsel-uclibc/UNIFIAC.dd-wrt.bin -i tools/ubnt/unifiac-ddwrt.txt
866        ./netgear/lzma e  $(ARCH)-uclibc/vmlinux.bin  $(ARCH)-uclibc/vmlinux_netgear.lzma
867        ../../opt/tools/trx -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.trx $(ARCH)-uclibc/vmlinux_netgear.lzma  -a 4096 $(ARCH)-uclibc/rootfs.squashfs
868        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.trx -f netgear/emptyfile -b netgear/comp-r6300.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-r6300.h && cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.chk
869        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.trx -f netgear/emptyfile -b netgear/comp-wndr4500.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wndr4500.h && cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNDR4500.chk
870        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.trx -f netgear/emptyfile -b netgear/comp-wndr4500v2.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wndr4500.h && cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNDR4500V2.chk
871        ./netgear/packet -k $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.trx -f netgear/emptyfile -b netgear/comp-wnr3500Lv2.txt -ok kernel_image -oall dd-wrt.bin -or rootfs_image -i netgear/ambitCfg-wnr3500lv2.h && cp dd-wrt.bin.chk $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500Lv2.chk
872        cp $(ARCH)-uclibc/dd-wrt.v24-K3_R6300.trx $(ARCH)-uclibc/dd-wrt.v24-K3_WNR3500Lv2.bin
873
874
875        cd $(ARCH)-uclibc && ../tools/bufenc/makefw.sh dd-wrt.v24-K3-nandboot
876# end special
877
878#&& rm -f kernel_image.chk rootfs_image.chk dd-wrt.bin.chk
879
880
881
882#       ./tools/kernelopt/kernelopt.sh $(LINUXDIR) $(ARCH)-uclibc/target $(ARCH)-linux-uclibc-
883#       make -C $(LINUXDIR) vmlinux_optimize
884       
885#       objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUXDIR)/vmlinux_opt mipsel-uclibc/vmlinux
886#       objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUXDIR)/vmlinux mipsel-uclibc/vmlinux2
887#       ../../opt/loader-0.02/lzma e -lc2 -lp2 -pb2 -d25 mipsel-uclibc/vmlinux2 mipsel-uclibc/vmlinuz2
888#       $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/target.squashfs -noappend -root-owned -le
889#endif
890#
891# Configuration rules
892#
893include rules/all.mk
894#
895# Generic rules
896#
897
898%:
899        [ ! -d $* ] || $(MAKE) -C $*
900
901%-distclean:
902        [ ! -d $* ] || $(MAKE) -C $* clean
903
904%-clean:
905        [ ! -d $* ] || $(MAKE) -C $* clean
906
907%-install:
908        [ ! -d $* ] || $(MAKE) -C $* install INSTALLDIR=$(INSTALLDIR)/$*
909
910$(obj-y) $(obj-n) $(obj-clean) $(obj-install): dummy
911
912.PHONY: all clean distclean mrproper install package
913.PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
914.PHONY: dummy fixkc libnet libpcap
915
916
917
Note: See TracBrowser for help on using the repository browser.