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
)
48 -include tomato_profile.mak
50 # This could be simpler by just using $(TOMATO_PROFILE_NAME) like it used to be,
51 # but that's fragile. If you make one certain innocuous change elsewhere in the
52 # makefile(s), the build will silently be wrong. This way it works properly every time.
53 current_BUILD_NAME
= $(strip $(shell grep
"^TOMATO_BUILD_NAME" tomato_profile.mak | cut
-d
"=" -f2
))
54 current_BUILD_DESC
= $(strip $(shell grep
"^TOMATO_BUILD_DESC" tomato_profile.mak | cut
-d
"=" -f2 | sed
-e
"s/ //g"))
55 current_BUILD_USB
= $(strip $(shell grep
"^TOMATO_BUILD_USB" tomato_profile.mak | cut
-d
"=" -f2 | sed
-e
"s/ //g"))
56 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
))
58 uppercase_N
= $(shell echo
$(N
) | tr a-z A-Z
)
59 lowercase_N
= $(shell echo
$(N
) | tr A-Z a-z
)
60 uppercase_B
= $(shell echo
$(B
) | tr a-z A-Z
)
61 lowercase_B
= $(shell echo
$(B
) | tr A-Z a-z
)
63 ifeq ($(CONFIG_LINUX26
),y
)
64 mips_rev
= $(if
$(filter $(MIPS32
),r2
),MIPSR2
,MIPSR1
)
71 beta
= $(if
$(filter $(TOMATO_EXPERIMENTAL
),1),-beta
,)
75 @btools
/uversion.pl
--gen
$(V1
) $(mips_rev
)$(beta
)$(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)$(beta)$(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
)$(beta
)$(V2
)-$(current_BUILD_DESC
).trx
98 @
rm -f image
/tomato-
$(ND
)$(current_BUILD_USB
)-$(current_TOMATO_VER
).
$(V1
)$(mips_rev
)$(beta
)$(V2
)-$(current_BUILD_DESC
).bin
100 @echo
"***********************" `date` "************************" >>fpkg.log
101 @cat router
/shared
/tomato_version
>>fpkg.log
103 @cat router
/target.
info >>fpkg.log
105 # Create generic BIN/TRX images
106 @btools
/fpkg
-i lzma-loader
/loader.gz
-i
$(LINUXDIR
)/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/vmlinuz
-a
1024 -i router
/mipsel-uclibc
/target.image \
107 -t image
/tomato-
$(ND
)$(current_BUILD_USB
)-$(current_TOMATO_VER
).
$(V1
)$(mips_rev
)$(beta
)$(V2
)-$(current_BUILD_DESC
).trx \
108 -l W54G
,image
/tomato-
$(ND
)$(current_BUILD_USB
)-$(current_TOMATO_VER
).
$(V1
)$(mips_rev
)$(beta
)$(V2
)-$(current_BUILD_DESC
).bin \
111 @cp fpkg.log image
/fpkg-
$(V1
)$(mips_rev
)$(beta
)$(V2
).log
113 @echo
"-----------------"
114 @echo
`cat router/shared/tomato_version` " ready"
115 @echo
"-----------------"
116 ifneq ($(NOVERSION
),1)
117 @cp router
/shared
/tomato_version router
/shared
/tomato_version_last
118 @btools
/uversion.pl
--bump
125 @touch router
/.config
126 @
rm -f router
/config_
[a-z
]
127 @
rm -f router
/busybox
/config_
[a-z
]
128 @
$(MAKE
) -C router
$@
129 @
-rmdir router
/mipsel-uclibc
134 @
rm -f router
/.config
135 @touch router
/.config
139 @
$(MAKE
) -C
$(LINUXDIR
)/scripts
/squashfs
clean
140 @
$(MAKE
) -C btools
clean
144 mv .config save-config
&& \
145 $(MAKE
) distclean || true
; \
146 cp
-p save-config .config || true
149 @
$(MAKE
) -C router kernel
150 @ls
-l
$(LINUXDIR
)/arch
/mips
/brcm-boards
/bcm947xx
/compressed
/zImage
152 distclean: clean cleanimage cleankernel cleantools cleanlibc
153 ifneq ($(INSIDE_MAK
),1)
154 @
$(MAKE
) -C router
$@ INSIDE_MAK
=1
156 mv router
/busybox
/.config busybox-saved-config || true
157 @
$(MAKE
) -C router
/busybox
distclean
158 @
rm -f router
/busybox
/config_current
159 @cp
-p busybox-saved-config router
/busybox
/.config || true
160 @cp
-p router
/busybox
/.config router
/busybox
/config_current || true
161 @
rm -f router
/config_current
162 @
rm -f router
/.config.cmd router
/.config.old router
/.config
163 @
rm -f router
/libfoo_xref.txt
164 @
rm -f tomato_profile.mak router
/shared
/tomato_profile.h
165 @touch tomato_profile.mak
166 @touch router
/shared
/tomato_profile.h
171 rm -f config_current
; \
172 ln
-s config_base config_current
; \
173 cp
-f config_current .config
174 $(MAKE
) -C
$(LINUXDIR
) oldconfig dep
178 @echo
"$(current_BUILD_DESC)-$(current_BUILD_NAME)-$(TOMATO_PROFILE_NAME) Profile"
182 # The methodology for making the different builds is to
183 # copy the "base" config file to the "target" config file in
184 # the appropriate directory, and then edit it by removing and
185 # inserting the desired configuration lines.
186 # You can't just delete the "whatever=y" line, you must have
187 # a "...is not set" line, or the make oldconfig will stop and ask
190 # Options for "make bin" :
191 # BUILD_DESC (Std|Lite|Ext|...)
196 # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_HTTPS, NO_XXTP, NO_LIBOPT
197 # SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM
201 if
[ "$(CONFIG_LINUX26)" = "y" ] ||
[ "$(SAMBA3)" = "y" ]; then \
202 sed
-i
"/TCONFIG_SAMBA3/d" $(1); \
203 echo
"TCONFIG_SAMBA3=y" >>$(1); \
205 sed
-i
"/TCONFIG_EMF/d" $(1); \
206 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
207 if
[ "$(SLIM)" = "y" ]; then \
208 echo
"# TCONFIG_EMF is not set" >>$(1); \
210 echo
"TCONFIG_EMF=y" >>$(1); \
213 echo
"# TCONFIG_EMF is not set" >>$(1); \
215 sed
-i
"/TCONFIG_JFFSV1/d" $(1); \
216 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
217 if
[ "$(JFFSv1)" = "y" ]; then \
218 echo
"TCONFIG_JFFSV1=y" >>$(1); \
220 echo
"# TCONFIG_JFFSV1 is not set" >>$(1); \
223 echo
"TCONFIG_JFFSV1=y" >>$(1); \
225 if
[ "$(USB)" = "USB" ]; then \
226 sed
-i
"/TCONFIG_USB is not set/d" $(1); \
227 echo
"TCONFIG_USB=y" >>$(1); \
228 if
[ "$(USBEXTRAS)" = "y" ]; then \
229 sed
-i
"/TCONFIG_USB_EXTRAS/d" $(1); \
230 echo
"TCONFIG_USB_EXTRAS=y" >>$(1); \
232 if
[ "$(NTFS)" = "y" ]; then \
233 sed
-i
"/TCONFIG_NTFS/d" $(1); \
234 echo
"TCONFIG_NTFS=y" >>$(1); \
236 if
[ "$(MEDIASRV)" = "y" ]; then \
237 sed
-i
"/TCONFIG_MEDIA_SERVER/d" $(1); \
238 echo
"TCONFIG_MEDIA_SERVER=y" >>$(1); \
241 sed
-i
"/TCONFIG_USB=y/d" $(1); \
242 echo
"# TCONFIG_USB is not set" >>$(1); \
244 if
[ "$(NO_SAMBA)" = "y" ]; then \
245 sed
-i
"/TCONFIG_SAMBASRV/d" $(1); \
246 echo
"# TCONFIG_SAMBASRV is not set" >>$(1); \
248 if
[ "$(NO_ZEBRA)" = "y" ]; then \
249 sed
-i
"/TCONFIG_ZEBRA/d" $(1); \
250 echo
"# TCONFIG_ZEBRA is not set" >>$(1); \
252 if
[ "$(NO_JFFS)" = "y" ]; then \
253 sed
-i
"/TCONFIG_JFFS2/d" $(1); \
254 echo
"# TCONFIG_JFFS2 is not set" >>$(1); \
255 sed
-i
"/TCONFIG_JFFSV1/d" $(1); \
256 echo
"# TCONFIG_JFFSV1 is not set" >>$(1); \
258 if
[ "$(NO_CIFS)" = "y" ]; then \
259 sed
-i
"/TCONFIG_CIFS/d" $(1); \
260 echo
"# TCONFIG_CIFS is not set" >>$(1); \
262 if
[ "$(NO_SSH)" = "y" ]; then \
263 sed
-i
"/TCONFIG_SSH/d" $(1); \
264 echo
"# TCONFIG_SSH is not set" >>$(1); \
266 if
[ "$(NO_HTTPS)" = "y" ]; then \
267 sed
-i
"/TCONFIG_HTTPS/d" $(1); \
268 echo
"# TCONFIG_HTTPS is not set" >>$(1); \
270 if
[ "$(NO_XXTP)" = "y" ]; then \
271 sed
-i
"/TCONFIG_L2TP/d" $(1); \
272 echo
"# TCONFIG_L2TP is not set" >>$(1); \
273 sed
-i
"/TCONFIG_PPTP/d" $(1); \
274 echo
"# TCONFIG_PPTP is not set" >>$(1); \
276 if
[ "$(NO_LIBOPT)" = "y" ]; then \
277 sed
-i
"/TCONFIG_OPTIMIZE_SHARED_LIBS/d" $(1); \
278 echo
"# TCONFIG_OPTIMIZE_SHARED_LIBS is not set" >>$(1); \
280 if
[ "$(EBTABLES)" = "y" ]; then \
281 sed
-i
"/TCONFIG_EBTABLES/d" $(1); \
282 echo
"TCONFIG_EBTABLES=y" >>$(1); \
284 if
[ "$(IPV6SUPP)" = "y" ]; then \
285 sed
-i
"/TCONFIG_IPV6/d" $(1); \
286 echo
"TCONFIG_IPV6=y" >>$(1); \
288 if
[ "$(OPENVPN)" = "y" ]; then \
289 sed
-i
"/TCONFIG_LZO/d" $(1); \
290 echo
"TCONFIG_LZO=y" >>$(1); \
291 sed
-i
"/TCONFIG_OPENVPN/d" $(1); \
292 echo
"TCONFIG_OPENVPN=y" >>$(1); \
293 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
294 sed
-i
"/TCONFIG_FTP_SSL/d" $(1); \
295 echo
"TCONFIG_FTP_SSL=y" >>$(1); \
298 if
[ "$(BTCLIENT)" = "y" ]; then \
299 sed
-i
"/TCONFIG_BT/d" $(1); \
300 echo
"TCONFIG_BT=y" >>$(1); \
305 define BusyboxOptions
307 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
308 sed
-i
"/CONFIG_FEATURE_2_4_MODULES/d" $(1); \
309 echo
"# CONFIG_FEATURE_2_4_MODULES is not set" >>$(1); \
310 sed
-i
"/CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT/d" $(1); \
311 echo
"CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y" >>$(1); \
312 sed
-i
"/CONFIG_FEATURE_DEVFS/d" $(1); \
313 echo
"# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
314 sed
-i
"/CONFIG_MKNOD/d" $(1); \
315 echo
"CONFIG_MKNOD=y" >>$(1); \
317 if
[ "$(NO_CIFS)" = "y" ]; then \
318 sed
-i
"/CONFIG_FEATURE_MOUNT_CIFS/d" $(1); \
319 echo
"# CONFIG_FEATURE_MOUNT_CIFS is not set" >>$(1); \
321 if
[ "$(BBEXTRAS)" = "y" ]; then \
322 sed
-i
"/CONFIG_SENDMAIL/d" $(1); \
323 echo
"CONFIG_SENDMAIL=y" >>$(1); \
324 sed
-i
"/CONFIG_FEATURE_SORT_BIG/d" $(1); \
325 echo
"CONFIG_FEATURE_SORT_BIG=y" >>$(1); \
326 sed
-i
"/CONFIG_FTPPUT/d" $(1); \
327 echo
"CONFIG_FTPPUT=y" >>$(1); \
328 sed
-i
"/CONFIG_CLEAR/d" $(1); \
329 echo
"CONFIG_CLEAR=y" >>$(1); \
330 sed
-i
"/CONFIG_SETCONSOLE/d" $(1); \
331 echo
"CONFIG_SETCONSOLE=y" >>$(1); \
332 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
333 sed
-i
"/CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE/d" $(1); \
334 echo
"CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=512" >>$(1); \
337 if
[ "$(USB)" = "USB" ]; then \
338 if
[ "$(USBEXTRAS)" = "y" ]; then \
339 sed
-i
"/CONFIG_E2FSCK/d" $(1); \
340 echo
"CONFIG_E2FSCK=y" >>$(1); \
341 sed
-i
"/CONFIG_MKE2FS/d" $(1); \
342 echo
"CONFIG_MKE2FS=y" >>$(1); \
343 sed
-i
"/CONFIG_FDISK/d" $(1); \
344 echo
"CONFIG_FDISK=y" >>$(1); \
345 sed
-i
"/CONFIG_FEATURE_FDISK_WRITABLE/d" $(1); \
346 echo
"CONFIG_FEATURE_FDISK_WRITABLE=y" >>$(1); \
347 sed
-i
"/CONFIG_MKFS_VFAT/d" $(1); \
348 echo
"CONFIG_MKFS_VFAT=y" >>$(1); \
349 sed
-i
"/CONFIG_MKSWAP/d" $(1); \
350 echo
"CONFIG_MKSWAP=y" >>$(1); \
351 sed
-i
"/CONFIG_FLOCK/d" $(1); \
352 echo
"CONFIG_FLOCK=y" >>$(1); \
353 sed
-i
"/CONFIG_FSYNC/d" $(1); \
354 echo
"CONFIG_FSYNC=y" >>$(1); \
355 sed
-i
"/CONFIG_UNZIP/d" $(1); \
356 echo
"CONFIG_UNZIP=y" >>$(1); \
357 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
358 sed
-i
"/CONFIG_LSUSB/d" $(1); \
359 echo
"CONFIG_LSUSB=y" >>$(1); \
360 sed
-i
"/CONFIG_FEATURE_WGET_STATUSBAR/d" $(1); \
361 echo
"CONFIG_FEATURE_WGET_STATUSBAR=y" >>$(1); \
362 sed
-i
"/CONFIG_FEATURE_VERBOSE_USAGE/d" $(1); \
363 echo
"CONFIG_FEATURE_VERBOSE_USAGE=y" >>$(1); \
367 sed
-i
"/CONFIG_FEATURE_MOUNT_LOOP/d" $(1); \
368 echo
"# CONFIG_FEATURE_MOUNT_LOOP is not set" >>$(1); \
369 sed
-i
"/CONFIG_FEATURE_DEVFS/d" $(1); \
370 echo
"# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
371 sed
-i
"/CONFIG_FEATURE_MOUNT_LABEL/d" $(1); \
372 echo
"# CONFIG_FEATURE_MOUNT_LABEL is not set" >>$(1); \
373 sed
-i
"/CONFIG_FEATURE_MOUNT_FSTAB/d" $(1); \
374 echo
"# CONFIG_FEATURE_MOUNT_FSTAB is not set" >>$(1); \
375 sed
-i
"/CONFIG_VOLUMEID/d" $(1); \
376 echo
"# CONFIG_VOLUMEID is not set" >>$(1); \
377 sed
-i
"/CONFIG_BLKID/d" $(1); \
378 echo
"# CONFIG_BLKID is not set" >>$(1); \
379 sed
-i
"/CONFIG_SWAPONOFF/d" $(1); \
380 echo
"# CONFIG_SWAPONOFF is not set" >>$(1); \
381 sed
-i
"/CONFIG_TRUE/d" $(1); \
382 echo
"# CONFIG_TRUE is not set" >>$(1); \
384 if
[ "$(IPV6SUPP)" = "y" ]; then \
385 sed
-i
"/CONFIG_FEATURE_IPV6/d" $(1); \
386 echo
"CONFIG_FEATURE_IPV6=y" >>$(1); \
387 sed
-i
"/CONFIG_PING6/d" $(1); \
388 echo
"CONFIG_PING6=y" >>$(1); \
389 sed
-i
"/CONFIG_TRACEROUTE6/d" $(1); \
390 echo
"CONFIG_TRACEROUTE6=y" >>$(1); \
391 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
392 sed
-i
"/CONFIG_FEATURE_UDHCP_RFC5969/d" $(1); \
393 echo
"CONFIG_FEATURE_UDHCP_RFC5969=y" >>$(1); \
396 if
[ "$(SLIM)" = "y" ]; then \
397 sed
-i
"/CONFIG_AWK/d" $(1); \
398 echo
"# CONFIG_AWK is not set" >>$(1); \
399 sed
-i
"/CONFIG_BASENAME/d" $(1); \
400 echo
"# CONFIG_BASENAME is not set" >>$(1); \
401 sed
-i
"/CONFIG_FEATURE_DEVFS/d" $(1); \
402 echo
"# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
403 sed
-i
"/CONFIG_BLKID/d" $(1); \
404 echo
"# CONFIG_BLKID is not set" >>$(1); \
405 sed
-i
"/CONFIG_TELNET=y/d" $(1); \
406 echo
"# CONFIG_TELNET is not set" >>$(1); \
407 sed
-i
"/CONFIG_ARPING/d" $(1); \
408 echo
"# CONFIG_ARPING is not set" >>$(1); \
409 sed
-i
"/CONFIG_FEATURE_LS_COLOR/d" $(1); \
410 echo
"# CONFIG_FEATURE_LS_COLOR is not set" >>$(1); \
412 sed
-i
"/CONFIG_FEATURE_LS_COLOR/d" $(1); \
413 echo
"CONFIG_FEATURE_LS_COLOR=y" >>$(1); \
414 sed
-i
"/CONFIG_FEATURE_LS_COLOR_IS_DEFAULT/d" $(1); \
415 echo
"CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y" >>$(1); \
422 sed
-i
"/CONFIG_CC_OPTIMIZE_FOR_SIZE/d" $(1); \
423 if
[ "$(KERN_SIZE_OPT)" = "y" ]; then \
424 echo
"CONFIG_CC_OPTIMIZE_FOR_SIZE=y" >>$(1); \
426 echo
"# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set" >>$(1); \
428 if
[ "$(CONFIG_LINUX26)" = "y" ] && [ "$(MIPS32)" = "r2" ]; then \
429 sed
-i
"/CONFIG_CPU_MIPS32_R1/d" $(1); \
430 echo
"# CONFIG_CPU_MIPS32_R1 is not set" >>$(1); \
431 sed
-i
"/CONFIG_CPU_MIPS32_R2/d" $(1); \
432 echo
"CONFIG_CPU_MIPS32_R2=y" >>$(1); \
433 sed
-i
"/CONFIG_CPU_MIPSR1/d" $(1); \
434 echo
"CONFIG_CPU_MIPSR2=y" >>$(1); \
436 if
[ "$(USB)" = "" ]; then \
437 sed
-i
"/CONFIG_MSDOS_PARTITION/d" $(1); \
438 echo
"# CONFIG_MSDOS_PARTITION is not set" >>$(1); \
439 sed
-i
"/CONFIG_EFI_PARTITION/d" $(1); \
440 echo
"# CONFIG_EFI_PARTITION is not set" >>$(1); \
442 if
[ "$(IPV6SUPP)" = "y" ]; then \
443 sed
-i
"/CONFIG_IPV6 is not set/d" $(1); \
444 echo
"CONFIG_IPV6=y" >>$(1); \
445 sed
-i
"/CONFIG_IP6_NF_IPTABLES/d" $(1); \
446 echo
"CONFIG_IP6_NF_IPTABLES=y" >>$(1); \
447 sed
-i
"/CONFIG_IP6_NF_MATCH_RT/d" $(1); \
448 echo
"CONFIG_IP6_NF_MATCH_RT=y" >>$(1); \
449 sed
-i
"/CONFIG_IP6_NF_FILTER/d" $(1); \
450 echo
"CONFIG_IP6_NF_FILTER=m" >>$(1); \
451 sed
-i
"/CONFIG_IP6_NF_TARGET_LOG/d" $(1); \
452 echo
"CONFIG_IP6_NF_TARGET_LOG=m" >>$(1); \
453 sed
-i
"/CONFIG_IP6_NF_TARGET_REJECT/d" $(1); \
454 echo
"CONFIG_IP6_NF_TARGET_REJECT=m" >>$(1); \
455 sed
-i
"/CONFIG_IP6_NF_MANGLE/d" $(1); \
456 echo
"CONFIG_IP6_NF_MANGLE=m" >>$(1); \
457 if
[ "$(CONFIG_LINUX26)" = "y" ]; then \
458 sed
-i
"/CONFIG_NF_CONNTRACK_IPV6/d" $(1); \
459 echo
"CONFIG_NF_CONNTRACK_IPV6=m" >>$(1); \
460 sed
-i
"/CONFIG_NETFILTER_XT_MATCH_HL/d" $(1); \
461 echo
"CONFIG_NETFILTER_XT_MATCH_HL=m" >>$(1); \
462 sed
-i
"/CONFIG_IPV6_ROUTER_PREF/d" $(1); \
463 echo
"CONFIG_IPV6_ROUTER_PREF=y" >>$(1); \
464 sed
-i
"/CONFIG_IPV6_SIT/d" $(1); \
465 echo
"CONFIG_IPV6_SIT=m" >>$(1); \
466 sed
-i
"/CONFIG_IPV6_SIT_6RD/d" $(1); \
467 echo
"CONFIG_IPV6_SIT_6RD=y" >>$(1); \
468 sed
-i
"/CONFIG_IPV6_MULTIPLE_TABLES/d" $(1); \
469 echo
"CONFIG_IPV6_MULTIPLE_TABLES=y" >>$(1); \
470 sed
-i
"/CONFIG_IP6_NF_RAW/d" $(1); \
471 echo
"CONFIG_IP6_NF_RAW=m" >>$(1); \
472 sed
-i
"/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
473 echo
"CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
475 sed
-i
"/CONFIG_IP6_NF_CONNTRACK/d" $(1); \
476 echo
"CONFIG_IP6_NF_CONNTRACK=m" >>$(1); \
477 sed
-i
"/CONFIG_IP6_NF_MATCH_HL/d" $(1); \
478 echo
"CONFIG_IP6_NF_MATCH_HL=m" >>$(1); \
479 sed
-i
"/CONFIG_IP6_NF_FTP/d" $(1); \
480 echo
"CONFIG_IP6_NF_FTP=m" >>$(1); \
481 sed
-i
"/CONFIG_IP6_NF_MATCH_LIMIT/d" $(1); \
482 echo
"CONFIG_IP6_NF_MATCH_LIMIT=m" >>$(1); \
483 sed
-i
"/CONFIG_IP6_NF_MATCH_CONDITION/d" $(1); \
484 echo
"CONFIG_IP6_NF_MATCH_CONDITION=m" >>$(1); \
485 sed
-i
"/CONFIG_IP6_NF_MATCH_MAC/d" $(1); \
486 echo
"CONFIG_IP6_NF_MATCH_MAC=m" >>$(1); \
487 sed
-i
"/CONFIG_IP6_NF_MATCH_MULTIPORT/d" $(1); \
488 echo
"CONFIG_IP6_NF_MATCH_MULTIPORT=m" >>$(1); \
489 sed
-i
"/CONFIG_IP6_NF_MATCH_MARK/d" $(1); \
490 echo
"CONFIG_IP6_NF_MATCH_MARK=m" >>$(1); \
491 sed
-i
"/CONFIG_IP6_NF_MATCH_LENGTH/d" $(1); \
492 echo
"CONFIG_IP6_NF_MATCH_LENGTH=m" >>$(1); \
493 sed
-i
"/CONFIG_IP6_NF_MATCH_STATE/d" $(1); \
494 echo
"CONFIG_IP6_NF_MATCH_STATE=m" >>$(1); \
495 sed
-i
"/CONFIG_IP6_NF_TARGET_MARK/d" $(1); \
496 echo
"CONFIG_IP6_NF_TARGET_MARK=m" >>$(1); \
497 sed
-i
"/CONFIG_IP6_NF_TARGET_TCPMSS/d" $(1); \
498 echo
"CONFIG_IP6_NF_TARGET_TCPMSS=m" >>$(1); \
499 sed
-i
"/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
500 echo
"CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
503 sed
-i
"/CONFIG_BCM57XX/d" $(1); \
504 if
[ "$(BCM57)" = "y" ]; then \
505 echo
"CONFIG_BCM57XX=m" >>$(1); \
507 echo
"# CONFIG_BCM57XX is not set" >>$(1); \
509 if
[ "$(CONFIG_LINUX26)" = "y" ] && [ "$(EBTABLES)" = "y" ]; then \
510 sed
-i
"/CONFIG_BRIDGE_NF_EBTABLES/d" $(1); \
511 echo
"CONFIG_BRIDGE_NF_EBTABLES=m" >>$(1); \
512 if
[ "$(IPV6SUPP)" = "y" ]; then \
513 sed
-i
"/CONFIG_BRIDGE_EBT_IP6/d" $(1); \
514 echo
"CONFIG_BRIDGE_EBT_IP6=m" >>$(1); \
523 @echo
$@
" is not a valid target!"
526 @cp router
/config_base router
/config_
$(lowercase_B
)
527 @cp router
/busybox
/config_base router
/busybox
/config_
$(lowercase_B
)
528 @cp
$(LINUXDIR
)/config_base
$(LINUXDIR
)/config_
$(lowercase_B
)
530 $(call RouterOptions
, router
/config_
$(lowercase_B
))
531 $(call KernelConfig
, $(LINUXDIR
)/config_
$(lowercase_B
))
532 $(call BusyboxOptions
, router
/busybox
/config_
$(lowercase_B
))
534 @
$(MAKE
) setprofile N
=$(TPROFILE
) B
=$(B
) DESC
="$(BUILD_DESC)" USB
="$(USB)"
537 ## Make the "normal" build
539 @
$(MAKE
) bin B
=A BUILD_DESC
="Std" USB
="USB"
541 ## Make the "normal but without SSH" build
543 @
$(MAKE
) bin NO_SSH
=y B
=B BUILD_DESC
="No SSH" USB
="USB"
545 ## Make the "normal but without CIFS" build
547 @
$(MAKE
) bin NO_CIFS
=y B
=C BUILD_DESC
="No CIFS" USB
="USB"
549 ## Make the "normal but without SAMBA" (Lite) build
551 ifeq ($(CONFIG_LINUX26
),y
)
552 @
$(MAKE
) bin NO_SAMBA
=y SLIM
=y NO_CIFS
=y NO_JFFS
=y NO_ZEBRA
=y B
=D BUILD_DESC
="Lite" USB
="USB"
554 @
$(MAKE
) bin NO_SAMBA
=y SLIM
=y B
=D BUILD_DESC
="Lite" USB
="USB"
557 ## Make the "normal (with NTFS support) + VPN" build
559 ifeq ($(CONFIG_LINUX26
),y
)
560 @
$(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"
562 @
$(MAKE
) bin OPENVPN
=y NTFS
=y B
=E BUILD_DESC
="$(VPN)" USB
="USB"
565 ## Make the "normal (with NTFS support) + VPN + BT Client" build
567 ifeq ($(CONFIG_LINUX26
),y
)
568 @
$(MAKE
) bin OPENVPN
=y NTFS
=y BBEXTRAS
=y USBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y MEDIASRV
=y IPV6SUPP
=y B
=E BUILD_DESC
="$(VPN)-BT" USB
="USB" BTCLIENT
=y
570 @
$(MAKE
) bin OPENVPN
=y NTFS
=y B
=E BUILD_DESC
="$(VPN)-BT" USB
="USB" BTCLIENT
=y
573 ## Make the "normal with Extras and NTFS" build
575 ifeq ($(CONFIG_LINUX26
),y
)
576 @
$(MAKE
) bin NTFS
=y BBEXTRAS
=y USBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y MEDIASRV
=y IPV6SUPP
=y B
=M BUILD_DESC
="Ext" USB
="USB"
578 @
$(MAKE
) bin NTFS
=y BBEXTRAS
=y USBEXTRAS
=y B
=M BUILD_DESC
="Ext" USB
="USB"
581 ## Make the "normal with Extras and NTFS and BT Client" build
583 ifeq ($(CONFIG_LINUX26
),y
)
584 @
$(MAKE
) bin NTFS
=y BBEXTRAS
=y USBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y MEDIASRV
=y IPV6SUPP
=y B
=M BUILD_DESC
="Ext-BT" USB
="USB" BTCLIENT
=y
586 @
$(MAKE
) bin NTFS
=y BBEXTRAS
=y USBEXTRAS
=y B
=M BUILD_DESC
="Ext-BT" USB
="USB" BTCLIENT
=y
589 ## Make the "No USB" build
591 ifeq ($(CONFIG_LINUX26
),y
)
592 @
$(MAKE
) bin JFFSv1
=y
$(if
$(filter r2
, $(MIPS32
)),,BCM57
=y
) B
=S BUILD_DESC
="Std" USB
=""
594 @
$(MAKE
) bin BBEXTRAS
=y BCM57
=y B
=S BUILD_DESC
="Std" USB
=""
597 ifeq ($(CONFIG_LINUX26
),y
)
598 ## Make the "No USB with Extras" build (K26 only, for 8MB flash)
600 @
$(MAKE
) bin B
=S USB
="" BBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y
$(if
$(filter r2
, $(MIPS32
)),,BCM57
=y
) IPV6SUPP
=y BUILD_DESC
="Std"
601 ## Make the "No USB with OpenVPN and Extras" build (K26 only, for 8MB flash)
603 @
$(MAKE
) bin B
=V USB
="" BBEXTRAS
=y EBTABLES
=y NO_LIBOPT
=y
$(if
$(filter r2
, $(MIPS32
)),,BCM57
=y
) IPV6SUPP
=y OPENVPN
=y BUILD_DESC
="$(VPN)"
606 ## Make the "Mini: no USB, no CIFS, no Zebra" build - targeted for Netgear routers
608 @
$(MAKE
) bin JFFSv1
=y NO_CIFS
=y NO_ZEBRA
=y SLIM
=y B
=F BUILD_DESC
="Mini" USB
=""
610 ifeq ($(CONFIG_LINUX26
),y
)
611 ## Make the "No USB with IPv6, no Zebra" build - for 4MB routers
613 @
$(MAKE
) bin JFFSv1
=y NO_CIFS
=y NO_ZEBRA
=y IPV6SUPP
=y B
=I BUILD_DESC
="MiniIPv6" USB
=""
616 ## Make the "VPN witn no USB support" build
618 ifeq ($(CONFIG_LINUX26
),y
)
619 @
$(MAKE
) bin OPENVPN
=y NO_JFFS
=y B
=V BUILD_DESC
="$(VPN)" USB
=""
621 @
$(MAKE
) bin OPENVPN
=y BBEXTRAS
=y BCM57
=y B
=V BUILD_DESC
="$(VPN)" USB
=""
624 ## Make Mips32r2 builds (K26 only)
625 ifeq ($(CONFIG_LINUX26
),y
)
661 echo
'#ifndef TOMATO_PROFILE' > router
/shared
/tomato_profile.h
662 echo
'#define TOMATO_$(N) 1' >> router
/shared
/tomato_profile.h
663 echo
'#define PROFILE_G 1' >> router
/shared
/tomato_profile.h
664 echo
'#define PROFILE_N 2' >> router
/shared
/tomato_profile.h
665 echo
'#define TOMATO_PROFILE PROFILE_$(N)' >> router
/shared
/tomato_profile.h
666 echo
'#define TOMATO_PROFILE_NAME "$(N)"' >> router
/shared
/tomato_profile.h
667 echo
'#define TOMATO_BUILD_NAME "$(B)"' >> router
/shared
/tomato_profile.h
668 echo
'#define TOMATO_BUILD_DESC "$(DESC)"' >> router
/shared
/tomato_profile.h
669 echo
'#endif' >> router
/shared
/tomato_profile.h
671 echo
'TOMATO_$(N) = 1' > tomato_profile.mak
672 echo
'PROFILE_G = 1' >> tomato_profile.mak
673 echo
'PROFILE_N = 2' >> tomato_profile.mak
674 echo
'TOMATO_PROFILE = $$(PROFILE_$(N))' >> tomato_profile.mak
675 echo
'TOMATO_PROFILE_NAME = "$(N)"' >> tomato_profile.mak
676 echo
'TOMATO_BUILD = "$(B)"' >> tomato_profile.mak
677 echo
'TOMATO_BUILD_NAME = "$(B)"' >> tomato_profile.mak
678 echo
'TOMATO_BUILD_DESC = "$(DESC)"' >> tomato_profile.mak
679 echo
'TOMATO_PROFILE_L = $(lowercase_N)' >> tomato_profile.mak
680 echo
'TOMATO_PROFILE_U = $(uppercase_N)' >> tomato_profile.mak
681 echo
'TOMATO_BUILD_USB = "$(USB)"' >> tomato_profile.mak
683 echo
'export EXTRACFLAGS := $(EXTRA_CFLAGS) -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32' >> tomato_profile.mak
686 # Note that changes to variables in tomato_profile.mak don't
687 # get propogated to this invocation of make!
689 @echo
"Using $(N) profile, $(B) build config."
693 rm -f config_current
; \
694 ln
-s config_
$(lowercase_B
) config_current
; \
695 cp
-f config_current .config
697 @cd router
/busybox
&& \
698 rm -f config_current
; \
699 ln
-s config_
$(lowercase_B
) config_current
; \
700 cp config_current .config
703 rm -f config_current
; \
704 ln
-s config_
$(lowercase_B
) config_current
; \
705 cp config_current .config
707 @
$(MAKE
) -C router oldconfig
710 # @$(MAKE) -C ../../tools-src/uClibc clean
713 # @$(MAKE) -C ../../tools-src/uClibc
714 # @$(MAKE) -C ../../tools-src/uClibc install
717 @echo
"a A build (standard)"
718 @echo
"b B build (standard minus SSH)"
719 @echo
"c C build (standard minus CIFS)"
720 @echo
"d D build (standard minus Samba server)"
721 @echo
"m M build (standard plus extra utilities and NTFS support)"
722 @echo
"n N build (standard plus extra utilities and NTFS support and BT Client)"
723 ifeq ($(CONFIG_LINUX26
),y
)
724 @echo
"e E build (standard plus VPN, extra utilities and NTFS support)"
725 @echo
"o O build (standard plus VPN, extra utilities and NTFS support and BT Client)"
726 @echo
"i I build (IPv6 with no USB support minus CIFS and RIPv1/2)"
728 @echo
"e E build (standard plus VPN and NTFS support)"
729 @echo
"o O build (standard plus VPN and NTFS support and BT Client)"
731 @echo
"s S build (no USB support)"
732 @echo
"f F build (no USB support minus CIFS and RIPv1/2)"
733 @echo
"v V build (VPN with no USB support)"
734 ifeq ($(CONFIG_LINUX26
),y
)
735 @echo
"t T build (no USB support with extra utilities)"
736 @echo
"u U build (no USB support with VPN and extra utilities)"
738 ifeq ($(CONFIG_LINUX26
),y
)
739 @echo
"r2m MIPS Release 2 M build (standard plus extras)"
740 @echo
"r2n MIPS Release 2 N build (standard plus extras plus BT Client)"
741 @echo
"r2e MIPS Release 2 E build (standard plus VPN and extras)"
742 @echo
"r2o MIPS Release 2 O build (standard plus VPN and extras and BT Client)"
743 @echo
"r2v MIPS Release 2 V build (VPN with no USB support)"
744 @echo
"r2s MIPS Release 2 S build (no USB support)"
745 @echo
"r2i MIPS Release 2 I build (IPv6 with no USB support minus CIFS and RIPv1/2)"
746 @echo
"r2f MIPS Release 2 F build (no USB support minus CIFS and RIPv1/2)"
747 @echo
"r2t MIPS Release 2 T build (no USB support with extra utilities)"
748 @echo
"r2u MIPS Release 2 U build (no USB support with VPN and extra utilities)"
750 @echo
"..etc.. other build configs"
751 @echo
"clean -C router clean"
752 @echo
"cleanimage rm -rf image"
753 @echo
"cleantools clean btools, mksquashfs"
754 @echo
"cleankernel -C Linux distclean (but preserves .config)"
755 @echo
"distclean distclean of Linux & busybox (but preserve .configs)"
756 @echo
"prepk -C Linux oldconfig dep"
757 @echo
"libc -C uClibc clean, all, install"
759 .PHONY
: all clean distclean cleanimage cleantools cleankernel prepk what setprofile libc help
760 .PHONY
: a b c d m Makefile allversions tomato_profile.mak