source: src/router/Makefile.laguna @ 29183

Last change on this file since 29183 was 29183, checked in by BrainSlayer, 16 months ago

add new default option

  • Property svn:executable set to *
File size: 17.3 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
20CONFIG_MUSL=y
21CONFIG_NOOPT=y
22
23#
24# Paths
25#
26OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec auth auth_db nathelper
27OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),openser/modules/$(module)/$(module).so)
28OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
29OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic
30
31# Source bases
32
33export PLATFORM LINUXDIR LIBDIR USRLIBDIR
34export TOP := $(shell pwd)
35export SRCBASE := $(shell (cd $(TOP)/.. && pwd -P))
36
37
38# Set the HAL directory if you have the HAL sources
39
40# Set the Atheros Rate Control directory if you have the proprietary rate control
41export ATH_RATE=ath_rate/sample
42
43#
44# Cross-compile environment variables
45#
46
47# Build platform
48export BUILD := i386-pc-linux-gnu
49export HOSTCC := gcc
50
51# uClibc wrapper
52export ARCH:=$(PLATFORM)
53ifeq ($(CONFIG_UCLIBC),y)
54export PLATFORM := $(PLATFORM)-uclibc
55endif
56
57#export LINUXDIR := $(SRCBASE)/linux/linux.v24
58ifeq ($(ARCH),mips)
59export LINUXDIR := $(SRCBASE)/linux/brcm63xx/linux-2.6.17
60endif
61#ifeq ($(ARCH),armeb)
62#export LINUXDIR := $(SRCBASE)/linux/xscale/linux-2.6.23
63#endif
64ifeq ($(ARCH),mipsel)
65export LINUXDIR := $(SRCBASE)/kernel/rb500/linux-2.6.17-rc5
66endif
67ifeq ($(ARCH),i386)
68export LINUXDIR := $(SRCBASE)/kernel/wrap/linux-2.6.16.7
69endif
70
71export KERNELRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
72
73#export KERNELRELEASE = $(shell cat $(LINUXDIR)/.kernelrelease 2> /dev/null)
74
75#ifeq ($(PLATFORM),mipsel)
76#export CROSS_COMPILE := mipsel-linux-
77#export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
78#export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/../mipsel-linux && pwd -P)
79#endif
80
81#ifeq ($(PLATFORM),mipsel-uclibc)
82export CROSS_COMPILE := $(ARCH)-linux-uclibc-
83export CONFIGURE := ./configure $(ARCH)-linux --build=$(BUILD)
84export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
85#endif
86
87#ifeq ($(CONFIG_BCMWPA2),y)
88#export CFLAGS += -DBCMWPA2
89#endif
90
91export BASEOPT:=-O2
92#export ARCH:= mipsel
93
94ifeq ($(ARCH),mipsel)
95export COPTS:=$(BASEOPT) -pipe -mips32 -mtune=mips32 -funit-at-a-time
96endif
97ifeq ($(ARCH),armeb)
98export COPTS:=$(BASEOPT) -pipe -mtune=xscale -march=armv5te -Wa,-mcpu=xscale -mno-thumb-interwork -mno-thumb
99endif
100ifeq ($(ARCH),arm)
101export COPTS:=$(BASEOPT) -pipe -march=armv6k -mtune=mpcore -mfloat-abi=hard -mfpu=vfp -fno-caller-saves -fno-plt
102#-D_FILE_OFFSET_BITS=64
103endif
104ifeq ($(ARCH),mips)
105export COPTS:=$(BASEOPT) -pipe -mips32 -mtune=mips32 -funit-at-a-time
106endif
107ifeq ($(ARCH),i386)
108export COPTS:=$(BASEOPT) -pipe -march=i486 -funit-at-a-time
109endif
110
111export CC := ccache $(CROSS_COMPILE)gcc
112export CXX := ccache $(CROSS_COMPILE)g++
113export AR := $(CROSS_COMPILE)ar
114export AS := $(CROSS_COMPILE)as
115export LD := $(CROSS_COMPILE)ld
116export NM := $(CROSS_COMPILE)nm
117export RANLIB := $(CROSS_COMPILE)ranlib
118export STRIP := $(CROSS_COMPILE)strip
119export SIZE := $(CROSS_COMPILE)size
120
121export CFLAGS := $(COPTS)
122
123#
124# Install and target directories
125#
126
127export PLATFORMDIR := $(TOP)/$(PLATFORM)
128export INSTALLDIR := $(PLATFORMDIR)/install
129export TARGETDIR := $(PLATFORMDIR)/target
130
131ifeq ($(PLATFORM),mipsel)
132obj-y += libcrypto
133endif
134#
135# Configuration
136#
137CONFIG_IPTABLES=y
138
139include rules/configs.mk
140
141obj-clean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-clean)
142obj-install := $(foreach obj,$(obj-y),$(obj)-install)
143obj-distclean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-distclean)
144
145all: install_headers build_date clean_target $(obj-y) $(LINUXDIR)/.config kernel
146
147build_date:
148        echo "#define BUILD_DATE \"$(shell date +%D)\"" > ../../opt/build.h
149        echo "CONFIG_MUSL=y" >> .config
150
151
152kernelsource:
153        mkdir -p $(LINUXDIR)
154        wget http://www.de.kernel.org/pub/linux/kernel/v2.6/linux-$(KERNELVERSION).tar.bz2 -O $(LINUXDIR)/../linux-$(KERNELVERSION).tar.bz2
155        cd $(LINUXDIR)/../ && tar -xvjf $(LINUXDIR)/../linux-$(KERNELVERSION).tar.bz2
156        cd $(LINUXDIR)/../ && ./patch $(KERNELVERSION)
157
158include kernel-features.mk
159
160kernel:
161        # Also build kernel
162ifeq ($(CONFIG_LAGUNA),y)
163ifeq ($(CONFIG_LAGUNA_NOSMP),y)
164        cp $(LINUXDIR)/.config_laguna_nosmp $(LINUXDIR)/.config
165else
166        cp $(LINUXDIR)/.config_laguna$(DD_LAGUNA_NOSMP) $(LINUXDIR)/.config
167endif
168endif
169        $(kernelfeatures)
170        $(MAKE) -C $(LINUXDIR) oldconfig       
171
172        $(MAKE) -j 4 -C $(LINUXDIR) uImage  CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"
173        $(MAKE) -j 4 -C $(LINUXDIR) modules  CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"
174        rm -rf $(TARGETDIR)/lib/modules
175        $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
176        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
177        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
178
179        -$(MAKE) -f Makefile.laguna ath9k
180        -$(MAKE) -f Makefile.laguna ath9k-install
181        -$(MAKE) -f Makefile.laguna libutils
182        -$(MAKE) -f Makefile.laguna madwifi
183        -$(MAKE) -f Makefile.laguna madwifi-install
184        -$(MAKE) -f Makefile.laguna batman-adv
185        -$(MAKE) -f Makefile.laguna batman-adv-install
186        -$(MAKE) -f Makefile.laguna opendpi
187        -$(MAKE) -f Makefile.laguna opendpi-install
188        -$(MAKE) -f Makefile.laguna uniwip-gpio
189        -$(MAKE) -f Makefile.laguna uniwip-gpio-install
190
191        find $(ARCH)-uclibc/install $(ARCH)-uclibc/target  -name \*.ko | \
192                xargs $(ARCH)-linux-nm | \
193                awk '$$1 == "U" { print $$2 } ' | \
194                sort -u > $(LINUXDIR)/mod_symtab.txt
195        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' r __ksymtab' | sed -e 's,........ r __ksymtab_,,' > $(LINUXDIR)/kernel_symtab.txt
196        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' R __ksymtab' | sed -e 's,........ R __ksymtab_,,' >> $(LINUXDIR)/kernel_symtab.txt
197        grep -f $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_include.txt
198        grep -vf $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_exclude.txt
199        ( \
200                echo '#define SYMTAB_KEEP \'; \
201                cat $(LINUXDIR)/sym_include.txt | \
202                        awk '{print "KEEP(*(___ksymtab+" $$$$1 ")) \\" }'; \
203                echo; \
204                echo '#define SYMTAB_KEEP_GPL \'; \
205                cat $(LINUXDIR)/sym_include.txt | \
206                        awk '{print "KEEP(*(___ksymtab_gpl+" $$$$1 ")) \\" }'; \
207                echo; \
208                echo '#define SYMTAB_DISCARD \'; \
209                cat $(LINUXDIR)/sym_exclude.txt | \
210                        awk '{print "*(___ksymtab+" $$$$1 ") \\" }'; \
211                echo; \
212                echo '#define SYMTAB_DISCARD_GPL \'; \
213                cat $(LINUXDIR)/sym_exclude.txt | \
214                        awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
215                echo; \
216        ) > $(LINUXDIR)/symtab.h
217        rm -f $(LINUXDIR)/vmlinux
218        $(MAKE) -j 4 -C $(LINUXDIR) uImage EXTRA_LDSFLAGS="-I$(LINUXDIR) -include symtab.h"  CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"
219
220install_headers:
221# important step, required for new kernels
222        -mkdir -p $(TOP)/kernel_headers/$(KERNELRELEASE)
223        $(MAKE) -C $(LINUXDIR) headers_install ARCH=arm INSTALL_HDR_PATH=$(TOP)/kernel_headers/$(KERNELRELEASE)
224
225       
226realclean: $(obj-clean)
227        rm -f .config.old .config.cmd
228        #umount $(TARGETDIR)
229        rm -rf $(INSTALLDIR)
230        rm -rf $(TARGETDIR)
231        rm -f $(TARGETDIR)/*
232        -rm -f $(ARCH)-uclibc/*
233
234       
235clean: rc-clean httpd-clean services-clean shared-clean libutils-clean nvram-clean madwifi-clean madwifi_mimo-clean busybox-clean dnsmasq-clean iptables-clean pppd-clean iproute2-clean
236        rm -f .config.old .config.cmd
237        #umount $(TARGETDIR)
238        rm -rf $(INSTALLDIR)
239        rm -rf $(TARGETDIR)
240        rm -f $(TARGETDIR)/*
241        -rm -f $(ARCH)-uclibc/*
242
243clean_target:
244        rm -rf $(TARGETDIR)
245        rm -rf $(INSTALLDIR)
246
247distclean mrproper: $(obj-distclean) clean_target
248        rm -rf $(INSTALLDIR)
249        $(MAKE) -C $(LINUXDIR) distclean
250        $(MAKE) -C $(LINUXDIR)/arch/mips/bcm947xx/compressed clean
251        #rm -f $(PLATFORMDIR)/zImage $(PLATFORMDIR)/linux.bin
252        $(MAKE) -C config clean
253        rm -f .config $(LINUXDIR)/.config
254        rm -f .config.old .config.cmd
255
256optimize-lib:
257ifneq ($(CONFIG_MUSL),y)
258        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
259else
260        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so} $(ARCH)-uclibc/target/lib/libc.so
261endif
262ifneq ($(CONFIG_MUSL),y)
263        cp ${shell $(ARCH)-linux-gcc -print-file-name=ld-uclibc.so.0} $(ARCH)-uclibc/target/lib/ld-uClibc.so.0
264else
265        cd $(ARCH)-uclibc/target/lib && ln -sf libc.so ld-musl-armhf.so.1
266endif
267        cp ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
268ifeq ($(CONFIG_LIBDL),y)
269        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libdl.so.0} $(ARCH)-uclibc/target/lib/libdl.so.0
270endif
271ifeq ($(CONFIG_LIBRT),y)
272        -cp ${shell $(ARCH)-linux-gcc -print-file-name=librt.so.0} $(ARCH)-uclibc/target/lib/librt.so.0
273endif
274ifeq ($(CONFIG_LIBNSL),y)
275        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libnsl.so.0} $(ARCH)-uclibc/target/lib/libnsl.so.0
276endif
277ifeq ($(CONFIG_LIBUTIL),y)
278        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libutil.so.0} $(ARCH)-uclibc/target/lib/libutil.so.0
279endif
280ifeq ($(CONFIG_LIBCPP),y)
281        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libstdc++.so.6} $(ARCH)-uclibc/target/lib/libstdc++.so.6
282endif
283ifeq ($(CONFIG_LIBCRYPT),y)
284        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libcrypt.so.0} $(ARCH)-uclibc/target/lib/libcrypt.so.0
285endif
286ifeq ($(CONFIG_LIBM),y)
287        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libm.so.0} $(ARCH)-uclibc/target/lib/libm.so.0
288endif
289ifeq ($(CONFIG_LIBRESOLV),y)
290        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libresolv.so.0} $(ARCH)-uclibc/target/lib/libresolv.so.0
291endif
292ifeq ($(CONFIG_LIBPTHREAD),y)
293        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libpthread.so.0} $(ARCH)-uclibc/target/lib/libpthread.so.0
294endif
295ifeq ($(CONFIG_RELINK),y)
296ifneq ($(CONFIG_MUSL),y)
297        relink-lib.sh \
298                "$(ARCH)-linux-" \
299                "${shell $(ARCH)-linux-gcc -print-file-name=libc_so.a}" \
300                "${shell $(ARCH)-linux-gcc -print-file-name=libc_so.a}" \
301                "$(ARCH)-uclibc/target/lib/libc.so.0" \
302                -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 \
303                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1}
304else
305        relink-lib.sh \
306                "$(ARCH)-linux-" \
307                "${shell $(ARCH)-linux-gcc -print-file-name=libc.a}" \
308                "${shell $(ARCH)-linux-gcc -print-file-name=libc.a}" \
309                "$(ARCH)-uclibc/target/lib/libc.so" \
310                -Wl,-init,__uClibc_init -Wl,-soname=libc.so \
311                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1}
312endif
313
314        -relink-lib.sh \
315                "$(ARCH)-linux-" \
316                "${shell $(ARCH)-linux-gcc -print-file-name=libcrypt.so}" \
317                "${shell $(ARCH)-linux-gcc -print-file-name=libcrypt_pic.a}" \
318                "$(ARCH)-uclibc/target/lib/libcrypt.so.0" \
319                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
320                -Wl,-soname=libcrypt.so.0
321
322        -relink-lib.sh \
323                "$(ARCH)-linux-" \
324                "${shell $(ARCH)-linux-gcc -print-file-name=libm.so}" \
325                "${shell $(ARCH)-linux-gcc -print-file-name=libm_pic.a}" \
326                "$(ARCH)-uclibc/target/lib/libm.so.0" \
327                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
328                -Wl,-soname=libm.so.0
329
330        -relink-lib.sh \
331                "$(ARCH)-linux-" \
332                "${shell $(ARCH)-linux-gcc -print-file-name=libpthread.so.0}" \
333                "${shell $(ARCH)-linux-gcc -print-file-name=libpthread_so.a}" \
334                "$(ARCH)-uclibc/target/lib/libpthread.so.0" \
335                -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal \
336                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
337                -Wl,-soname=libpthread.so.0
338endif
339        cp ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
340#       relink-lib.sh \
341#               "$(ARCH)-linux-" \
342#               "${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1}" \
343#               "${shell $(ARCH)-linux-gcc -print-file-name=libgcc_pic.a}" \
344#               "$(ARCH)-uclibc/target/lib/libgcc_s.so.1" \
345#               -Wl,--version-script=${shell $(ARCH)-linux-gcc -print-file-name=libgcc.map} -Wl,-soname=libgcc_s.so.1
346
347
348
349ifneq ($(CONFIG_NOOPT),y)
350        rm -rf /tmp/$(ARCHITECTURE)/mklibs-out
351        rm -f /tmp/$(ARCHITECTURE)/mklibs-progs
352        -mkdir -p /tmp/$(ARCHITECTURE)/
353        find $(TARGETDIR) -type f -perm /100 -exec \
354                file -r -N -F '' {} + | \
355                awk ' /executable.*dynamically/ { print $$1 }' > /tmp/$(ARCHITECTURE)/mklibs-progs
356
357        find $(TARGETDIR) -type f -name \*.so\* -exec \
358                file -r -N -F '' {} + | \
359                awk ' /shared object/ { print $$1 }' >> /tmp/$(ARCHITECTURE)/mklibs-progs
360
361        mkdir -p /tmp/$(ARCHITECTURE)/mklibs-out
362ifneq ($(CONFIG_MUSL),y)
363        mklibs.py -D \
364                -d /tmp/$(ARCHITECTURE)/mklibs-out \
365                --sysroot $(TARGETDIR) \
366                -L /lib \
367                -L /usr/lib \
368                --ldlib /lib/ld-uClibc.so.0 \
369                --target $(ARCH)-linux-uclibc \
370                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
371else
372        mklibs.py -D \
373                -d /tmp/$(ARCHITECTURE)/mklibs-out \
374                --sysroot $(TARGETDIR) \
375                -L /lib \
376                -L /usr/lib \
377                --ldlib /lib/ld-musl-arm.so.1 \
378                --target $(ARCH)-linux-uclibc \
379                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
380
381endif
382        cp /tmp/$(ARCHITECTURE)/mklibs-out/* $(TARGETDIR)/lib
383endif
384#       rm -f $(TARGETDIR)/lib/*.a
385#       rm -f $(TARGETDIR)/lib/*.map
386#       cp lib.$(ARCH)/libresolv.so.0 $(TARGETDIR)/lib
387#       cp lib.$(ARCH)/libgcc_s.so.1 $(TARGETDIR)/lib
388
389
390install package: clean_target $(filter-out lib.$(ARCH)-install,$(obj-install)) $(LINUXDIR)/.config
391        # Install binaries into target directory
392        install -d $(TARGETDIR)
393        for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
394            (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
395        done
396        mkdir -p $(ARCH)-uclibc/target/etc/config
397        mkdir -p $(ARCH)-uclibc/target/etc/kaid
398        mkdir -p $(ARCH)-uclibc/target/etc/langpack
399        cp ./opt/bin/ipkg $(ARCH)-uclibc/target/bin
400        cd  $(ARCH)-uclibc/target/lib
401        cp ./opt/etc/preinit $(ARCH)-uclibc/target/etc
402        cp ./opt/etc/postinit $(ARCH)-uclibc/target/etc
403        cp ./opt/etc/ipkg.conf $(ARCH)-uclibc/target/etc
404        cp ./opt/etc/config/* $(ARCH)-uclibc/target/etc/config
405        cp ./opt/usr/lib/smb.conf $(ARCH)-uclibc/target/usr/lib
406        ln -sf ../tmp/smbshare $(ARCH)-uclibc/target/www/smb
407        # optimize the crypto library by removing unneeded symbols
408        # Install (and possibly optimize) C library
409#       $(MAKE) -f Makefile.laguna lib.$(ARCH)-install
410        # optimize the others library by removing unneeded symbols
411        $(MAKE) -f Makefile.laguna optimize-lib
412        # Install modules into filesystem
413        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
414            $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR) ; \
415        fi
416ifeq ($(CONFIG_MADWIFI),y)
417        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/wl
418endif
419ifeq ($(CONFIG_WP18),y)
420        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs
421        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/scsi
422        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/usb
423        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/e1000
424        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/char
425        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv6
426        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/net/sunrpc
427endif
428ifeq ($(CONFIG_WAVESAT),y)
429        make -f Makefile.laguna wavesat-install
430endif
431#       cp lib.$(ARCH)/libgcc_s.so.1 $(TARGETDIR)/lib
432        find $(TARGETDIR) -name "wl_*.o"  | xargs rm -rf
433ifneq ($(CONFIG_SAMBA),y)
434        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/cifs
435endif
436        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
437        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
438        # Prepare filesystem
439        # Make sure mksquashfs-2.0 is used
440        cd $(TARGETDIR)  &&  find . -iname "CVS" | xargs rm -rf
441        cd $(TARGETDIR)  &&  find . -iname ".svn" | xargs rm -rf
442        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
443        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
444        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel
445        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net
446        #e2fsck -y -f $(ARCH)-uclibc/root.fs
447        ./busybox/examples/depmod.pl -F $(LINUXDIR)/System.map -b $(ARCH)-uclibc/target/lib/modules
448#       tar --directory=$(TARGETDIR) --remove-files -cvvjf $(TARGETDIR)/etc/local.tar.bz2 usr/local
449        rm -rf $(TARGETDIR)/usr/local
450        mkdir $(TARGETDIR)/usr/local
451ifeq ($(CONFIG_KAID),y)
452        cp kaid/kaid $(TARGETDIR)/usr/sbin
453endif
454        mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib
455        export STRIP_KMOD="$(LINUXDIR)/scripts/strip-kmod.sh" && \
456        export STRIP="sstrip" && \
457        $(LINUXDIR)/scripts/rstrip.sh $(TARGETDIR)
458        cd $(TARGETDIR) && $(TOP)/misc/rootprep.sh
459        $(TOP)/../../tools/removewhitespace.sh $(TOP)/../../tools $(TARGETDIR)/etc/config
460        $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -noappend -root-owned -le
461        mkfs.jffs2 --pad --big-endian --squash -e 0x20000 -o $(ARCH)-uclibc/dd-wrt.jffs2 -d $(ARCH)-uclibc/target
462        echo -ne '\xde\xad\xc0\xde' >> $(ARCH)-uclibc/dd-wrt.jffs2
463        dd if=$(LINUXDIR)/arch/arm/boot/uImage of=$(ARCH)-uclibc/laguna-firmware.raw1 bs=131072 conv=sync
464        dd if=$(LINUXDIR)/arch/arm/boot/uImage of=$(ARCH)-uclibc/laguna-firmware.raw2 bs=131072 conv=sync
465        cat $(ARCH)-uclibc/dd-wrt.jffs2>>$(ARCH)-uclibc/laguna-firmware.raw1
466        cat $(ARCH)-uclibc/root.fs>>$(ARCH)-uclibc/laguna-firmware.raw2
467        -./tools/trx_n -m 30000000 -o $(ARCH)-uclibc/laguna-firmware-jffs.bin $(ARCH)-uclibc/laguna-firmware.raw1
468        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/laguna-firmware-squashfs.bin $(ARCH)-uclibc/laguna-firmware.raw2
469
470
471
472include rules/all.mk
473
474.PHONY: all clean distclean mrproper install package
475.PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
476.PHONY: dummy fixkc libnet libpcap
477
478
479
Note: See TracBrowser for help on using the repository browser.