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
),)
33 @echo
"$(TOMATO_PROFILE_NAME) Profile"
34 @btools
/uversion.pl
--gen
38 @
$(MAKE
) -C router
all
39 @
$(MAKE
) -C router
install
44 ifeq ($(wildcard include/bcm20xx.h
),)
45 @btools
/fpkg
-i linux
/linux
/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-i router
/mipsel-uclibc
/target.image \
47 -l W54G
,image
/WRT54G_WRT54GL.bin \
48 -l W54S
,image
/WRT54GS.bin \
49 -l W54s
,image
/WRT54GSv4.bin \
50 -l W54U
,image
/WRTSL54GS.bin \
51 -m
0x10577050,image
/WR850G.bin \
54 @btools
/fpkg
-i linux
/linux
/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-i router
/mipsel-uclibc
/target.image \
55 -t image
/tomato-ND.trx
60 @echo
"-----------------"
61 @echo
`cat router/shared/tomato_version` " ready"
62 @echo
"-----------------"
64 ifneq ($(NOVERSION
),1)
65 @cp router
/shared
/tomato_version router
/shared
/tomato_version_last
66 @btools
/uversion.pl
--bump
78 @
$(MAKE
) -C linux
/linux
/scripts
/squashfs
clean
79 @
$(MAKE
) -C btools
clean
83 mv .config save-config
&& \
85 mv save-config .config
87 distclean: clean cleankernel cleantools cleanlibc
88 ifneq ($(INSIDE_MAK
),1)
89 @
$(MAKE
) -C router
$@ INSIDE_MAK
=1
91 @
rm -f router
/config_current
92 @
rm -f router
/.config.cmd router
/.config.old
93 @
rm -f router
/libfoo_xref.txt
94 @
rm -f tomato_profile.mak router
/shared
/tomato_profile.h
97 $(MAKE
) -C linux
/linux oldconfig dep
101 @echo
"$(TOMATO_PROFILE_NAME) Profile\n"
107 @
$(MAKE
) setprofile U
=G L
=g N
=G
110 @echo
"#ifndef TOMATO_PROFILE" > router
/shared
/tomato_profile.h
111 @echo
"#define TOMATO_$(U) 1" >> router
/shared
/tomato_profile.h
112 @echo
"#define PROFILE_G 1" >> router
/shared
/tomato_profile.h
113 @echo
"#define PROFILE_N 2" >> router
/shared
/tomato_profile.h
114 @echo
"#define TOMATO_PROFILE PROFILE_$(U)" >> router
/shared
/tomato_profile.h
115 @echo
"#define TOMATO_PROFILE_NAME \"$(N)\"" >> router
/shared
/tomato_profile.h
116 @echo
"#endif" >> router
/shared
/tomato_profile.h
118 @echo
"TOMATO_$(U) = 1" > tomato_profile.mak
119 @echo
"PROFILE_G = 1" >> tomato_profile.mak
120 @echo
"PROFILE_N = 2" >> tomato_profile.mak
121 @echo
"TOMATO_PROFILE = \$$(PROFILE_$(U))" >> tomato_profile.mak
122 @echo
"TOMATO_PROFILE_NAME = \"$(N)\"" >> tomato_profile.mak
123 @echo
"TOMATO_PROFILE_L = $(L)" >> tomato_profile.mak
124 @echo
"TOMATO_PROFILE_U = $(U)" >> tomato_profile.mak
127 [ -s .config
] && cat .config
> config_current
; \
128 rm -f config_current
&& \
129 ln
-s config_
$(L
) config_current
&& \
130 cp config_
$(L
) .config
131 @
$(MAKE
) -C router oldconfig
134 @echo
"Using $(N) profile."
139 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
clean
142 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
143 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
install
146 @
( echo
-e foo | grep
"\-e foo" ) && echo bar || echo foo
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