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 build_version` " ready"
62 @echo
"-----------------"
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 @
rm -f router
/config_current
87 @
rm -f router
/.config.cmd router
/.config.old
88 @
rm -f router
/libfoo_xref.txt
89 @
rm -f tomato_profile.mak router
/shared
/tomato_profile.h
92 $(MAKE
) -C linux
/linux oldconfig dep
96 @echo
"$(TOMATO_PROFILE_NAME) Profile"
103 @
$(MAKE
) setprofile U
=G L
=g N
=G
106 echo
'#ifndef TOMATO_PROFILE' > router
/shared
/tomato_profile.h
107 echo
'#define TOMATO_$(U) 1' >> router
/shared
/tomato_profile.h
108 echo
'#define PROFILE_G 1' >> router
/shared
/tomato_profile.h
109 echo
'#define TOMATO_PROFILE PROFILE_$(U)' >> router
/shared
/tomato_profile.h
110 echo
'#define TOMATO_PROFILE_NAME "$(N)"' >> router
/shared
/tomato_profile.h
111 echo
'#endif' >> router
/shared
/tomato_profile.h
113 echo
'TOMATO_$(U) = 1' > tomato_profile.mak
114 echo
'PROFILE_G = 1' >> tomato_profile.mak
115 echo
'TOMATO_PROFILE = $$(PROFILE_$(U))' >> tomato_profile.mak
116 echo
'TOMATO_PROFILE_NAME = "$(N)"' >> tomato_profile.mak
117 echo
'TOMATO_PROFILE_L = $(L)' >> tomato_profile.mak
118 echo
'TOMATO_PROFILE_U = $(U)' >> tomato_profile.mak
121 [ -s .config
] && cat .config
> config_current
; \
122 rm -f config_current
&& \
123 ln
-s config_
$(L
) config_current
&& \
124 cp config_
$(L
) .config
125 @
$(MAKE
) -C router oldconfig
128 @echo
"Using $(N) profile."
133 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
clean
136 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
137 @
$(MAKE
) -C ..
/..
/tools-src
/uClibc
install
140 @echo
"g use G profile"
141 @echo
"clean -C router clean"
142 @echo
"cleanimage rm -rf image"
143 @echo
"cleantools clean btools, mksquashfs"
144 @echo
"cleankernel -C linux/linux distclean (but preserves .config)"
145 @echo
"prepk -C linux/linux oldconfig dep"
146 @echo
"libc -C uClibc clean, all, install"
148 .PHONY
: all clean distclean cleanimage cleantools cleankernel prepk what setprofile libc help