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 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17 # To rebuild everything and all configurations:
19 # make libc (usually doesn't need to be done ???)
20 # make V1=whatever V2=sub-whatever VPN=vpn3.6 a b c d m
21 # The 1st "whatever" would be the build number, the sub-whatever would
22 # be the update to the version.
25 # make V1=8516 V2="-jffs.1" a b c d m s
27 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31 export SRCBASE
:= $(shell pwd
)
32 RELEASEDIR
:= $(shell (cd
$(SRCBASE
)/..
&& pwd
-P
))
33 PATH
:= $(RELEASEDIR
)/tools
:$(PATH
)
38 # Normally you'd do something like "make V1=8516 V2=-sub-ver a b c d"
39 # But if you don't give anything for "V1", it'll get a default from tomato_version.
42 ifeq ($(CONFIG_LINUX26
),y
)
52 -include tomato_profile.mak
54 # This could be simpler by just using $(TOMATO_PROFILE_NAME) like it used to be,
55 # but that's fragile. If you make one certain innocuous change elsewhere in the
56 # makefile(s), the build will silently be wrong. This way it works properly every time.
57 current_BUILD_NAME
= $(strip $(shell grep
"^TOMATO_BUILD_NAME" tomato_profile.mak | cut
-d
"=" -f2
))
58 current_BUILD_DESC
= $(strip $(shell grep
"^TOMATO_BUILD_DESC" tomato_profile.mak | cut
-d
"=" -f2 | sed
-e
"s/ //g"))
59 current_BUILD_USB
= $(strip $(shell grep
"^TOMATO_BUILD_USB" tomato_profile.mak | cut
-d
"=" -f2 | sed
-e
"s/ //g"))
60 current_TOMATO_VER
= $(strip $(shell grep
"TOMATO_MAJOR" router
/shared
/tomato_version.h | cut
-d
"\"" -f2
)).
$(strip $(shell grep
"TOMATO_MINOR" router
/shared
/tomato_version.h | cut
-d
"\"" -f2
))
62 uppercase_N
= $(shell echo
$(N
) | tr a-z A-Z
)
63 lowercase_N
= $(shell echo
$(N
) | tr A-Z a-z
)
64 uppercase_B
= $(shell echo
$(B
) | tr a-z A-Z
)
65 lowercase_B
= $(shell echo
$(B
) | tr A-Z a-z
)
67 ifeq ($(CONFIG_LINUX26
),y
)
68 mips_rev
= $(if
$(filter $(MIPS32
),r2
),MIPSR2
,MIPSR1
)
75 @btools
/uversion.pl
--gen
$(V1
) $(mips_rev
)$(V2
) $(ND
) $(current_BUILD_USB
) $(current_BUILD_DESC
)
77 ifeq ($(TOMATO_BUILD
),)
87 @echo
"Building Tomato $(ND) $(current_BUILD_USB) $(current_TOMATO_VER).$(V1)$(mips_rev)$(V2) $(current_BUILD_DESC) $(current_BUILD_NAME) with $(TOMATO_PROFILE_NAME) Profile"
93 @
$(MAKE
) -C router
all
94 @
$(MAKE
) -C router
install
97 @
rm -f image
/tomato-
$(ND
)$(current_BUILD_USB
)-$(current_TOMATO_VER
).
$(V1
)$(mips_rev
)$(V2
)-$(current_BUILD_DESC
).trx
99 @echo
"***********************" `date` "************************" >>fpkg.log
100 @cat router
/shared
/tomato_version
>>fpkg.log
102 @cat router
/target.
info >>fpkg.log
103 ifeq ($(wildcard include/bcm20xx.h
),)
104 @btools
/fpkg
-i lzma-loader
/loader.gz
-i
$(LINUXDIR
)/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-a
1024 -i router
/mipsel-uclibc
/target.image \
105 -t image
/tomato.trx \
106 -l W54G
,image
/WRT54G_WRT54GL.bin \
107 -l W54S
,image
/WRT54GS.bin \
108 -l W54s
,image
/WRT54GSv4.bin \
109 -l W54U
,image
/WRTSL54GS.bin \
110 -m
0x10577050,image
/WR850G.bin \
113 @btools
/fpkg
-i lzma-loader
/loader.gz
-i
$(LINUXDIR
)/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-a
1024 -i router
/mipsel-uclibc
/target.image \
114 -t image
/tomato-
$(ND
)$(current_BUILD_USB
)-$(current_TOMATO_VER
).
$(V1
)$(mips_rev
)$(V2
)-$(current_BUILD_DESC
).trx | tee
-a fpkg.log
117 @cp fpkg.log image
/fpkg-
$(V1
)$(mips_rev
)$(V2
).log
119 @echo
"-----------------"
120 @echo
`cat router/shared/tomato_version` " ready"
121 @echo
"-----------------"
122 ifneq ($(NOVERSION
),1)
123 @cp router
/shared
/tomato_version router
/shared
/tomato_version_last
124 @btools
/uversion.pl
--bump
131 @touch router
/.config
132 @
rm -f router
/config_
[a-z
]
133 @
rm -f router
/busybox
/config_
[a-z
]
134 @
$(MAKE
) -C router
$@
135 @
-rmdir router
/mipsel-uclibc
140 @
rm -f router
/.config
141 @touch router
/.config
145 @
$(MAKE
) -C
$(LINUXDIR
)/scripts
/squashfs
clean
146 @
$(MAKE
) -C btools
clean
150 mv .config save-config
&& \
151 $(MAKE
) distclean || true
; \
152 cp
-p save-config .config || true
154 distclean: clean cleanimage cleankernel cleantools cleanlibc
155 ifneq ($(INSIDE_MAK
),1)
156 @
$(MAKE
) -C router
$@ INSIDE_MAK
=1
158 mv router
/busybox
/.config busybox-saved-config || true
159 @
$(MAKE
) -C router
/busybox
distclean
160 @
rm -f router
/busybox
/config_current
161 @cp
-p busybox-saved-config router
/busybox
/.config || true
162 @cp
-p router
/busybox
/.config router
/busybox
/config_current || true
163 @
rm -f router
/config_current
164 @
rm -f router
/.config.cmd router
/.config.old router
/.config
165 @
rm -f router
/libfoo_xref.txt
166 @
rm -f tomato_profile.mak router
/shared
/tomato_profile.h
167 @touch tomato_profile.mak
168 @touch router
/shared
/tomato_profile.h
173 rm -f config_current
; \
174 ln
-s config_base config_current
; \
175 cp
-f config_current .config
176 $(MAKE
) -C
$(LINUXDIR
) oldconfig dep
180 @echo
"$(current_BUILD_DESC)-$(current_BUILD_NAME)-$(TOMATO_PROFILE_NAME) Profile"
184 # The methodology for making the different builds is to
185 # copy the "base" config file to the "target" config file in
186 # the appropriate directory, and then edit it by removing and
187 # inserting the desired configuration lines.
188 # You can't just delete the "whatever=y" line, you must have
189 # a "...is not set" line, or the make oldconfig will stop and ask
192 # Options for "make bin" :
193 # BUILD_DESC (Std|Lite|Ext|...)
197 # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_LIBOPT
198 # SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM
202 if
[ "$(CONFIG_LINUX26)" = "y" ] ||
[ "$(SAMBA3)" = "y" ]; then \
203 sed
-i
"/TCONFIG_SAMBA3/d" $(1); \
204 echo
"TCONFIG_SAMBA3=y" >>$(1); \
206 sed
-i
"/TCONFIG_JFFSV1/d" $(1); \
207 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
208 if
[ "$(JFFSv1)" = "y" ]; then \
209 echo
"TCONFIG_JFFSV1=y" >>$(1); \
211 echo
"# TCONFIG_JFFSV1 is not set" >>$(1); \
214 echo
"TCONFIG_JFFSV1=y" >>$(1); \
216 if
[ "$(USB)" = "USB" ]; then \
217 sed
-i
"/TCONFIG_USB is not set/d" $(1); \
218 echo
"TCONFIG_USB=y" >>$(1); \
219 if
[ "$(USBEXTRAS)" = "y" ]; then \
220 sed
-i
"/TCONFIG_USB_EXTRAS/d" $(1); \
221 echo
"TCONFIG_USB_EXTRAS=y" >>$(1); \
223 if
[ "$(NTFS)" = "y" ]; then \
224 sed
-i
"/TCONFIG_NTFS/d" $(1); \
225 echo
"TCONFIG_NTFS=y" >>$(1); \
227 if
[ "$(MEDIASRV)" = "y" ]; then \
228 sed
-i
"/TCONFIG_MEDIA_SERVER/d" $(1); \
229 echo
"TCONFIG_MEDIA_SERVER=y" >>$(1); \
232 sed
-i
"/TCONFIG_USB=y/d" $(1); \
233 echo
"# TCONFIG_USB is not set" >>$(1); \
235 if
[ "$(NO_SAMBA)" = "y" ]; then \
236 sed
-i
"/TCONFIG_SAMBASRV/d" $(1); \
237 echo
"# TCONFIG_SAMBASRV is not set" >>$(1); \
239 if
[ "$(NO_ZEBRA)" = "y" ]; then \
240 sed
-i
"/TCONFIG_ZEBRA/d" $(1); \
241 echo
"# TCONFIG_ZEBRA is not set" >>$(1); \
243 if
[ "$(NO_JFFS)" = "y" ]; then \
244 sed
-i
"/TCONFIG_JFFS2/d" $(1); \
245 echo
"# TCONFIG_JFFS2 is not set" >>$(1); \
246 sed
-i
"/TCONFIG_JFFSV1/d" $(1); \
247 echo
"# TCONFIG_JFFSV1 is not set" >>$(1); \
249 if
[ "$(NO_CIFS)" = "y" ]; then \
250 sed
-i
"/TCONFIG_CIFS/d" $(1); \
251 echo
"# TCONFIG_CIFS is not set" >>$(1); \
253 if
[ "$(NO_SSH)" = "y" ]; then \
254 sed
-i
"/TCONFIG_SSH/d" $(1); \
255 echo
"# TCONFIG_SSH is not set" >>$(1); \
257 if
[ "$(NO_LIBOPT)" = "y" ]; then \
258 sed
-i
"/TCONFIG_OPTIMIZE_SHARED_LIBS/d" $(1); \
259 echo
"# TCONFIG_OPTIMIZE_SHARED_LIBS is not set" >>$(1); \
261 if
[ "$(EBTABLES)" = "y" ]; then \
262 sed
-i
"/TCONFIG_EBTABLES/d" $(1); \
263 echo
"TCONFIG_EBTABLES=y" >>$(1); \
265 if
[ "$(IPV6SUPP)" = "y" ]; then \
266 sed
-i
"/TCONFIG_IPV6/d" $(1); \
267 echo
"TCONFIG_IPV6=y" >>$(1); \
269 if
[ "$(OPENVPN)" = "y" ]; then \
270 sed
-i
"/TCONFIG_LZO/d" $(1); \
271 echo
"TCONFIG_LZO=y" >>$(1); \
272 sed
-i
"/TCONFIG_OPENVPN/d" $(1); \
273 echo
"TCONFIG_OPENVPN=y" >>$(1); \
278 define BusyboxOptions
280 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
281 sed
-i
"/CONFIG_FEATURE_2_4_MODULES/d" $(1); \
282 echo
"# CONFIG_FEATURE_2_4_MODULES is not set" >>$(1); \
283 sed
-i
"/CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT/d" $(1); \
284 echo
"CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y" >>$(1); \
285 sed
-i
"/CONFIG_FEATURE_DEVFS/d" $(1); \
286 echo
"# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
287 sed
-i
"/CONFIG_MKNOD/d" $(1); \
288 echo
"CONFIG_MKNOD=y" >>$(1); \
290 if
[ "$(NO_CIFS)" = "y" ]; then \
291 sed
-i
"/CONFIG_FEATURE_MOUNT_CIFS/d" $(1); \
292 echo
"# CONFIG_FEATURE_MOUNT_CIFS is not set" >>$(1); \
294 if
[ "$(BBEXTRAS)" = "y" ]; then \
295 sed
-i
"/CONFIG_SENDMAIL/d" $(1); \
296 echo
"CONFIG_SENDMAIL=y" >>$(1); \
297 sed
-i
"/CONFIG_FEATURE_SORT_BIG/d" $(1); \
298 echo
"CONFIG_FEATURE_SORT_BIG=y" >>$(1); \
299 sed
-i
"/CONFIG_FTPPUT/d" $(1); \
300 echo
"CONFIG_FTPPUT=y" >>$(1); \
301 sed
-i
"/CONFIG_CLEAR/d" $(1); \
302 echo
"CONFIG_CLEAR=y" >>$(1); \
303 sed
-i
"/CONFIG_SETCONSOLE/d" $(1); \
304 echo
"CONFIG_SETCONSOLE=y" >>$(1); \
305 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
306 sed
-i
"/CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE/d" $(1); \
307 echo
"CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=512" >>$(1); \
310 if
[ "$(USB)" = "USB" ]; then \
311 if
[ "$(USBEXTRAS)" = "y" ]; then \
312 sed
-i
"/CONFIG_E2FSCK/d" $(1); \
313 echo
"CONFIG_E2FSCK=y" >>$(1); \
314 sed
-i
"/CONFIG_MKE2FS/d" $(1); \
315 echo
"CONFIG_MKE2FS=y" >>$(1); \
316 sed
-i
"/CONFIG_FDISK/d" $(1); \
317 echo
"CONFIG_FDISK=y" >>$(1); \
318 sed
-i
"/CONFIG_FEATURE_FDISK_WRITABLE/d" $(1); \
319 echo
"CONFIG_FEATURE_FDISK_WRITABLE=y" >>$(1); \
320 sed
-i
"/CONFIG_MKFS_VFAT/d" $(1); \
321 echo
"CONFIG_MKFS_VFAT=y" >>$(1); \
322 sed
-i
"/CONFIG_MKSWAP/d" $(1); \
323 echo
"CONFIG_MKSWAP=y" >>$(1); \
324 sed
-i
"/CONFIG_FLOCK/d" $(1); \
325 echo
"CONFIG_FLOCK=y" >>$(1); \
326 sed
-i
"/CONFIG_FSYNC/d" $(1); \
327 echo
"CONFIG_FSYNC=y" >>$(1); \
328 sed
-i
"/CONFIG_UNZIP/d" $(1); \
329 echo
"CONFIG_UNZIP=y" >>$(1); \
330 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
331 sed
-i
"/CONFIG_LSUSB/d" $(1); \
332 echo
"CONFIG_LSUSB=y" >>$(1); \
333 sed
-i
"/CONFIG_FEATURE_WGET_STATUSBAR/d" $(1); \
334 echo
"CONFIG_FEATURE_WGET_STATUSBAR=y" >>$(1); \
335 sed
-i
"/CONFIG_FEATURE_VERBOSE_USAGE/d" $(1); \
336 echo
"CONFIG_FEATURE_VERBOSE_USAGE=y" >>$(1); \
340 sed
-i
"/CONFIG_FEATURE_MOUNT_LOOP/d" $(1); \
341 echo
"# CONFIG_FEATURE_MOUNT_LOOP is not set" >>$(1); \
342 sed
-i
"/CONFIG_FEATURE_DEVFS/d" $(1); \
343 echo
"# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
344 sed
-i
"/CONFIG_FEATURE_MOUNT_LABEL/d" $(1); \
345 echo
"# CONFIG_FEATURE_MOUNT_LABEL is not set" >>$(1); \
346 sed
-i
"/CONFIG_FEATURE_MOUNT_FSTAB/d" $(1); \
347 echo
"# CONFIG_FEATURE_MOUNT_FSTAB is not set" >>$(1); \
348 sed
-i
"/CONFIG_VOLUMEID/d" $(1); \
349 echo
"# CONFIG_VOLUMEID is not set" >>$(1); \
350 sed
-i
"/CONFIG_BLKID/d" $(1); \
351 echo
"# CONFIG_BLKID is not set" >>$(1); \
352 sed
-i
"/CONFIG_SWAPONOFF/d" $(1); \
353 echo
"# CONFIG_SWAPONOFF is not set" >>$(1); \
354 sed
-i
"/CONFIG_TRUE/d" $(1); \
355 echo
"# CONFIG_TRUE is not set" >>$(1); \
357 if
[ "$(IPV6SUPP)" = "y" ]; then \
358 sed
-i
"/CONFIG_FEATURE_IPV6/d" $(1); \
359 echo
"CONFIG_FEATURE_IPV6=y" >>$(1); \
360 sed
-i
"/CONFIG_PING6/d" $(1); \
361 echo
"CONFIG_PING6=y" >>$(1); \
362 sed
-i
"/CONFIG_TRACEROUTE6/d" $(1); \
363 echo
"CONFIG_TRACEROUTE6=y" >>$(1); \
365 if
[ "$(SLIM)" = "y" ]; then \
366 sed
-i
"/CONFIG_AWK/d" $(1); \
367 echo
"# CONFIG_AWK is not set" >>$(1); \
368 sed
-i
"/CONFIG_BASENAME/d" $(1); \
369 echo
"# CONFIG_BASENAME is not set" >>$(1); \
370 sed
-i
"/CONFIG_FEATURE_DEVFS/d" $(1); \
371 echo
"# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
372 sed
-i
"/CONFIG_BLKID/d" $(1); \
373 echo
"# CONFIG_BLKID is not set" >>$(1); \
374 sed
-i
"/CONFIG_TELNET=y/d" $(1); \
375 echo
"# CONFIG_TELNET is not set" >>$(1); \
376 sed
-i
"/CONFIG_ARPING/d" $(1); \
377 echo
"# CONFIG_ARPING is not set" >>$(1); \
378 sed
-i
"/CONFIG_FEATURE_LS_COLOR/d" $(1); \
379 echo
"# CONFIG_FEATURE_LS_COLOR is not set" >>$(1); \
381 sed
-i
"/CONFIG_FEATURE_LS_COLOR/d" $(1); \
382 echo
"CONFIG_FEATURE_LS_COLOR=y" >>$(1); \
383 sed
-i
"/CONFIG_FEATURE_LS_COLOR_IS_DEFAULT/d" $(1); \
384 echo
"CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y" >>$(1); \
391 sed
-i
"/CONFIG_NVRAM_SIZE/d" $(1); \
392 echo
"CONFIG_NVRAM_SIZE="$(NVRAM_SIZE
) >>$(1); \
393 if
[ "$(CONFIG_LINUX26)" = "y" ] && [ "$(MIPS32)" = "r2" ]; then \
394 sed
-i
"/CONFIG_CPU_MIPS32_R1/d" $(1); \
395 echo
"# CONFIG_CPU_MIPS32_R1 is not set" >>$(1); \
396 sed
-i
"/CONFIG_CPU_MIPS32_R2/d" $(1); \
397 echo
"CONFIG_CPU_MIPS32_R2=y" >>$(1); \
398 sed
-i
"/CONFIG_CPU_MIPSR1/d" $(1); \
399 echo
"CONFIG_CPU_MIPSR2=y" >>$(1); \
401 if
[ "$(USB)" = "" ]; then \
402 sed
-i
"/CONFIG_MSDOS_PARTITION/d" $(1); \
403 echo
"# CONFIG_MSDOS_PARTITION is not set" >>$(1); \
404 sed
-i
"/CONFIG_EFI_PARTITION/d" $(1); \
405 echo
"# CONFIG_EFI_PARTITION is not set" >>$(1); \
407 if
[ "$(IPV6SUPP)" = "y" ]; then \
408 sed
-i
"/CONFIG_IPV6 is not set/d" $(1); \
409 echo
"CONFIG_IPV6=y" >>$(1); \
410 sed
-i
"/CONFIG_IP6_NF_IPTABLES/d" $(1); \
411 echo
"CONFIG_IP6_NF_IPTABLES=y" >>$(1); \
412 sed
-i
"/CONFIG_IP6_NF_MATCH_RT/d" $(1); \
413 echo
"CONFIG_IP6_NF_MATCH_RT=y" >>$(1); \
414 sed
-i
"/CONFIG_IP6_NF_FILTER/d" $(1); \
415 echo
"CONFIG_IP6_NF_FILTER=m" >>$(1); \
416 sed
-i
"/CONFIG_IP6_NF_TARGET_LOG/d" $(1); \
417 echo
"CONFIG_IP6_NF_TARGET_LOG=m" >>$(1); \
418 sed
-i
"/CONFIG_IP6_NF_TARGET_REJECT/d" $(1); \
419 echo
"CONFIG_IP6_NF_TARGET_REJECT=m" >>$(1); \
420 sed
-i
"/CONFIG_IP6_NF_MANGLE/d" $(1); \
421 echo
"CONFIG_IP6_NF_MANGLE=m" >>$(1); \
422 sed
-i
"/CONFIG_IP6_NF_TARGET_IMQ/d" $(1); \
423 echo
"CONFIG_IP6_NF_TARGET_IMQ=m" >>$(1); \
424 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
425 sed
-i
"/CONFIG_NF_CONNTRACK_IPV6/d" $(1); \
426 echo
"CONFIG_NF_CONNTRACK_IPV6=m" >>$(1); \
427 sed
-i
"/CONFIG_NETFILTER_XT_MATCH_HL/d" $(1); \
428 echo
"CONFIG_NETFILTER_XT_MATCH_HL=m" >>$(1); \
429 sed
-i
"/CONFIG_IPV6_ROUTER_PREF/d" $(1); \
430 echo
"CONFIG_IPV6_ROUTER_PREF=y" >>$(1); \
431 sed
-i
"/CONFIG_IPV6_SIT/d" $(1); \
432 echo
"CONFIG_IPV6_SIT=m" >>$(1); \
433 sed
-i
"/CONFIG_IPV6_MULTIPLE_TABLES/d" $(1); \
434 echo
"CONFIG_IPV6_MULTIPLE_TABLES=y" >>$(1); \
435 sed
-i
"/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
436 echo
"CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
437 sed
-i
"/CONFIG_IPV6_MROUTE/d" $(1); \
438 echo
"CONFIG_IPV6_MROUTE=y" >>$(1); \
440 sed
-i
"/CONFIG_IP6_NF_CONNTRACK/d" $(1); \
441 echo
"CONFIG_IP6_NF_CONNTRACK=m" >>$(1); \
442 sed
-i
"/CONFIG_IP6_NF_MATCH_HL/d" $(1); \
443 echo
"CONFIG_IP6_NF_MATCH_HL=m" >>$(1); \
444 sed
-i
"/CONFIG_IP6_NF_FTP/d" $(1); \
445 echo
"CONFIG_IP6_NF_FTP=m" >>$(1); \
446 sed
-i
"/CONFIG_IP6_NF_MATCH_LIMIT/d" $(1); \
447 echo
"CONFIG_IP6_NF_MATCH_LIMIT=m" >>$(1); \
448 sed
-i
"/CONFIG_IP6_NF_MATCH_CONDITION/d" $(1); \
449 echo
"CONFIG_IP6_NF_MATCH_CONDITION=m" >>$(1); \
450 sed
-i
"/CONFIG_IP6_NF_MATCH_MAC/d" $(1); \
451 echo
"CONFIG_IP6_NF_MATCH_MAC=m" >>$(1); \
452 sed
-i
"/CONFIG_IP6_NF_MATCH_MULTIPORT/d" $(1); \
453 echo
"CONFIG_IP6_NF_MATCH_MULTIPORT=m" >>$(1); \
454 sed
-i
"/CONFIG_IP6_NF_MATCH_MARK/d" $(1); \
455 echo
"CONFIG_IP6_NF_MATCH_MARK=m" >>$(1); \
456 sed
-i
"/CONFIG_IP6_NF_MATCH_LENGTH/d" $(1); \
457 echo
"CONFIG_IP6_NF_MATCH_LENGTH=m" >>$(1); \
458 sed
-i
"/CONFIG_IP6_NF_MATCH_STATE/d" $(1); \
459 echo
"CONFIG_IP6_NF_MATCH_STATE=m" >>$(1); \
460 sed
-i
"/CONFIG_IP6_NF_TARGET_MARK/d" $(1); \
461 echo
"CONFIG_IP6_NF_TARGET_MARK=m" >>$(1); \
462 sed
-i
"/CONFIG_IP6_NF_TARGET_TCPMSS/d" $(1); \
463 echo
"CONFIG_IP6_NF_TARGET_TCPMSS=m" >>$(1); \
464 sed
-i
"/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
465 echo
"CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
468 sed
-i
"/CONFIG_BCM57XX/d" $(1); \
469 if
[ "$(BCM57)" = "y" ]; then \
470 echo
"CONFIG_BCM57XX=m" >>$(1); \
472 echo
"# CONFIG_BCM57XX is not set" >>$(1); \
474 if
[ "$(CONFIG_LINUX26)" = "y" ] && [ "$(EBTABLES)" = "y" ]; then \
475 sed
-i
"/CONFIG_BRIDGE_NF_EBTABLES/d" $(1); \
476 echo
"CONFIG_BRIDGE_NF_EBTABLES=m" >>$(1); \
484 @echo
$@
" is not a valid target!"
487 @cp router
/config_base router
/config_
$(lowercase_B
)
488 @cp router
/busybox
/config_base router
/busybox
/config_
$(lowercase_B
)
489 @cp
$(LINUXDIR
)/config_base
$(LINUXDIR
)/config_
$(lowercase_B
)
491 $(call RouterOptions
, router
/config_
$(lowercase_B
))
492 $(call KernelConfig
, $(LINUXDIR
)/config_
$(lowercase_B
))
493 $(call BusyboxOptions
, router
/busybox
/config_
$(lowercase_B
))
495 @
$(MAKE
) setprofile N
=$(TPROFILE
) B
=$(B
) DESC
="$(BUILD_DESC)" USB
="$(USB)"
498 ## Make the "normal" build
500 @
$(MAKE
) bin B
=A BUILD_DESC
="Std" USB
="USB"
502 ## Make the "normal but without SSH" build
504 @
$(MAKE
) bin NO_SSH
=y B
=B BUILD_DESC
="No SSH" USB
="USB"
506 ## Make the "normal but without CIFS" build
508 @
$(MAKE
) bin NO_CIFS
=y B
=C BUILD_DESC
="No CIFS" USB
="USB"
510 ## Make the "normal but without SAMBA" (Lite) build
512 ifeq ($(CONFIG_LINUX26
),y
)
513 @
$(MAKE
) bin NO_SAMBA
=y SLIM
=y NO_CIFS
=y NO_JFFS
=y NO_ZEBRA
=y B
=D BUILD_DESC
="Lite" USB
="USB"
515 @
$(MAKE
) bin NO_SAMBA
=y SLIM
=y B
=D BUILD_DESC
="Lite" USB
="USB"
518 ## Make the "normal (with NTFS support) + VPN" build
520 ifeq ($(CONFIG_LINUX26
),y
)
521 @
$(MAKE
) bin OPENVPN
=y NTFS
=y BBEXTRAS
=y USBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y MEDIASRV
=y IPV6SUPP
=y B
=E BUILD_DESC
="$(VPN)" USB
="USB"
523 @
$(MAKE
) bin OPENVPN
=y NTFS
=y B
=E BUILD_DESC
="$(VPN)" USB
="USB"
526 ## Make the "normal with Extras and NTFS" build
528 ifeq ($(CONFIG_LINUX26
),y
)
529 @
$(MAKE
) bin NTFS
=y BBEXTRAS
=y USBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y MEDIASRV
=y IPV6SUPP
=y B
=M BUILD_DESC
="Ext" USB
="USB"
531 @
$(MAKE
) bin NTFS
=y BBEXTRAS
=y USBEXTRAS
=y B
=M BUILD_DESC
="Ext" USB
="USB"
534 ## Make the "No USB" build
536 ifeq ($(CONFIG_LINUX26
),y
)
537 @
$(MAKE
) bin JFFSv1
=y
$(if
$(filter r2
, $(MIPS32
)),,BCM57
=y
) B
=S BUILD_DESC
="Std" USB
=""
539 @
$(MAKE
) bin BBEXTRAS
=y BCM57
=y B
=S BUILD_DESC
="Std" USB
=""
542 ## Make the "Mini: no USB, no CIFS, no JFFS" build
544 @
$(MAKE
) bin NO_JFFS
=y NO_CIFS
=y SLIM
=y B
=F BUILD_DESC
="Mini" USB
=""
546 ## Make the "VPN witn no USB support" build
548 ifeq ($(CONFIG_LINUX26
),y
)
549 @
$(MAKE
) bin OPENVPN
=y NO_JFFS
=y B
=V BUILD_DESC
="$(VPN)" USB
=""
551 @
$(MAKE
) bin OPENVPN
=y BBEXTRAS
=y BCM57
=y B
=V BUILD_DESC
="$(VPN)" USB
=""
554 ## Make Mips32r2 builds
574 echo
'#ifndef TOMATO_PROFILE' > router
/shared
/tomato_profile.h
575 echo
'#define TOMATO_$(N) 1' >> router
/shared
/tomato_profile.h
576 echo
'#define PROFILE_G 1' >> router
/shared
/tomato_profile.h
577 echo
'#define PROFILE_N 2' >> router
/shared
/tomato_profile.h
578 echo
'#define TOMATO_PROFILE PROFILE_$(N)' >> router
/shared
/tomato_profile.h
579 echo
'#define TOMATO_PROFILE_NAME "$(N)"' >> router
/shared
/tomato_profile.h
580 echo
'#define TOMATO_BUILD_NAME "$(B)"' >> router
/shared
/tomato_profile.h
581 echo
'#define TOMATO_BUILD_DESC "$(DESC)"' >> router
/shared
/tomato_profile.h
582 echo
'#define CONFIG_NVRAM_SIZE $(NVRAM_SIZE)' >> router
/shared
/tomato_profile.h
583 echo
'#endif' >> router
/shared
/tomato_profile.h
585 echo
'TOMATO_$(N) = 1' > tomato_profile.mak
586 echo
'PROFILE_G = 1' >> tomato_profile.mak
587 echo
'PROFILE_N = 2' >> tomato_profile.mak
588 echo
'TOMATO_PROFILE = $$(PROFILE_$(N))' >> tomato_profile.mak
589 echo
'TOMATO_PROFILE_NAME = "$(N)"' >> tomato_profile.mak
590 echo
'TOMATO_BUILD = "$(B)"' >> tomato_profile.mak
591 echo
'TOMATO_BUILD_NAME = "$(B)"' >> tomato_profile.mak
592 echo
'TOMATO_BUILD_DESC = "$(DESC)"' >> tomato_profile.mak
593 echo
'TOMATO_PROFILE_L = $(lowercase_N)' >> tomato_profile.mak
594 echo
'TOMATO_PROFILE_U = $(uppercase_N)' >> tomato_profile.mak
595 echo
'TOMATO_BUILD_USB = "$(USB)"' >> tomato_profile.mak
597 echo
'export EXTRACFLAGS := $(EXTRA_CFLAGS) -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32 -DCONFIG_NVRAM_SIZE=$(NVRAM_SIZE)' >> tomato_profile.mak
600 # Note that changes to variables in tomato_profile.mak don't
601 # get propogated to this invocation of make!
603 @echo
"Using $(N) profile, $(B) build config."
607 rm -f config_current
; \
608 ln
-s config_
$(lowercase_B
) config_current
; \
609 cp
-f config_current .config
611 @cd router
/busybox
&& \
612 rm -f config_current
; \
613 ln
-s config_
$(lowercase_B
) config_current
; \
614 cp config_current .config
617 rm -f config_current
; \
618 ln
-s config_
$(lowercase_B
) config_current
; \
619 cp config_current .config
621 @
$(MAKE
) -C router oldconfig
624 # @$(MAKE) -C ../../tools-src/uClibc clean
627 # @$(MAKE) -C ../../tools-src/uClibc
628 # @$(MAKE) -C ../../tools-src/uClibc install
631 @echo
"a A build (standard)"
632 @echo
"b B build (standard minus SSH)"
633 @echo
"c C build (standard minus CIFS)"
634 @echo
"d D build (standard minus Samba server)"
635 @echo
"m M build (standard plus extra utilities and NTFS support)"
636 ifeq ($(CONFIG_LINUX26
),y
)
637 @echo
"e E build (standard plus VPN, extra utilities and NTFS support)"
639 @echo
"e E build (standard plus VPN and NTFS support)"
641 @echo
"s S build (no USB support)"
642 @echo
"f F build (no USB support minus JFFS and CIFS)"
643 @echo
"v V build (VPN with no USB support)"
644 ifeq ($(CONFIG_LINUX26
),y
)
645 @echo
"r2m MIPS Release 2 M build (standard plus extras)"
646 @echo
"r2e MIPS Release 2 E build (standard plus VPN and extras)"
647 @echo
"r2v MIPS Release 2 V build (VPN with no USB support)"
648 @echo
"r2s MIPS Release 2 S build (no USB support)"
649 @echo
"r2f MIPS Release 2 F build (no USB support minus JFFS and CIFS)"
651 @echo
"..etc.. other build configs"
652 @echo
"clean -C router clean"
653 @echo
"cleanimage rm -rf image"
654 @echo
"cleantools clean btools, mksquashfs"
655 @echo
"cleankernel -C Linux distclean (but preserves .config)"
656 @echo
"distclean distclean of Linux & busybox (but preserve .configs)"
657 @echo
"prepk -C Linux oldconfig dep"
658 @echo
"libc -C uClibc clean, all, install"
660 .PHONY
: all clean distclean cleanimage cleantools cleankernel prepk what setprofile libc help
661 .PHONY
: a b c d m Makefile allversions tomato_profile.mak