2 # Toplevel Makefile for the BCM947xx Linux Router release
4 # Copyright 2005, Broadcom Corporation
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.
12 # $Id: Makefile,v 1.53 2005/04/25 03:54:37 tallest Exp $
15 SRCBASE
:= $(shell pwd
)
16 RELEASEDIR
:= $(shell (cd
$(SRCBASE
)/..
&& pwd
-P
))
17 PATH
:= $(RELEASEDIR
)/tools
:$(PATH
)
19 -include tomato_profile.mak
21 ifeq ($(TOMATO_PROFILE
),)
31 @echo
-e
"\n\n$(TOMATO_PROFILE_NAME) Profile"
32 @btools
/uversion.pl
--gen
35 @
$(MAKE
) -C router
all
36 @
$(MAKE
) -C router
install
41 ifeq ($(wildcard include/bcm20xx.h
),)
42 @btools
/fpkg
-i linux
/linux
/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-i router
/mipsel-uclibc
/target.image \
44 -l W54G
,image
/WRT54G_WRT54GL.bin \
45 -l W54S
,image
/WRT54GS.bin \
46 -l W54s
,image
/WRT54GSv4.bin \
47 -l W54U
,image
/WRTSL54GS.bin \
48 -m
0x10577050,image
/WR850G.bin \
51 @btools
/fpkg
-i linux
/linux
/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-i router
/mipsel-uclibc
/target.image \
52 -t image
/tomato-ND.trx
53 # -l WR41,image/WRH54G.bin
57 @echo
-e
"\n-----------------\n" `cat router/shared/tomato_version` " ready\n-----------------"
59 ifneq ($(NOVERSION
),1)
60 @cp router
/shared
/tomato_version router
/shared
/tomato_version_last
61 @btools
/uversion.pl
--bump
73 @
$(MAKE
) -C linux
/linux
/scripts
/squashfs
clean
74 @
$(MAKE
) -C btools
clean
78 mv .config save-config
&& \
80 mv save-config .config
82 distclean: clean cleankernel cleantools cleanlibc
83 ifneq ($(INSIDE_MAK
),1)
84 @
$(MAKE
) -C router
$@ INSIDE_MAK
=1
86 @
$(MAKE
) -C router
/busybox
distclean
87 @
rm -f router
/busybox
/config_current
88 @
rm -f router
/config_current
89 @
rm -f router
/.config.cmd router
/.config.old
90 @
rm -f router
/libfoo_xref.txt
91 @
rm -f tomato_profile.mak router
/shared
/tomato_profile.h
94 $(MAKE
) -C linux
/linux oldconfig dep
97 @echo
-e
"\n$(TOMATO_PROFILE_NAME) Profile\n"
103 @
$(MAKE
) setprofile U
=G L
=g N
=G
107 #ifndef TOMATO_PROFILE\n\
108 #define TOMATO_$(U) 1\n\
109 #define PROFILE_G 1\n\
110 #define PROFILE_N 2\n\
111 #define TOMATO_PROFILE PROFILE_$(U)\n\
112 #define TOMATO_PROFILE_NAME \"$(N)\"\n\
113 #endif\n" > router
/shared
/tomato_profile.h
119 TOMATO_PROFILE = \$$(PROFILE_$(U))\n\
120 TOMATO_PROFILE_NAME = \"$(N)\"\n\
121 TOMATO_PROFILE_L = $(L)\n\
122 TOMATO_PROFILE_U = $(U)\n" > tomato_profile.mak
125 [ -s .config
] && cat .config
> config_current
; \
126 rm -f config_current
&& \
127 ln
-s config_
$(L
) config_current
&& \
128 cp config_
$(L
) .config
129 @
$(MAKE
) -C router oldconfig
131 @cd router
/busybox
&& \
132 [ -s .config
] && cat .config
> config_current
; \
133 rm -f config_current
&& \
134 ln
-s config_
$(L
) config_current
&& \
135 cp config_
$(L
) .config
136 @
$(MAKE
) -C router
/busybox oldconfig
138 @echo
-e
"\nUsing $(N) profile.\n"
142 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
clean
145 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
146 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
install
149 @echo
"g use G profile"
150 @echo
"clean -C router clean"
151 @echo
"cleanimage rm -rf image"
152 @echo
"cleantools clean btools, mksquashfs"
153 @echo
"cleankernel -C linux/linux distclean (but preserves .config)"
154 @echo
"prepk -C linux/linux oldconfig dep"
155 @echo
"libc -C uClibc clean, all, install"
157 .PHONY
: all clean distclean cleanimage cleantools cleankernel prepk what setprofile libc help