source: src/router/Makefile.danube @ 31667

Last change on this file since 31667 was 31667, checked in by brainslayer, 5 months ago

new squashfs

File size: 20.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
20#
21# Paths
22#
23OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec auth auth_db nathelper
24OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),openser/modules/$(module)/$(module).so)
25OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
26OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
27
28# Source bases
29
30export PLATFORM LINUXDIR LIBDIR USRLIBDIR
31export TOP := $(shell pwd)
32export SRCBASE := $(shell (cd $(TOP)/.. && pwd -P))
33
34
35# Set the HAL directory if you have the HAL sources
36
37# Set the Atheros Rate Control directory if you have the proprietary rate control
38export ATH_RATE=ath_rate/sample
39
40#
41# Cross-compile environment variables
42#
43
44# Build platform
45export BUILD := i386-pc-linux-gnu
46export HOSTCC := gcc
47
48# uClibc wrapper
49export ARCH:=$(PLATFORM)
50ifeq ($(CONFIG_UCLIBC),y)
51export PLATFORM := $(PLATFORM)-uclibc
52endif
53
54#export LINUXDIR := $(SRCBASE)/linux/linux.v24
55#ifeq ($(ARCH),mips)
56#export LINUXDIR := $(SRCBASE)/linux/ar531x/linux-2.6.22
57#endif
58ifeq ($(ARCH),armeb)
59export LINUXDIR := $(SRCBASE)/linux/xscale/linux-2.6.17
60endif
61ifeq ($(ARCH),powerpc)
62export LINUXDIR := $(SRCBASE)/linux/magicbox/linux-2.6.19
63endif
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#ifeq ($(KERNELRELEASE),"")
74#export KERNELRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
75#endif
76#ifeq ($(PLATFORM),mipsel)
77#export CROSS_COMPILE := mipsel-linux-
78#export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
79#export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/../mipsel-linux && pwd -P)
80#endif
81
82#ifeq ($(PLATFORM),mipsel-uclibc)
83export CROSS_COMPILE := $(ARCH)-linux-uclibc-
84export CONFIGURE := ./configure $(ARCH)-linux --build=$(BUILD)
85export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
86#endif
87
88#ifeq ($(CONFIG_BCMWPA2),y)
89#export CFLAGS += -DBCMWPA2
90#endif
91
92export BASEOPT:=-Os
93#export ARCH:= mipsel
94
95ifeq ($(ARCH),mipsel)
96export COPTS:=$(BASEOPT) -pipe -mips32 -mtune=mips32 -funit-at-a-time
97endif
98ifeq ($(ARCH),armeb)
99export COPTS:=$(BASEOPT) -pipe -mtune=xscale -march=armv5te -Wa,-mcpu=xscale -mno-thumb-interwork -mno-thumb -funit-at-a-time
100endif
101ifeq ($(ARCH),mips)
102export COPTS:=$(BASEOPT) -pipe -mips32r2 -mtune=mips32r2 -msoft-float  -fno-caller-saves
103endif
104ifeq ($(ARCH),powerpc)
105export COPTS:=$(BASEOPT) -pipe -funit-at-a-time -mcpu=405fp -mtune=405fp -mmultiple -mstring -mno-bit-align
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
120export MIPS16_OPT:= -minterlink-mips16 -mips16
121
122export CFLAGS := $(COPTS)
123
124#
125# Install and target directories
126#
127
128export PLATFORMDIR := $(TOP)/$(PLATFORM)
129export INSTALLDIR := $(PLATFORMDIR)/install
130export TARGETDIR := $(PLATFORMDIR)/target
131
132ifeq ($(PLATFORM),mipsel)
133obj-y += libcrypto
134endif
135#
136# Configuration
137#
138CONFIG_IPTABLES=y
139include rules/configs.mk
140
141obj-clean := $(foreach obj,$(obj-y) $(obj-n) $(obj-m),$(obj)-clean)
142obj-install := $(foreach obj,$(obj-y) $(obj-m),$(obj)-install)
143obj-distclean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-distclean)
144
145#
146# Basic rules
147#
148
149
150all: install_headers build_date clean_target $(obj-y) $(obj-m) $(LINUXDIR)/.config kernel
151
152
153build_date:
154        echo "#define BUILD_DATE \"$(shell date +%D)\"" > ../../opt/build.h
155
156drop-sections   = .comment
157strip-flags     = $(addprefix --remove-section=,$(drop-sections))
158
159include kernel-features.mk
160
161kernel:
162        # Also build kernel
163        # Also build kernel
164        -cp $(LINUXDIR)/.config_danube $(LINUXDIR)/.config
165ifeq ($(CONFIG_VF803),y)
166        cp $(LINUXDIR)/.config_803 $(LINUXDIR)/.config
167endif
168ifeq ($(CONFIG_VF802),y)
169        cp $(LINUXDIR)/.config_802 $(LINUXDIR)/.config
170endif
171ifeq ($(CONFIG_SX763),y)
172        cp $(LINUXDIR)/.config_sx763 $(LINUXDIR)/.config
173endif
174ifeq ($(CONFIG_WMBR_G300NH),y)
175        cp $(LINUXDIR)/.config_wmbr $(LINUXDIR)/.config
176endif
177        $(kernelfeatures)
178        $(MAKE) -C $(LINUXDIR) oldconfig       
179
180        $(MAKE) -j 4 -C $(LINUXDIR) CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"
181        $(MAKE) -j 4 -C $(LINUXDIR) modules  CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"
182
183        $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
184        -$(MAKE) -f Makefile.danube rt3062
185        -$(MAKE) -f Makefile.danube rt3062-install
186        -$(MAKE) -f Makefile.danube rt2860
187        -$(MAKE) -f Makefile.danube rt2860-install
188        -$(MAKE) -f Makefile.danube ath9k
189        -$(MAKE) -f Makefile.danube ath9k-install
190        -$(MAKE) -f Makefile.danube libutils
191        -$(MAKE) -f Makefile.danube madwifi
192        -$(MAKE) -f Makefile.danube madwifi-install
193        -$(MAKE) -f Makefile.danube batman-adv
194        -$(MAKE) -f Makefile.danube batman-adv-install
195        -$(MAKE) -f Makefile.danube opendpi
196        -$(MAKE) -f Makefile.danube opendpi-install
197        -$(MAKE) -f Makefile.danube uniwip-gpio
198        -$(MAKE) -f Makefile.danube uniwip-gpio-install
199
200        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
201        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
202ifneq ($(CONFIG_SAMBA),y)
203        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/cifs
204endif
205ifneq ($(CONFIG_JFFS2),y)
206        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jffs2
207        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/lib/lzma
208endif
209ifneq ($(CONFIG_IPV6),y)
210        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv6
211endif
212ifneq ($(CONFIG_USB),y)
213        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext2
214        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext3
215        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/xfs
216        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd
217        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/fat
218        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/vfat
219        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/msdos
220        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/mbcache.ko
221endif
222
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        grep -f $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_include.txt
229        grep -vf $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_exclude.txt
230        ( \
231                echo '#define SYMTAB_KEEP \'; \
232                cat $(LINUXDIR)/sym_include.txt | \
233                        awk '{print "KEEP(*(___ksymtab+" $$$$1 ")) \\" }'; \
234                echo; \
235                echo '#define SYMTAB_KEEP_GPL \'; \
236                cat $(LINUXDIR)/sym_include.txt | \
237                        awk '{print "KEEP(*(___ksymtab_gpl+" $$$$1 ")) \\" }'; \
238                echo; \
239                echo '#define SYMTAB_DISCARD \'; \
240                cat $(LINUXDIR)/sym_exclude.txt | \
241                        awk '{print "*(___ksymtab+" $$$$1 ") \\" }'; \
242                echo; \
243                echo '#define SYMTAB_DISCARD_GPL \'; \
244                cat $(LINUXDIR)/sym_exclude.txt | \
245                        awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
246                echo; \
247        ) > $(LINUXDIR)/symtab.h
248        rm -f $(LINUXDIR)/vmlinux
249        $(MAKE) -j 4 -C $(LINUXDIR) vmlinux EXTRA_LDSFLAGS="-I$(LINUXDIR) -include symtab.h" CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-"
250
251install_headers:
252# important step, required for new kernels
253        -mkdir -p $(TOP)/kernel_headers/$(KERNELRELEASE)
254        $(MAKE) -C $(LINUXDIR) headers_install ARCH=mips INSTALL_HDR_PATH=$(TOP)/kernel_headers/$(KERNELRELEASE)
255
256       
257realclean: $(obj-clean)
258        rm -f .config.old .config.cmd
259        #umount $(TARGETDIR)
260        rm -rf $(INSTALLDIR)
261        rm -rf $(TARGETDIR)
262        -rm -f $(TARGETDIR)/*
263        -rm -f $(ARCH)-uclibc/*
264
265               
266clean: rc-clean httpd-clean services-clean shared-clean libutils-clean madwifi-clean busybox-clean dnsmasq-clean iptables-clean pppd-clean nvram-clean iproute2-clean
267        rm -f .config.old .config.cmd
268        #umount $(TARGETDIR)
269        rm -rf $(INSTALLDIR)
270        rm -rf $(TARGETDIR)
271        rm -f $(TARGETDIR)/*
272        -rm -f $(ARCH)-uclibc/*
273
274clean_target:
275        #umount $(TARGETDIR)
276        rm -rf $(TARGETDIR)
277        rm -rf $(INSTALLDIR)
278        rm -rf $(INSTALLDIR)
279#       rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.squashfs
280
281distclean mrproper: $(obj-distclean) clean_target
282        rm -rf $(INSTALLDIR)
283        $(MAKE) -C $(LINUXDIR) distclean
284        $(MAKE) -C $(LINUXDIR)/arch/mips/bcm947xx/compressed clean
285        #rm -f $(PLATFORMDIR)/zImage $(PLATFORMDIR)/linux.bin
286        $(MAKE) -C config clean
287        rm -f .config $(LINUXDIR)/.config
288        rm -f .config.old .config.cmd
289
290optimize-lib:
291        cp ${shell $(ARCH)-linux-gcc -print-file-name=ld-uClibc.so.0} $(ARCH)-uclibc/target/lib/ld-uClibc.so.0
292        cp ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
293ifeq ($(CONFIG_LIBDL),y)
294        cp ${shell $(ARCH)-linux-gcc -print-file-name=libdl.so.0} $(ARCH)-uclibc/target/lib/libdl.so.0
295endif
296ifeq ($(CONFIG_LIBRT),y)
297        -cp ${shell $(ARCH)-linux-gcc -print-file-name=librt.so.0} $(ARCH)-uclibc/target/lib/librt.so.0
298endif
299ifeq ($(CONFIG_LIBATOMIC),y)
300        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libatomic.so.1} $(ARCH)-uclibc/target/lib/libatomic.so.1
301endif
302ifeq ($(CONFIG_SQUID),y)
303        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libatomic.so.1} $(ARCH)-uclibc/target/lib/libatomic.so.1
304endif
305ifeq ($(CONFIG_LIBNSL),y)
306        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libnsl.so.0} $(ARCH)-uclibc/target/lib/libnsl.so.0
307endif
308ifeq ($(CONFIG_LIBUTIL),y)
309        cp ${shell $(ARCH)-linux-gcc -print-file-name=libutil.so.0} $(ARCH)-uclibc/target/lib/libutil.so.0
310endif
311ifeq ($(CONFIG_LIBCPP),y)
312        cp ${shell $(ARCH)-linux-gcc -print-file-name=libstdc++.so.6} $(ARCH)-uclibc/target/lib/libstdc++.so.6
313endif
314ifeq ($(CONFIG_LIBCRYPT),y)
315        cp ${shell $(ARCH)-linux-gcc -print-file-name=libcrypt.so.0} $(ARCH)-uclibc/target/lib/libcrypt.so.0
316endif
317ifeq ($(CONFIG_LIBM),y)
318        cp ${shell $(ARCH)-linux-gcc -print-file-name=libm.so.0} $(ARCH)-uclibc/target/lib/libm.so.0
319endif
320ifeq ($(CONFIG_LIBRESOLV),y)
321        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libresolv.so.0} $(ARCH)-uclibc/target/lib/libresolv.so.0
322endif
323ifeq ($(CONFIG_LIBPTHREAD),y)
324        cp ${shell $(ARCH)-linux-gcc -print-file-name=libpthread.so.0} $(ARCH)-uclibc/target/lib/libpthread.so.0
325endif
326        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
327
328ifneq ($(CONFIG_NOOPT),y)
329
330        rm -rf /tmp/$(ARCHITECTURE)/mklibs-out
331        rm -f /tmp/$(ARCHITECTURE)/mklibs-progs
332        -mkdir -p /tmp/$(ARCHITECTURE)/
333        find $(TARGETDIR) -type f -perm /100 -exec \
334                file -r -N -F '' {} + | \
335                awk ' /executable.*dynamically/ { print $$1 }' > /tmp/$(ARCHITECTURE)/mklibs-progs
336
337        find $(TARGETDIR) -type f -name \*.so\* -exec \
338                file -r -N -F '' {} + | \
339                awk ' /shared object/ { print $$1 }' >> /tmp/$(ARCHITECTURE)/mklibs-progs
340
341        mkdir -p /tmp/$(ARCHITECTURE)/mklibs-out
342        mklibs.py -D \
343                -d /tmp/$(ARCHITECTURE)/mklibs-out \
344                --sysroot $(TARGETDIR) \
345                -L /lib \
346                -L /usr/lib \
347                --ldlib /lib/ld-uClibc.so.0 \
348                --target $(ARCH)-linux-uclibc \
349                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
350        cp /tmp/$(ARCHITECTURE)/mklibs-out/* $(TARGETDIR)/lib
351endif
352
353install_headers:
354# important step, required for new kernels
355        -mkdir -p $(TOP)/kernel_headers/$(KERNELRELEASE)
356        $(MAKE) -C $(LINUXDIR) headers_install ARCH=mips INSTALL_HDR_PATH=$(TOP)/kernel_headers/$(KERNELRELEASE)
357
358
359install package: clean_target $(filter-out lib.$(ARCH)-install,$(obj-install)) $(LINUXDIR)/.config
360        install -d $(TARGETDIR)
361        install -d $(ARCH)-uclibc/modules
362        for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
363            (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
364        done
365        for dir in $(wildcard $(patsubst %,%,$(obj-m))) ; do \
366            (cd $(INSTALLDIR)/$${dir} && tar -cvvzf $(TOP)/$(ARCH)-uclibc/modules/$${dir}.tar.gz .) \
367        done
368        mkdir -p $(ARCH)-uclibc/target/etc/config
369        mkdir -p $(ARCH)-uclibc/target/etc/kaid
370        mkdir -p $(ARCH)-uclibc/target/etc/langpack
371        cp ./opt/bin/ipkg $(ARCH)-uclibc/target/bin
372        cd  $(ARCH)-uclibc/target/lib
373        cp ./opt/etc/preinit $(ARCH)-uclibc/target/etc
374        cp ./opt/etc/postinit $(ARCH)-uclibc/target/etc
375        cp ./opt/etc/ipkg.conf $(ARCH)-uclibc/target/etc
376        cp ./opt/etc/config/* $(ARCH)-uclibc/target/etc/config
377ifeq ($(CONFIG_HTTPD),y)
378        cp ./opt/usr/lib/smb.conf $(ARCH)-uclibc/target/usr/lib
379        ln -sf ../tmp/smbshare $(ARCH)-uclibc/target/www/smb
380endif
381ifeq ($(CONFIG_KAID),y)
382        cp kaid/kaid $(TARGETDIR)/usr/sbin
383endif
384ifeq ($(CONFIG_RC),y)
385        mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib
386endif
387
388        # optimize the crypto library by removing unneeded symbols
389        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
390        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
391        # Install (and possibly optimize) C library
392#       $(MAKE) -f Makefile.danube lib.$(ARCH)-install
393        # optimize the others library by removing unneeded symbols
394        $(MAKE) -f Makefile.danube optimize-lib
395        # Install modules into filesystem
396        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
397            $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR) ; \
398        fi
399ifeq ($(CONFIG_MADWIFI),y)
400        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/wl
401endif
402ifneq ($(CONFIG_SAMBA),y)
403        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/cifs
404endif
405ifneq ($(CONFIG_JFFS2),y)
406        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jffs2
407        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/lib/lzma
408endif
409ifneq ($(CONFIG_IPV6),y)
410        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv6
411endif
412ifneq ($(CONFIG_USB),y)
413        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext2
414        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext3
415        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/xfs
416        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd
417        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/fat
418        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/vfat
419        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/msdos
420        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/mbcache.ko
421endif
422#       mkdir -p $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
423#       cp ../wl/ctmisc/ctmisc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
424        ##not used yet
425        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
426        #cp ./switch/switch-core.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
427        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
428#       cp ./viarhine/via-rhine.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net
429
430        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
431        #cp ./switch/switch-adm.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
432        cp lib.$(ARCH)/libgcc_s.so.1 $(TARGETDIR)/lib
433        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
434        #cp ./switch/switch-robo.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
435       
436        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc1/kernel/drivers/net/et
437        #cp ../et/linux/et.o $(TARGETDIR)/lib/modules/2.4.32-rc1/kernel/drivers/net/et
438       
439        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/et.4702
440        #cp ../et.4702/linux/4702et.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/et.4702
441        # robo switch
442        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/robo
443        #cp ../robo/linux/robo.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/robo
444       
445        find $(TARGETDIR) -name "wl_*.o"  | xargs rm -rf
446        # quick n dirty - stuff Nikki's module where it belongs
447        #mkdir $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996
448#       if [ "$(CONFIG_MMC)" = "y" ] ; then \
449#       mkdir $(TARGETDIR)/lib/modules/2.4.32/kernel/fs/mmc ; \
450#       cp mmc/mmc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/fs/mmc ; \
451#       fi ;
452
453
454#ifeq ($(CONFIG_MSSID),y)
455#       cp adm6996.v24/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
456#else   
457#       cp adm6996/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
458#endif
459
460        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
461        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
462       
463       
464       
465        # Prepare filesystem
466        cd $(TARGETDIR) && $(TOP)/misc/rootprep.sh
467        # Make sure mksquashfs-2.0 is used
468#       $(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs
469        cd $(TARGETDIR)  &&  find . -iname "CVS" | xargs rm -rf
470        cd $(TARGETDIR)  &&  find . -iname ".svn" | xargs rm -rf
471#       cp viarhine/pci-scan.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/pci-scan.o
472#       cp -f test/* $(TARGETDIR)/lib/modules/2.4.33-pre1/kernel/drivers/net
473       
474#       mknod $(TARGETDIR)/dev/cfa b 13 0
475#       mknod $(TARGETDIR)/dev/cfa1 b 13 1
476#       mknod $(TARGETDIR)/dev/cfa2 b 13 2
477#       mknod $(TARGETDIR)/dev/cfa3 b 13 3
478#       mknod $(TARGETDIR)/dev/cfa4 b 13 4
479#       umount $(TARGETDIR)
480        find $(TARGETDIR)/lib/modules -name *.ko -exec mips-linux-strip --strip-unneeded --remove-section=.comment {} +         
481        #e2fsck -y -f $(ARCH)-uclibc/root.fs
482        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
483        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
484        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel
485        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net
486        #e2fsck -y -f $(ARCH)-uclibc/root.fs
487        ./busybox/examples/depmod.pl -F $(LINUXDIR)/System.map -b $(ARCH)-uclibc/target/lib/modules
488       
489        #cd $(TARGETDIR)
490#       tar --directory=$(TARGETDIR) --remove-files -cvvjf $(TARGETDIR)/etc/local.tar.bz2 usr/local
491        rm -rf $(TARGETDIR)/usr/local
492        mkdir $(TARGETDIR)/usr/local
493        export STRIP_KMOD="$(LINUXDIR)/scripts/strip-kmod.sh" && \
494        export STRIP="sstrip" && \
495        $(LINUXDIR)/scripts/rstrip.sh $(TARGETDIR)
496        @true
497        $(TOP)/../../tools/removewhitespace.sh $(TOP)/../../tools $(TARGETDIR)/etc/config
498        $(LINUXDIR)/scripts/squashfs/mksquashfs4 $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -comp xz -nopad  -root-owned -noappend
499#       $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -noappend -be
500        mkfs.jffs2 --pad --big-endian --squash -e 0x10000 -o $(ARCH)-uclibc/dd-wrt.jffs2 -d $(ARCH)-uclibc/target
501       
502        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
503        cat $(ARCH)-uclibc/root.fs >> $(ARCH)-uclibc/aligned.uimage
504        ./tools/trx_n -m 30000000 -a 1 -o mips-uclibc/danube-webflash.bin mips-uclibc/aligned.uimage
505
506ifeq ($(CONFIG_WMBR_G300NH),y)
507ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
508        tools/bufenc/encryptRC4 WBMR-HP-G300H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wmbr-firmware.enc
509        tools/bufenc/mkfw-lan -hw_ver=2 -hcrypt="Buffalo" "WBMR-HP-G300H" "WBMR-HP-G300H" "1.74" "3.02" "US-EU-AP-KR-CH-TW-DE-JP" "mlang8" "lan" "" 80002000 80002000 1 $(ARCH)-uclibc/wmbr-firmware.enc $(ARCH)-uclibc/wmbr-firmware_MULTI.enc
510ifeq ($(CONFIG_BUFFALO),y)
511        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wmbr-firmware_MULTI.enc
512endif
513else
514ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
515#eu-us region
516        tools/bufenc/encryptRC4 WBMR-HP-G300H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wmbr-firmware.enc
517        tools/bufenc/mkfw-lan -hw_ver=2 -hcrypt="Buffalo" "WBMR-HP-G300H" "WBMR-HP-G300H" "1.74" "3.02" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "lan" "" 80002000 80002000 1 $(ARCH)-uclibc/wmbr-firmware.enc $(ARCH)-uclibc/wmbr-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
518else
519        tools/bufenc/encryptRC4 WBMR-HP-G300H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wmbr-firmware.enc
520        tools/bufenc/mkfw-lan -hw_ver=2 -hcrypt="Buffalo" "WBMR-HP-G300H" "WBMR-HP-G300H" "1.74" "3.02" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "lan" "" 80002000 80002000 1 $(ARCH)-uclibc/wmbr-firmware.enc $(ARCH)-uclibc/wmbr-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
521endif
522endif
523endif
524
525#       cp $(ARCH)-uclibc/aligned.uimage /GruppenLW/releases
526
527include rules/all.mk
528
529.PHONY: all clean distclean mrproper install package
530.PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
531.PHONY: dummy fixkc libnet libpcap
532
533
534
Note: See TracBrowser for help on using the repository browser.