Revert "Added extrarules to iptables to get UDP request."
[tomato.git] / release / src / Makefile
blob691077eef92edeeb2b2456b76e2f67c3ba3d8df0
2 # Toplevel Makefile for the BCM947xx Linux Router release
4 # Copyright 2005, Broadcom Corporation
5 # All Rights Reserved.
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:
18 # make distclean
19 # make V1=whatever V2=sub-whatever VPN=vpn3.6 a b c d m
20 # The 1st "whatever" would be the build number, the sub-whatever would
21 # be the update to the version.
23 # Example:
24 # make V1=8516 V2="-jffs.1" a b c d m s
26 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
30 export SRCBASE := $(shell pwd)
31 RELEASEDIR := $(shell (cd $(SRCBASE)/.. && pwd -P))
32 PATH := $(RELEASEDIR)/tools:$(PATH)
33 export TPROFILE := N
35 include ./target.mak
37 # Normally you'd do something like "make V1=8516 V2=-sub-ver a b c d"
38 # But if you don't give anything for "V1", it'll get a default from tomato_version.
39 current_TOMATO_V1 ?= "--def"
40 VPN ?= "VPN"
41 NC ?="NOCAT"
42 ifeq ($(CONFIG_LINUX26),y)
43 ND = "K26"
44 else
45 ND = "ND"
46 endif
47 SNMP ?= "n"
48 VLAN ?= "n"
49 USERPPTP ?= "n"
50 PPTPD ?= "n"
51 TCPDUMP ?= "n"
53 ifeq ($(NVRAM_SIZE),)
54 NVRAM_SIZE = 0
55 endif
57 ifeq ($(VLAN),y)
58 EXTRA_PREDESC = 'VLAN-'
59 else
60 EXTRA_PREDESC = ''
61 endif
63 -include tomato_profile.mak
65 # This could be simpler by just using $(TOMATO_PROFILE_NAME) like it used to be,
66 # but that's fragile. If you make one certain innocuous change elsewhere in the
67 # makefile(s), the build will silently be wrong. This way it works properly every time.
68 current_BUILD_NAME = $(strip $(shell grep "^TOMATO_BUILD_NAME" tomato_profile.mak | cut -d"=" -f2))
69 current_BUILD_DESC = $(strip $(shell grep "^TOMATO_BUILD_DESC" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g"))
70 current_BUILD_USB = $(strip $(shell grep "^TOMATO_BUILD_USB" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g"))
71 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))
72 current_TOMATO_MIPS32 = $(strip $(shell grep "^TOMATO_BUILD_MIPS32" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g" | sed -e "s/\"//g" ))
73 current_TOMATO_V1 = $(strip $(shell grep "^TOMATO_BUILD_V1" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g" | sed -e "s/\"//g" ))
74 current_TOMATO_V2 = $(strip $(shell grep "^TOMATO_BUILD_V2" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g" | sed -e "s/\"//g" ))
75 current_TOMATO_B = $(strip $(shell grep "^TOMATO_BUILD_NAME" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g" | sed -e "s/\"//g" ))
76 current_TOMATO_N = $(strip $(shell grep "^TOMATO_PROFILE_NAME" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g" | sed -e "s/\"//g" ))
77 N=$(current_TOMATO_N)
78 B=$(current_TOMATO_B)
80 uppercase_N = $(shell echo $(N) | tr a-z A-Z)
81 lowercase_N = $(shell echo $(N) | tr A-Z a-z)
82 uppercase_B = $(shell echo $(B) | tr a-z A-Z)
83 lowercase_B = $(shell echo $(B) | tr A-Z a-z)
85 ifeq ($(CONFIG_LINUX26),y)
86 mips_rev = $(if $(filter $(current_TOMATO_MIPS32),r2),MIPSR2,MIPSR1)
88 KERN_SIZE_OPT ?= n
89 else
90 mips_rev =
91 KERN_SIZE_OPT ?= y
92 endif
94 beta = $(if $(filter $(TOMATO_EXPERIMENTAL),1),-beta,)
96 tomato_ver:
97 @echo ""
98 @btools/uversion.pl --gen $(current_TOMATO_V1) $(mips_rev)$(beta)$(current_TOMATO_V2) $(ND) $(current_BUILD_USB) $(current_BUILD_DESC)
100 ifeq ($(TOMATO_BUILD),)
102 all:
103 $(MAKE) a
105 else
107 all: tomato_ver
108 @echo ""
109 @echo "Building Tomato $(ND) $(current_BUILD_USB) $(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2) $(current_BUILD_DESC) $(current_BUILD_NAME) with $(TOMATO_PROFILE_NAME) Profile"
111 @echo ""
112 @echo ""
114 @-mkdir image
115 @$(MAKE) -C router all
116 @$(MAKE) -C router install
117 @$(MAKE) -C btools
119 @rm -f image/tomato-$(ND)$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).trx
120 @rm -f image/tomato-$(ND)$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
121 ifeq ($(WRT54),y)
122 ifneq ($(MIPS32),r2)
123 @rm -f image/tomato-WRT54*$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
124 @rm -f image/tomato-WRTSL54*$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
125 @rm -f image/tomato-WR850G$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
126 endif
127 endif
128 ifeq ($(LINKSYS_E),y)
129 @rm -f image/tomato-E??00$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
130 endif
131 ifeq ($(BELKIN),y)
132 ifneq ($(NVRAM_SIZE),60)
133 @rm -f image/tomato-F7D????$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
134 @rm -f image/tomato-F5D8235v3$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
135 endif
136 endif
137 @echo "" >>fpkg.log
138 @echo "***********************" `date` "************************" >>fpkg.log
139 @cat router/shared/tomato_version >>fpkg.log
140 @echo "" >>fpkg.log
141 @cat router/target.info >>fpkg.log
142 ifeq ($(WRT54),y)
143 ifneq ($(current_TOMATO_MIPS32),r2)
144 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
145 -l W54G,image/tomato-WRT54G_WRT54GL$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
146 -l W54S,image/tomato-WRT54GS$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
147 -l W54s,image/tomato-WRT54GSv4$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
148 -l W54U,image/tomato-WRTSL54GS$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
149 -m 0x10577050,image/tomato-WR850G$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
150 | tee -a fpkg.log
151 endif
152 endif
153 ifeq ($(LINKSYS_E),y)
154 # Linksys E-series images
155 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
156 -l 4200,image/tomato-E4200$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
157 -l 61XN,image/tomato-E3000$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
158 -l 32XN,image/tomato-E2000$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
159 | tee -a fpkg.log
160 endif
161 ifeq ($(BELKIN),y)
162 ifneq ($(NVRAM_SIZE),60)
163 # Create Belkin images
164 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
165 -b 0x20100322,image/tomato-F7D3301$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
166 -b 0x20090928,image/tomato-F7D3302$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
167 -b 0x20091006,image/tomato-F7D4302$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
168 -b 0x00017116,image/tomato-F5D8235v3$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin \
169 | tee -a fpkg.log
170 endif
171 endif
172 # Create generic TRX image
173 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
174 -t image/tomato-$(ND)$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).trx \
175 | tee -a fpkg.log
177 @cp fpkg.log image/fpkg-$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2).log
178 @echo ""
179 @echo "-----------------"
180 @echo `cat router/shared/tomato_version` " ready"
181 @echo "-----------------"
182 ifneq ($(NOVERSION),1)
183 @cp router/shared/tomato_version router/shared/tomato_version_last
184 @btools/uversion.pl --bump
185 endif
186 endif
190 clean:
191 @touch router/.config
192 @rm -f router/config_[a-z]
193 @rm -f router/busybox/config_[a-z]
194 @$(MAKE) -C router $@
195 @-rmdir router/mipsel-uclibc
197 cleanimage:
198 @rm -f fpkg.log
199 @rm -fr image/*
200 @rm -f router/.config
201 @touch router/.config
202 @-mkdir image
204 cleantools:
205 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs clean
206 @$(MAKE) -C btools clean
208 cleankernel:
209 @cd $(LINUXDIR) && \
210 mv .config save-config && \
211 $(MAKE) distclean || true; \
212 cp -p save-config .config || true
214 kernel:
215 @$(MAKE) -C router kernel
216 @ls -l $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage
218 distclean: clean cleanimage cleankernel cleantools
219 ifneq ($(INSIDE_MAK),1)
220 @$(MAKE) -C router $@ INSIDE_MAK=1
221 endif
222 mv router/busybox/.config busybox-saved-config || true
223 @$(MAKE) -C router/busybox distclean
224 @rm -f router/busybox/config_current
225 @cp -p busybox-saved-config router/busybox/.config || true
226 @cp -p router/busybox/.config router/busybox/config_current || true
227 @rm -f router/config_current
228 @rm -f router/.config.cmd router/.config.old router/.config
229 @rm -f router/libfoo_xref.txt
230 @rm -f tomato_profile.mak router/shared/tomato_profile.h
231 @touch tomato_profile.mak
232 @touch router/shared/tomato_profile.h
235 prepk:
236 @cd $(LINUXDIR) ; \
237 rm -f config_current ; \
238 ln -s config_base config_current ; \
239 cp -f config_current .config
240 $(MAKE) -C $(LINUXDIR) oldconfig
241 ifneq ($(CONFIG_LINUX26),y)
242 $(MAKE) -C $(LINUXDIR) dep
243 endif
245 what:
246 @echo ""
247 @echo "$(current_BUILD_DESC)-$(current_BUILD_NAME)-$(TOMATO_PROFILE_NAME) Profile"
248 @echo ""
251 # The methodology for making the different builds is to
252 # copy the "base" config file to the "target" config file in
253 # the appropriate directory, and then edit it by removing and
254 # inserting the desired configuration lines.
255 # You can't just delete the "whatever=y" line, you must have
256 # a "...is not set" line, or the make oldconfig will stop and ask
257 # what to do.
259 # Options for "make bin" :
260 # BUILD_DESC (Std|Lite|Ext|...)
261 # MIPS32 (r2|r1)
262 # KERN_SIZE_OPT
263 # USB ("USB"|"")
264 # JFFSv1 | NO_JFFS
265 # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_HTTPS, NO_XXTP, NO_LIBOPT, NO_FTP
266 # SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM
267 # NOCAT
268 # SNMP
269 # HFS
270 # USERPPTP
271 # VLAN
273 define RouterOptions
274 @( \
275 if [ "$(CONFIG_LINUX26)" = "y" ] || [ "$(SAMBA3)" = "y" ]; then \
276 sed -i "/TCONFIG_SAMBA3/d" $(1); \
277 echo "TCONFIG_SAMBA3=y" >>$(1); \
278 fi; \
279 sed -i "/TCONFIG_EMF/d" $(1); \
280 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
281 if [ "$(SLIM)" = "y" ]; then \
282 echo "# TCONFIG_EMF is not set" >>$(1); \
283 else \
284 echo "TCONFIG_EMF=y" >>$(1); \
285 fi; \
286 else \
287 echo "# TCONFIG_EMF is not set" >>$(1); \
288 fi; \
289 sed -i "/TCONFIG_JFFSV1/d" $(1); \
290 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
291 if [ "$(JFFSv1)" = "y" ]; then \
292 echo "TCONFIG_JFFSV1=y" >>$(1); \
293 else \
294 echo "# TCONFIG_JFFSV1 is not set" >>$(1); \
295 fi; \
296 else \
297 echo "TCONFIG_JFFSV1=y" >>$(1); \
298 fi; \
299 if [ "$(USB)" = "USB" ]; then \
300 sed -i "/TCONFIG_USB is not set/d" $(1); \
301 echo "TCONFIG_USB=y" >>$(1); \
302 if [ "$(USBEXTRAS)" = "y" ]; then \
303 sed -i "/TCONFIG_USB_EXTRAS/d" $(1); \
304 echo "TCONFIG_USB_EXTRAS=y" >>$(1); \
305 fi; \
306 if [ "$(NTFS)" = "y" ]; then \
307 sed -i "/TCONFIG_NTFS/d" $(1); \
308 echo "TCONFIG_NTFS=y" >>$(1); \
309 fi; \
310 if [ "$(MEDIASRV)" = "y" ]; then \
311 sed -i "/TCONFIG_MEDIA_SERVER/d" $(1); \
312 echo "TCONFIG_MEDIA_SERVER=y" >>$(1); \
313 fi; \
314 else \
315 sed -i "/TCONFIG_USB=y/d" $(1); \
316 echo "# TCONFIG_USB is not set" >>$(1); \
317 fi; \
318 if [ "$(NO_SAMBA)" = "y" ]; then \
319 sed -i "/TCONFIG_SAMBASRV/d" $(1); \
320 echo "# TCONFIG_SAMBASRV is not set" >>$(1); \
321 fi; \
322 if [ "$(NO_ZEBRA)" = "y" ]; then \
323 sed -i "/TCONFIG_ZEBRA/d" $(1); \
324 echo "# TCONFIG_ZEBRA is not set" >>$(1); \
325 fi; \
326 if [ "$(NO_JFFS)" = "y" ]; then \
327 sed -i "/TCONFIG_JFFS2/d" $(1); \
328 echo "# TCONFIG_JFFS2 is not set" >>$(1); \
329 sed -i "/TCONFIG_JFFSV1/d" $(1); \
330 echo "# TCONFIG_JFFSV1 is not set" >>$(1); \
331 fi; \
332 if [ "$(NO_CIFS)" = "y" ]; then \
333 sed -i "/TCONFIG_CIFS/d" $(1); \
334 echo "# TCONFIG_CIFS is not set" >>$(1); \
335 fi; \
336 if [ "$(NO_FTP)" = "y" ]; then \
337 sed -i "/TCONFIG_FTP/d" $(1); \
338 echo "# TCONFIG_FTP is not set" >>$(1); \
339 fi; \
340 if [ "$(NO_SSH)" = "y" ]; then \
341 sed -i "/TCONFIG_SSH/d" $(1); \
342 echo "# TCONFIG_SSH is not set" >>$(1); \
343 fi; \
344 if [ "$(NO_HTTPS)" = "y" ]; then \
345 sed -i "/TCONFIG_HTTPS/d" $(1); \
346 echo "# TCONFIG_HTTPS is not set" >>$(1); \
347 fi; \
348 if [ "$(NO_XXTP)" = "y" ]; then \
349 sed -i "/TCONFIG_L2TP/d" $(1); \
350 echo "# TCONFIG_L2TP is not set" >>$(1); \
351 sed -i "/TCONFIG_PPTP/d" $(1); \
352 echo "# TCONFIG_PPTP is not set" >>$(1); \
353 fi; \
354 if [ "$(NO_LIBOPT)" = "y" ]; then \
355 sed -i "/TCONFIG_OPTIMIZE_SHARED_LIBS/d" $(1); \
356 echo "# TCONFIG_OPTIMIZE_SHARED_LIBS is not set" >>$(1); \
357 fi; \
358 if [ "$(EBTABLES)" = "y" ]; then \
359 sed -i "/TCONFIG_EBTABLES/d" $(1); \
360 echo "TCONFIG_EBTABLES=y" >>$(1); \
361 fi; \
362 if [ "$(IPV6SUPP)" = "y" ]; then \
363 sed -i "/TCONFIG_IPV6/d" $(1); \
364 echo "TCONFIG_IPV6=y" >>$(1); \
365 fi; \
366 if [ "$(NOCAT)" = "y" ]; then \
367 sed -i "/TCONFIG_NOCAT/d" $(1); \
368 echo "TCONFIG_NOCAT=y" >>$(1); \
369 fi; \
370 if [ "$(OPENVPN)" = "y" ]; then \
371 sed -i "/TCONFIG_LZO/d" $(1); \
372 echo "TCONFIG_LZO=y" >>$(1); \
373 sed -i "/TCONFIG_OPENVPN/d" $(1); \
374 echo "TCONFIG_OPENVPN=y" >>$(1); \
375 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
376 sed -i "/TCONFIG_FTP_SSL/d" $(1); \
377 echo "TCONFIG_FTP_SSL=y" >>$(1); \
378 fi; \
379 fi; \
380 if [ "$(HFS)" = "y" ]; then \
381 sed -i "/TCONFIG_HFS/d" $(1); \
382 echo "TCONFIG_HFS=y" >>$(1); \
383 fi; \
384 if [ "$(SNMP)" = "y" ]; then \
385 sed -i "/TCONFIG_SNMP/d" $(1); \
386 echo "TCONFIG_SNMP=y" >>$(1); \
387 fi; \
388 if [ "$(USERPPTP)" = "y" ]; then \
389 sed -i "/TCONFIG_USERPPTP/d" $(1); \
390 echo "TCONFIG_USERPPTP=y" >>$(1); \
391 fi; \
392 if [ "$(VLAN)" = "y" ]; then \
393 sed -i "/TCONFIG_VLAN/d" $(1); \
394 echo "TCONFIG_VLAN=y" >>$(1); \
395 fi; \
396 if [ "$(PPTPD)" = "y" ]; then \
397 sed -i "/TCONFIG_PPTPD/d" $(1); \
398 echo "TCONFIG_PPTPD=y" >>$(1); \
399 fi; \
400 if [ "$(TCPDUMP)" = "y" ]; then \
401 sed -i "/TCONFIG_TCPDUMP/d" $(1); \
402 echo "TCONFIG_TCPDUMP=y" >>$(1); \
403 fi; \
405 endef
407 define BusyboxOptions
408 @( \
409 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
410 sed -i "/CONFIG_FEATURE_2_4_MODULES/d" $(1); \
411 echo "# CONFIG_FEATURE_2_4_MODULES is not set" >>$(1); \
412 sed -i "/CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT/d" $(1); \
413 echo "CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y" >>$(1); \
414 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
415 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
416 sed -i "/CONFIG_MKNOD/d" $(1); \
417 echo "CONFIG_MKNOD=y" >>$(1); \
418 sed -i "/CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE/d" $(1); \
419 echo "CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=512" >>$(1); \
420 fi; \
421 if [ "$(NO_CIFS)" = "y" ]; then \
422 sed -i "/CONFIG_FEATURE_MOUNT_CIFS/d" $(1); \
423 echo "# CONFIG_FEATURE_MOUNT_CIFS is not set" >>$(1); \
424 fi; \
425 if [ "$(BBEXTRAS)" = "y" ]; then \
426 sed -i "/CONFIG_SENDMAIL/d" $(1); \
427 echo "CONFIG_SENDMAIL=y" >>$(1); \
428 sed -i "/CONFIG_FEATURE_SORT_BIG/d" $(1); \
429 echo "CONFIG_FEATURE_SORT_BIG=y" >>$(1); \
430 sed -i "/CONFIG_FTPPUT/d" $(1); \
431 echo "CONFIG_FTPPUT=y" >>$(1); \
432 sed -i "/CONFIG_FTPGET/d" $(1); \
433 echo "CONFIG_FTPGET=y" >>$(1); \
434 sed -i "/CONFIG_CLEAR/d" $(1); \
435 echo "CONFIG_CLEAR=y" >>$(1); \
436 sed -i "/CONFIG_NICE/d" $(1); \
437 echo "CONFIG_NICE=y" >>$(1); \
438 sed -i "/CONFIG_SETCONSOLE/d" $(1); \
439 echo "CONFIG_SETCONSOLE=y" >>$(1); \
440 sed -i "/CONFIG_MKFIFO/d" $(1); \
441 echo "CONFIG_MKFIFO=y" >>$(1); \
442 fi; \
443 if [ "$(USB)" = "USB" ]; then \
444 if [ "$(USBEXTRAS)" = "y" ]; then \
445 sed -i "/CONFIG_E2FSCK/d" $(1); \
446 echo "CONFIG_E2FSCK=y" >>$(1); \
447 sed -i "/CONFIG_MKE2FS/d" $(1); \
448 echo "CONFIG_MKE2FS=y" >>$(1); \
449 sed -i "/CONFIG_FDISK/d" $(1); \
450 echo "CONFIG_FDISK=y" >>$(1); \
451 sed -i "/CONFIG_FEATURE_FDISK_WRITABLE/d" $(1); \
452 echo "CONFIG_FEATURE_FDISK_WRITABLE=y" >>$(1); \
453 sed -i "/CONFIG_MKFS_VFAT/d" $(1); \
454 echo "CONFIG_MKFS_VFAT=y" >>$(1); \
455 sed -i "/CONFIG_MKSWAP/d" $(1); \
456 echo "CONFIG_MKSWAP=y" >>$(1); \
457 sed -i "/CONFIG_FLOCK/d" $(1); \
458 echo "CONFIG_FLOCK=y" >>$(1); \
459 sed -i "/CONFIG_FSYNC/d" $(1); \
460 echo "CONFIG_FSYNC=y" >>$(1); \
461 sed -i "/CONFIG_TUNE2FS/d" $(1); \
462 echo "CONFIG_TUNE2FS=y" >>$(1); \
463 sed -i "/CONFIG_E2LABEL/d" $(1); \
464 echo "CONFIG_E2LABEL=y" >>$(1); \
465 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
466 sed -i "/CONFIG_LSUSB/d" $(1); \
467 echo "CONFIG_LSUSB=y" >>$(1); \
468 sed -i "/CONFIG_FEATURE_WGET_STATUSBAR/d" $(1); \
469 echo "CONFIG_FEATURE_WGET_STATUSBAR=y" >>$(1); \
470 sed -i "/CONFIG_FEATURE_VERBOSE_USAGE/d" $(1); \
471 echo "CONFIG_FEATURE_VERBOSE_USAGE=y" >>$(1); \
472 fi; \
473 fi; \
474 else \
475 sed -i "/CONFIG_FEATURE_MOUNT_LOOP/d" $(1); \
476 echo "# CONFIG_FEATURE_MOUNT_LOOP is not set" >>$(1); \
477 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
478 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
479 sed -i "/CONFIG_FEATURE_MOUNT_LABEL/d" $(1); \
480 echo "# CONFIG_FEATURE_MOUNT_LABEL is not set" >>$(1); \
481 sed -i "/CONFIG_FEATURE_MOUNT_FSTAB/d" $(1); \
482 echo "# CONFIG_FEATURE_MOUNT_FSTAB is not set" >>$(1); \
483 sed -i "/CONFIG_VOLUMEID/d" $(1); \
484 echo "# CONFIG_VOLUMEID is not set" >>$(1); \
485 sed -i "/CONFIG_BLKID/d" $(1); \
486 echo "# CONFIG_BLKID is not set" >>$(1); \
487 sed -i "/CONFIG_SWAPONOFF/d" $(1); \
488 echo "# CONFIG_SWAPONOFF is not set" >>$(1); \
489 sed -i "/CONFIG_CHROOT/d" $(1); \
490 echo "# CONFIG_CHROOT is not set" >>$(1); \
491 sed -i "/CONFIG_PIVOT_ROOT/d" $(1); \
492 echo "# CONFIG_PIVOT_ROOT is not set" >>$(1); \
493 sed -i "/CONFIG_TRUE/d" $(1); \
494 echo "# CONFIG_TRUE is not set" >>$(1); \
495 fi; \
496 if [ "$(IPV6SUPP)" = "y" ]; then \
497 sed -i "/CONFIG_FEATURE_IPV6/d" $(1); \
498 echo "CONFIG_FEATURE_IPV6=y" >>$(1); \
499 sed -i "/CONFIG_PING6/d" $(1); \
500 echo "CONFIG_PING6=y" >>$(1); \
501 sed -i "/CONFIG_TRACEROUTE6/d" $(1); \
502 echo "CONFIG_TRACEROUTE6=y" >>$(1); \
503 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
504 sed -i "/CONFIG_FEATURE_UDHCP_RFC5969/d" $(1); \
505 echo "CONFIG_FEATURE_UDHCP_RFC5969=y" >>$(1); \
506 fi; \
507 fi; \
508 if [ "$(SLIM)" = "y" ]; then \
509 sed -i "/CONFIG_AWK/d" $(1); \
510 echo "# CONFIG_AWK is not set" >>$(1); \
511 sed -i "/CONFIG_BASENAME/d" $(1); \
512 echo "# CONFIG_BASENAME is not set" >>$(1); \
513 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
514 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
515 sed -i "/CONFIG_BLKID/d" $(1); \
516 echo "# CONFIG_BLKID is not set" >>$(1); \
517 sed -i "/CONFIG_TELNET=y/d" $(1); \
518 echo "# CONFIG_TELNET is not set" >>$(1); \
519 sed -i "/CONFIG_ARPING/d" $(1); \
520 echo "# CONFIG_ARPING is not set" >>$(1); \
521 sed -i "/CONFIG_FEATURE_LS_COLOR/d" $(1); \
522 echo "# CONFIG_FEATURE_LS_COLOR is not set" >>$(1); \
523 sed -i "/CONFIG_CHOWN/d" $(1); \
524 echo "# CONFIG_CHOWN is not set" >>$(1); \
525 else \
526 sed -i "/CONFIG_FEATURE_LS_COLOR/d" $(1); \
527 echo "CONFIG_FEATURE_LS_COLOR=y" >>$(1); \
528 sed -i "/CONFIG_FEATURE_LS_COLOR_IS_DEFAULT/d" $(1); \
529 echo "CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y" >>$(1); \
530 fi; \
532 endef
534 define KernelConfig
535 @( \
536 sed -i "/CONFIG_NVRAM_SIZE/d" $(1); \
537 echo "CONFIG_NVRAM_SIZE="$(NVRAM_SIZE) >>$(1); \
538 sed -i "/CONFIG_CC_OPTIMIZE_FOR_SIZE/d" $(1); \
539 if [ "$(KERN_SIZE_OPT)" = "y" ]; then \
540 echo "CONFIG_CC_OPTIMIZE_FOR_SIZE=y" >>$(1); \
541 else \
542 echo "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set" >>$(1); \
543 fi; \
544 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(MIPS32)" = "r2" ]; then \
545 sed -i "/CONFIG_CPU_MIPS32_R1/d" $(1); \
546 echo "# CONFIG_CPU_MIPS32_R1 is not set" >>$(1); \
547 sed -i "/CONFIG_CPU_MIPS32_R2/d" $(1); \
548 echo "CONFIG_CPU_MIPS32_R2=y" >>$(1); \
549 sed -i "/CONFIG_CPU_MIPSR1/d" $(1); \
550 echo "CONFIG_CPU_MIPSR2=y" >>$(1); \
551 fi; \
552 if [ "$(USB)" = "" ]; then \
553 sed -i "/CONFIG_EFI_PARTITION/d" $(1); \
554 echo "# CONFIG_EFI_PARTITION is not set" >>$(1); \
555 fi; \
556 if [ "$(IPV6SUPP)" = "y" ]; then \
557 sed -i "/CONFIG_IPV6 is not set/d" $(1); \
558 echo "CONFIG_IPV6=y" >>$(1); \
559 sed -i "/CONFIG_IP6_NF_IPTABLES/d" $(1); \
560 echo "CONFIG_IP6_NF_IPTABLES=y" >>$(1); \
561 sed -i "/CONFIG_IP6_NF_MATCH_RT/d" $(1); \
562 echo "CONFIG_IP6_NF_MATCH_RT=y" >>$(1); \
563 sed -i "/CONFIG_IP6_NF_FILTER/d" $(1); \
564 echo "CONFIG_IP6_NF_FILTER=m" >>$(1); \
565 sed -i "/CONFIG_IP6_NF_TARGET_LOG/d" $(1); \
566 echo "CONFIG_IP6_NF_TARGET_LOG=m" >>$(1); \
567 sed -i "/CONFIG_IP6_NF_TARGET_REJECT/d" $(1); \
568 echo "CONFIG_IP6_NF_TARGET_REJECT=m" >>$(1); \
569 sed -i "/CONFIG_IP6_NF_MANGLE/d" $(1); \
570 echo "CONFIG_IP6_NF_MANGLE=m" >>$(1); \
571 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
572 sed -i "/CONFIG_NF_CONNTRACK_IPV6/d" $(1); \
573 echo "CONFIG_NF_CONNTRACK_IPV6=m" >>$(1); \
574 sed -i "/CONFIG_NETFILTER_XT_MATCH_HL/d" $(1); \
575 echo "CONFIG_NETFILTER_XT_MATCH_HL=m" >>$(1); \
576 sed -i "/CONFIG_IPV6_ROUTER_PREF/d" $(1); \
577 echo "CONFIG_IPV6_ROUTER_PREF=y" >>$(1); \
578 sed -i "/CONFIG_IPV6_SIT/d" $(1); \
579 echo "CONFIG_IPV6_SIT=m" >>$(1); \
580 sed -i "/CONFIG_IPV6_SIT_6RD/d" $(1); \
581 echo "CONFIG_IPV6_SIT_6RD=y" >>$(1); \
582 sed -i "/CONFIG_IPV6_MULTIPLE_TABLES/d" $(1); \
583 echo "CONFIG_IPV6_MULTIPLE_TABLES=y" >>$(1); \
584 sed -i "/CONFIG_IP6_NF_RAW/d" $(1); \
585 echo "CONFIG_IP6_NF_RAW=m" >>$(1); \
586 sed -i "/CONFIG_IPV6_OPTIMISTIC_DAD/d" $(1); \
587 echo "CONFIG_IPV6_OPTIMISTIC_DAD=y" >>$(1); \
588 sed -i "/CONFIG_IPV6_MROUTE/d" $(1); \
589 echo "CONFIG_IPV6_MROUTE=y" >>$(1); \
590 sed -i "/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
591 echo "CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
592 else \
593 sed -i "/CONFIG_IP6_NF_CONNTRACK/d" $(1); \
594 echo "CONFIG_IP6_NF_CONNTRACK=m" >>$(1); \
595 sed -i "/CONFIG_IP6_NF_MATCH_HL/d" $(1); \
596 echo "CONFIG_IP6_NF_MATCH_HL=m" >>$(1); \
597 sed -i "/CONFIG_IP6_NF_FTP/d" $(1); \
598 echo "CONFIG_IP6_NF_FTP=m" >>$(1); \
599 sed -i "/CONFIG_IP6_NF_MATCH_LIMIT/d" $(1); \
600 echo "CONFIG_IP6_NF_MATCH_LIMIT=m" >>$(1); \
601 sed -i "/CONFIG_IP6_NF_MATCH_CONDITION/d" $(1); \
602 echo "CONFIG_IP6_NF_MATCH_CONDITION=m" >>$(1); \
603 sed -i "/CONFIG_IP6_NF_MATCH_MAC/d" $(1); \
604 echo "CONFIG_IP6_NF_MATCH_MAC=m" >>$(1); \
605 sed -i "/CONFIG_IP6_NF_MATCH_MULTIPORT/d" $(1); \
606 echo "CONFIG_IP6_NF_MATCH_MULTIPORT=m" >>$(1); \
607 sed -i "/CONFIG_IP6_NF_MATCH_MARK/d" $(1); \
608 echo "CONFIG_IP6_NF_MATCH_MARK=m" >>$(1); \
609 sed -i "/CONFIG_IP6_NF_MATCH_LENGTH/d" $(1); \
610 echo "CONFIG_IP6_NF_MATCH_LENGTH=m" >>$(1); \
611 sed -i "/CONFIG_IP6_NF_MATCH_STATE/d" $(1); \
612 echo "CONFIG_IP6_NF_MATCH_STATE=m" >>$(1); \
613 sed -i "/CONFIG_IP6_NF_TARGET_MARK/d" $(1); \
614 echo "CONFIG_IP6_NF_TARGET_MARK=m" >>$(1); \
615 sed -i "/CONFIG_IP6_NF_TARGET_TCPMSS/d" $(1); \
616 echo "CONFIG_IP6_NF_TARGET_TCPMSS=m" >>$(1); \
617 sed -i "/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
618 echo "CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
619 fi; \
620 fi; \
621 sed -i "/CONFIG_BCM57XX/d" $(1); \
622 if [ "$(BCM57)" = "y" ]; then \
623 echo "CONFIG_BCM57XX=m" >>$(1); \
624 else \
625 echo "# CONFIG_BCM57XX is not set" >>$(1); \
626 fi; \
627 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(EBTABLES)" = "y" ]; then \
628 sed -i "/CONFIG_BRIDGE_NF_EBTABLES/d" $(1); \
629 echo "CONFIG_BRIDGE_NF_EBTABLES=m" >>$(1); \
630 if [ "$(IPV6SUPP)" = "y" ]; then \
631 sed -i "/CONFIG_BRIDGE_EBT_IP6/d" $(1); \
632 echo "CONFIG_BRIDGE_EBT_IP6=m" >>$(1); \
633 fi; \
634 fi; \
636 endef
639 bin:
640 ifeq ($(B),)
641 @echo $@" is not a valid target!"
642 @false
643 endif
644 @cp router/config_base router/config_$(lowercase_B)
645 @cp router/busybox/config_base router/busybox/config_$(lowercase_B)
646 @cp $(LINUXDIR)/config_base $(LINUXDIR)/config_$(lowercase_B)
648 $(call RouterOptions, router/config_$(lowercase_B))
649 $(call KernelConfig, $(LINUXDIR)/config_$(lowercase_B))
650 $(call BusyboxOptions, router/busybox/config_$(lowercase_B))
652 @$(MAKE) setprofile N=$(TPROFILE) B=$(B) DESC="$(BUILD_DESC)" USB="$(USB)" MIPS32="${MIPS32}" V1="${V1}" V2="${V2}"
653 @$(MAKE) all
655 ## Make the "normal" build
657 @$(MAKE) bin B=A BUILD_DESC="Std" USB="USB" VLAN="$(VLAN)" SNMP=y
659 ## Make the "normal but without SSH" build
661 @$(MAKE) bin NO_SSH=y B=B BUILD_DESC="No SSH" USB="USB" VLAN="$(VLAN)" SNMP=y
663 ## Make the "normal but without CIFS" build
665 @$(MAKE) bin NO_CIFS=y B=C BUILD_DESC="No CIFS" USB="USB" VLAN="$(VLAN)" SNMP=y
667 ## Make the "normal but without SAMBA" (Lite) build
669 ifeq ($(CONFIG_LINUX26),y)
670 @$(MAKE) bin NO_SAMBA=y SLIM=y NO_CIFS=y NO_JFFS=y NO_ZEBRA=y B=D BUILD_DESC="Lite" USB="USB" VLAN="$(VLAN)" SNMP="$(SNMP)"
671 else
672 @$(MAKE) bin NO_SAMBA=y SLIM=y B=D BUILD_DESC="Lite" USB="USB" VLAN="$(VLAN)" SNMP="$(SNMP)"
673 endif
675 ## Make the "normal (with NTFS support) + VPN" build
677 ifeq ($(CONFIG_LINUX26),y)
678 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y NO_LIBOPT=y MEDIASRV=y IPV6SUPP=y B=E BUILD_DESC="$(VPN)" USB="USB" VLAN="$(VLAN)" SNMP=y TCPDUMP="$(TCPDUMP)"
679 else
680 # @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NTFS=y B=E BUILD_DESC="$(VPN)" USB="USB" VLAN="$(VLAN)"
681 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y BBEXTRAS=y USBEXTRAS=y NTFS=y B=E BUILD_DESC="$(VPN)" USB="USB" SNMP=y VLAN="$(VLAN)" TCPDUMP="$(TCPDUMP)"
682 endif
684 ## Make the "Mini: no USB, no CIFS, no Zebra" build - targeted for Netgear routers
686 @$(MAKE) bin JFFSv1=y NO_CIFS=y NO_SSH=y NO_ZEBRA=y SLIM=y B=F BUILD_DESC="Mini" USB="" VLAN="$(VLAN)"
688 ## Make the "Tiny: no JFFS, no USB, no CIFS, no Zebra" build - targeted for cheapskate routers
690 @$(MAKE) bin NO_CIFS=y NO_SSH=y NO_JFFS=y NO_ZEBRA=y SLIM=y B=FS BUILD_DESC="Tiny" USB="" VLAN="$(VLAN)"
692 ## Make the "No USB with IPv6, no Zebra" build - for 4MB routers
694 @$(MAKE) bin JFFSv1=y NO_CIFS=y NO_SSH=y NO_ZEBRA=y IPV6SUPP=y B=I BUILD_DESC="MiniIPv6" USB="" VLAN="$(VLAN)"
696 ## Make the "No USB with IPv6, no Zebra, with VPN" build - for 4MB routers
697 ifeq ($(CONFIG_LINUX26),y)
699 @$(MAKE) bin JFFSv1=y NO_CIFS=y NO_SSH=y NO_XXTP=y SLIM=y NO_SAMBA=y NO_ZEBRA=y IPV6SUPP=y OPENVPN=y USERPPTP=y NO_LIBOPT=y B=J BUILD_DESC="MiniIPv6-VPN" USB="" VLAN="$(VLAN)" SNMP="$(SNMP)"
700 endif
702 ## Make the "normal with Extras and NTFS" build
704 ifeq ($(CONFIG_LINUX26),y)
705 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y NO_LIBOPT=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="Ext" USB="USB" VLAN="$(VLAN)" SNMP=y USERPPTP=y PPTPD=y TCPDUMP="$(TCPDUMP)"
706 else
707 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y B=M BUILD_DESC="Ext" USB="USB" VLAN="$(VLAN)" SNMP=y USERPPTP=y PPTPD=y TCPDUMP="$(TCPDUMP)"
708 endif
710 ## Roadkill
711 ## Make the "normal (with NTFS support) + VPN + NOCAT" build
713 ifeq ($(CONFIG_LINUX26),y)
714 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y NO_LIBOPT=y MEDIASRV=y IPV6SUPP=y B=NC BUILD_DESC="$(VPN)" USB="USB" SNMP=y VLAN="$(VLAN)" NOCAT=y TCPDUMP="$(TCPDUMP)" BUILD_DESC+="-$(NC)"
715 else
716 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NTFS=y B=NC BUILD_DESC="$(VPN)" USB="USB" VLAN="$(VLAN)" NOCAT=y TCPDUMP="$(TCPDUMP)" BUILD_DESC+=" $(NC)"
717 endif
719 ## Toastman
720 ## Make the "Mini: no USB, + NOCAT" build - for 4MB routers
721 ncm:
722 @$(MAKE) bin JFFSv1=y NOCAT=y B=NCM BUILD_DESC="Mini-NOCAT" USB="" VLAN="$(VLAN)"
724 ## Toastman
725 ## Make the "normal" build + NOCAT
726 ncs:
727 @$(MAKE) bin NOCAT=y B=NCS BUILD_DESC="Std-NOCAT" USB="USB" SNMP=y VLAN="$(VLAN)" TCPDUMP="$(TCPDUMP)"
730 ## Make the "No USB" build
732 ifeq ($(CONFIG_LINUX26),y)
733 @$(MAKE) bin JFFSv1=y $(if $(filter r2, $(MIPS32)),,BCM57=y) B=S BUILD_DESC="Std" USB="" VLAN="$(VLAN)" TCPDUMP="$(TCPDUMP)"
734 else
735 @$(MAKE) bin BBEXTRAS=y BCM57=y B=S BUILD_DESC="Std" USB="" VLAN="$(VLAN)" TCPDUMP="$(TCPDUMP)"
736 endif
739 ## Make the "No USB with Extras" build (K26 only, for 8MB flash)
740 ifeq ($(CONFIG_LINUX26),y)
742 @$(MAKE) bin B=T USB="" BBEXTRAS=y EBTABLES=y NO_LIBOPT=y $(if $(filter r2, $(MIPS32)),,BCM57=y) IPV6SUPP=y BUILD_DESC="Std" SNMP=y VLAN="$(VLAN)"
743 ## Make the "No USB with OpenVPN and Extras" build (K26 only, for 8MB flash)
745 @$(MAKE) bin B=U USB="" BBEXTRAS=y EBTABLES=y NO_LIBOPT=y $(if $(filter r2, $(MIPS32)),,BCM57=y) IPV6SUPP=y OPENVPN=y USERPPTP=y BUILD_DESC="$(VPN)" SNMP=y VLAN="$(VLAN)"
746 endif
748 ## Make the "VPN with no USB support" build
750 ifeq ($(CONFIG_LINUX26),y)
751 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NO_JFFS=y BCM57=y B=V BUILD_DESC="$(VPN)" USB="" VLAN="$(VLAN)" TCPDUMP="$(TCPDUMP)" TCPDUMP="$(TCPDUMP)"
752 else
753 @$(MAKE) bin OPENVPN=y PPTPD=y BBEXTRAS=y B=V BUILD_DESC="$(VPN)" USB="" SNMP=y VLAN="$(VLAN)" TCPDUMP="$(TCPDUMP)" TCPDUMP="$(TCPDUMP)"
754 endif
756 ## Make the "Small VPN with no USB support" build
758 ifeq ($(CONFIG_LINUX26),y)
759 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NO_JFFS=y NO_CIFS=y B=VS BUILD_DESC="SmallVPN" USB=""
760 else
761 @$(MAKE) bin OPENVPN=y USERPPTP=y PPTPD=y NO_JFFS=y NO_CIFS=y BCM57=y B=VS BUILD_DESC="SmallVPN" USB=""
762 endif
764 ## Make Mips32r2 builds
766 r2a:
767 @$(MAKE) a MIPS32=r2
769 r2b:
770 @$(MAKE) b MIPS32=r2
772 r2c:
773 @$(MAKE) c MIPS32=r2
775 r2d:
776 @$(MAKE) d MIPS32=r2
778 r2e:
779 @$(MAKE) e MIPS32=r2
781 r2f:
782 @$(MAKE) f MIPS32=r2 BELKIN=y
784 r2fs:
785 @$(MAKE) fs MIPS32=r2
787 r2i:
788 @$(MAKE) i MIPS32=r2
790 r2j:
791 @$(MAKE) j MIPS32=r2
793 r2m:
794 @$(MAKE) m MIPS32=r2
796 r2n:
797 @$(MAKE) n MIPS32=r2
799 r2nc:
800 @$(MAKE) nc MIPS32=r2
802 r2r:
803 @$(MAKE) r MIPS32=r2
805 r2s:
806 @$(MAKE) s MIPS32=r2
808 r2t:
809 @$(MAKE) t MIPS32=r2
811 r2u:
812 @$(MAKE) t MIPS32=r2
814 r2v:
815 @$(MAKE) v MIPS32=r2
817 r2vs:
818 @$(MAKE) vs MIPS32=r2
820 n60a:
821 @$(MAKE) r2a NVRAM_SIZE=60 LINKSYS_E=y
823 n60b:
824 @$(MAKE) r2b NVRAM_SIZE=60 LINKSYS_E=y
826 n60c:
827 @$(MAKE) r2c NVRAM_SIZE=60 LINKSYS_E=y
829 n60e:
830 @$(MAKE) r2e NVRAM_SIZE=60 LINKSYS_E=y
832 n60m:
833 @$(MAKE) r2m NVRAM_SIZE=60 LINKSYS_E=y
835 n60n:
836 @$(MAKE) r2n NVRAM_SIZE=60 LINKSYS_E=y
838 n60nc:
839 @$(MAKE) r2nc NVRAM_SIZE=60 LINKSYS_E=y
841 n60o:
842 @$(MAKE) r2o NVRAM_SIZE=60 LINKSYS_E=y
844 n60r:
845 @$(MAKE) r2r NVRAM_SIZE=60 LINKSYS_E=y
847 n60s:
848 @$(MAKE) bin MIPS32=r2 B=S USB="" NVRAM_SIZE=60 LINKSYS_E=y BBEXTRAS=y EBTABLES=y NO_LIBOPT=y IPV6SUPP=y BUILD_DESC="Std"
850 n60t:
851 @$(MAKE) r2t NVRAM_SIZE=60 LINKSYS_E=y
853 n60v:
854 @$(MAKE) bin MIPS32=r2 B=V USB="" NVRAM_SIZE=60 LINKSYS_E=y BBEXTRAS=y EBTABLES=y NO_LIBOPT=y IPV6SUPP=y OPENVPN=y USERPPTP=y BUILD_DESC="$(VPN)"
857 setprofile:
858 echo '#ifndef TOMATO_PROFILE' > router/shared/tomato_profile.h
859 echo '#define TOMATO_$(N) 1' >> router/shared/tomato_profile.h
860 echo '#define PROFILE_G 1' >> router/shared/tomato_profile.h
861 echo '#define PROFILE_N 2' >> router/shared/tomato_profile.h
862 echo '#define TOMATO_PROFILE PROFILE_$(N)' >> router/shared/tomato_profile.h
863 echo '#define TOMATO_PROFILE_NAME "$(N)"' >> router/shared/tomato_profile.h
864 echo '#define TOMATO_BUILD_NAME "$(B)"' >> router/shared/tomato_profile.h
865 echo '#define TOMATO_BUILD_DESC "$(EXTRA_PREDESC)$(DESC)"' >> router/shared/tomato_profile.h
866 echo '#ifndef CONFIG_NVRAM_SIZE' >> router/shared/tomato_profile.h
867 echo '#define CONFIG_NVRAM_SIZE $(NVRAM_SIZE)' >> router/shared/tomato_profile.h
868 echo '#endif' >> router/shared/tomato_profile.h
869 echo '#endif' >> router/shared/tomato_profile.h
871 echo 'TOMATO_$(N) = 1' > tomato_profile.mak
872 echo 'PROFILE_G = 1' >> tomato_profile.mak
873 echo 'PROFILE_N = 2' >> tomato_profile.mak
874 echo 'TOMATO_PROFILE = $$(PROFILE_$(N))' >> tomato_profile.mak
875 echo 'TOMATO_PROFILE_NAME = "$(N)"' >> tomato_profile.mak
876 echo 'TOMATO_BUILD = "$(B)"' >> tomato_profile.mak
877 echo 'TOMATO_BUILD_NAME = "$(B)"' >> tomato_profile.mak
878 echo 'TOMATO_BUILD_DESC = "$(EXTRA_PREDESC)$(DESC)"' >> tomato_profile.mak
879 echo 'TOMATO_PROFILE_L = $(lowercase_N)' >> tomato_profile.mak
880 echo 'TOMATO_PROFILE_U = $(uppercase_N)' >> tomato_profile.mak
881 echo 'TOMATO_BUILD_USB = "$(USB)"' >> tomato_profile.mak
882 echo 'TOMATO_BUILD_MIPS32 = "${MIPS32}"' >> tomato_profile.mak
883 echo 'TOMATO_BUILD_V1 = "${V1}"' >> tomato_profile.mak
884 echo 'TOMATO_BUILD_V2 = "${V2}"' >> tomato_profile.mak
886 echo 'export EXTRACFLAGS := $(EXTRA_CFLAGS) -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32 $(if $(filter $(NVRAM_SIZE),0),,-DCONFIG_NVRAM_SIZE=$(NVRAM_SIZE))' >> tomato_profile.mak
888 # Note that changes to variables in tomato_profile.mak don't
889 # get propogated to this invocation of make!
890 @echo ""
891 @echo "Using $(N) profile, $(B) build config."
892 @echo ""
894 @cd $(LINUXDIR) ; \
895 rm -f config_current ; \
896 ln -s config_$(lowercase_B) config_current ; \
897 cp -f config_current .config
899 @cd router/busybox && \
900 rm -f config_current ; \
901 ln -s config_$(lowercase_B) config_current ; \
902 cp config_current .config
904 @cd router ; \
905 rm -f config_current ; \
906 ln -s config_$(lowercase_B) config_current ; \
907 cp config_current .config
909 @$(MAKE) -C router oldconfig
911 help:
912 @echo "a A build (standard)"
913 @echo "b B build (standard minus SSH)"
914 @echo "c C build (standard minus CIFS)"
915 @echo "d D build (standard minus Samba server)"
916 @echo "m M build (standard plus extra utilities and NTFS support)"
917 @echo "nc NC build (standard plus VPN, extra utilities, NTFS support and NOCAT)"
918 @echo "ncm NCS build (no USB support, NOCAT)"
919 @echo "ncs NCS build (std + NOCAT)"
920 @echo "m Ext - (standard plus extra utilities and NTFS support)"
922 ifeq ($(CONFIG_LINUX26),y)
923 @echo "e E build (standard plus VPN, extra utilities and NTFS support)"
924 @echo "i I build (IPv6 with no USB support minus CIFS and RIPv1/2)"
925 else
926 @echo "e E build (standard plus VPN and NTFS support)"
927 endif
928 @echo "s S build (no USB support)"
929 @echo "f F build (no USB support minus CIFS and RIPv1/2)"
930 @echo "fs FS build (no USB support minus CIFS, JFFS, Zebra and RIPv1/2)"
931 @echo "v V build (VPN with no USB support)"
932 @echo "vs VS build (Small VPN with no USB support)"
934 ifeq ($(CONFIG_LINUX26),y)
935 @echo "r2a MIPS Release 2 A build (standard)"
936 @echo "r2b MIPS Release 2 B build (standard minus SSH)"
937 @echo "r2c MIPS Release 2 C build (standard minus CIFS)"
938 @echo "r2d MIPS Release 2 D build (standard minus Samba server)"
939 @echo "r2e MIPS Release 2 E build (standard plus VPN and extras)"
940 @echo "r2f MIPS Release 2 F build (no USB support minus CIFS, RIPv1/2)"
941 @echo "r2fs MIPS Release 2 FS build (no USB support minus JFFS, CIFS, RIPv1/2, Zebra)"
942 @echo "r2i MIPS Release 2 I build (IPv6 with no USB support minus CIFS and RIPv1/2)"
943 @echo "r2m MIPS Release 2 M build (standard plus extras)"
944 @echo "r2nc MIPS Release 2 NC build (standard plus VPN, extras and NOCAT)"
945 @echo "r2ncm MIPS Release 2 NCM build (no USB support, plus NOCAT)"
946 @echo "r2ncs MIPS Release 2 NCS build (standard plus NOCAT)"
947 @echo "r2s MIPS Release 2 S build (no USB support)"
948 @echo "r2t MIPS Release 2 T build (no USB support with extras)"
949 @echo "r2u MIPS Release 2 U build (no USB support plus VPN with extras)"
950 @echo "r2v MIPS Release 2 V build (VPN with no USB support)"
951 @echo "r2vs MIPS Release 2 VS build (Small VPN with no USB support)"
952 @echo "n60m Linksys E-series build (60KB NVRAM, standard plus extras)"
953 @echo "n60e Linksys E-series build (60KB NVRAM, standard plus VPN and extras)"
954 @echo "n60nc Linksys E-series build (60KB NVRAM, standard plus extras, plus VPN, plus NOCAT)"
955 @echo "n60s Linksys E-series build (60KB NVRAM, no USB support)"
956 @echo "n60v Linksys E-series build (60KB NVRAM, VPN with no USB support)"
957 endif
958 @echo "..etc.. other build configs"
959 @echo "clean -C router clean"
960 @echo "cleanimage rm -rf image"
961 @echo "cleantools clean btools, mksquashfs"
962 @echo "cleankernel -C Linux distclean (but preserves .config)"
963 @echo "distclean distclean of Linux & busybox (but preserve .configs)"
964 @echo "prepk -C Linux oldconfig dep"
966 .PHONY: all clean distclean cleanimage cleantools cleankernel prepk what setprofile help
967 .PHONY: a b c d m Makefile allversions tomato_profile.mak