source: src/router/Makefile.armbe @ 31634

Last change on this file since 31634 was 31634, checked in by brainslayer, 2 weeks ago

testing for new fs

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