Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / Makefile
blob73eb83ddffb1580b93f277f78263cee5f9472ad4
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 n o
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 n o
26 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29 export ac_cv_func_malloc_0_nonnull=yes
30 export SRCBASE := $(shell pwd)
31 export SRCBASEDIR := $(shell pwd | sed 's/.*release\///g')
32 RELEASEDIR := $(shell (cd $(SRCBASE)/.. && pwd -P))
33 PATH := $(RELEASEDIR)/tools:$(PATH)
34 export TPROFILE := N
36 include ./target.mak
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.
40 V1 ?= "--def"
41 VPN ?= "VPN"
42 ifeq ($(CONFIG_LINUX26),y)
43 ifeq ($(CONFIG_BCMWL6),y)
44 ND = "K26AC"
45 else
46 ND = "K26"
47 endif
48 else
49 ND = "ND"
50 endif
52 PPTPD ?= "n"
54 ifeq ($(NVRAM_SIZE),)
55 NVRAM_SIZE = 0
56 endif
58 ifeq ($(ASUS_TRX),)
59 ASUS_TRX = 0
60 endif
63 ifeq ($(WNR3500LV2),)
64 WNR3500LV2 = 0
65 else
66 WNRTOOL=$(SRCBASE)/wnrtool
67 BOARD_FILE=$(WNRTOOL)/compatible_WNR3500Lv2.txt
68 fw_cfg_file := $(WNRTOOL)/ambitCfg.h
69 endif
71 ifeq ($(NVRAM_64K),y)
72 EXTRA_64KDESC = ' -64K'
73 EXTRA_64KCFLAG = '-DTCONFIG_NVRAM_64K'
74 else
75 EXTRA_64KDESC = ''
76 EXTRA_64KCFLAG = ''
77 endif
79 -include tomato_profile.mak
81 # This could be simpler by just using $(TOMATO_PROFILE_NAME) like it used to be,
82 # but that's fragile. If you make one certain innocuous change elsewhere in the
83 # makefile(s), the build will silently be wrong. This way it works properly every time.
84 current_BUILD_NAME = $(strip $(shell grep "^TOMATO_BUILD_NAME" tomato_profile.mak | cut -d"=" -f2))
85 current_BUILD_DESC = $(strip $(shell grep "^TOMATO_BUILD_DESC" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g"))
86 current_BUILD_USB = $(strip $(shell grep "^TOMATO_BUILD_USB" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g"))
87 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))
89 uppercase_N = $(shell echo $(N) | tr a-z A-Z)
90 lowercase_N = $(shell echo $(N) | tr A-Z a-z)
91 uppercase_B = $(shell echo $(B) | tr a-z A-Z)
92 lowercase_B = $(shell echo $(B) | tr A-Z a-z)
94 ifeq ($(CONFIG_LINUX26),y)
95 mips_rev = $(if $(filter $(MIPS32),r2),MIPSR2,MIPSR1)
96 KERN_SIZE_OPT ?= n
97 else
98 mips_rev =
99 KERN_SIZE_OPT ?= y
100 endif
102 beta = $(if $(filter $(TOMATO_EXPERIMENTAL),1),-beta,)
104 tomato_ver:
105 @echo ""
106 @btools/uversion.pl --gen $(V1) $(mips_rev)$(beta)$(V2) $(ND) $(current_BUILD_USB) $(current_BUILD_DESC)
108 ifeq ($(TOMATO_BUILD),)
110 all:
111 $(MAKE) a
113 else
115 all: tomato_ver
116 @echo ""
117 @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"
119 @echo ""
120 @echo ""
122 @-mkdir image
123 @$(MAKE) -C router all
124 @$(MAKE) -C router install
125 @$(MAKE) -C btools
127 @rm -f image/tomato-$(ND)$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).trx
128 @rm -f image/tomato-$(ND)$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
130 ifneq ($(ASUS_TRX),0)
131 ifeq ($(ASUS_TRX),EA6500V1)
132 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
133 -t image/tomato-$(ASUS_TRX)_$(V1)$(V2)-$(current_BUILD_DESC).trx \
134 | tee -a fpkg.log
135 else
136 $(MAKE) -C ctools
137 ctools/objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUXDIR)/vmlinux ctools/piggy
138 ctools/lzma_4k e ctools/piggy ctools/vmlinuz-lzma
139 ctools/mksquashfs router/mipsel-uclibc/target ctools/target.squashfs -noappend -all-root
140 ctools/trx -o image/linux-lzma.trx ctools/vmlinuz-lzma ctools/target.squashfs
141 ctools/trx_asus -i image/linux-lzma.trx -r $(BUILD_NAME),$(KERNEL_VER).$(FS_VER),image/tomato-$(ASUS_TRX)_$(V1)$(V2)-$(current_BUILD_DESC).trx
142 @rm -f image/linux-lzma.trx
143 @echo ""
144 endif #AE6500V1
145 endif
147 ifeq ($(WNR3500LV2),1)
148 @echo "Creating Firmware for Netgear WNR3500L v2 .... "
149 mipsel-uclibc-objcopy -O binary -g $(LINUXDIR)/vmlinux image/vmlinux.bin
150 $(WNRTOOL)/lzma e image/vmlinux.bin image/vmlinux.lzma
151 $(WNRTOOL)/trx -o image/tomato-wnr3500lv2.trx image/vmlinux.lzma $(SRCBASE)/router/mipsel-uclibc/target.image
152 rm -f image/vmlinux.bin image/vmlinux.lzma
153 cd image && touch rootfs
154 cd image && $(WNRTOOL)/packet -k tomato-wnr3500lv2.trx -f rootfs -b $(BOARD_FILE) -ok kernel_image -oall kernel_rootfs_image -or rootfs_image -i $(fw_cfg_file) && rm -f rootfs && \
155 cp kernel_rootfs_image.chk tomato-Netgear-3500Lv2-$(ND)$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(V2)-$(current_BUILD_DESC).chk
156 @echo "Cleanup ...."
157 # rm -f image/*image.chk image/*.trx
158 endif
160 ifeq ($(WRT54),y)
161 ifneq ($(MIPS32),r2)
162 @rm -f image/tomato-WRT54*$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
163 @rm -f image/tomato-WRTSL54*$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
164 @rm -f image/tomato-WR850G$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
165 endif
166 endif
167 ifeq ($(LINKSYS_E),y)
168 @rm -f image/tomato-E??????$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
169 endif
170 ifeq ($(LINKSYS_E_64k),y)
171 @rm -f image/tomato-E??????$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
172 endif
173 ifeq ($(LINKSYS_E1200v1),y)
174 @rm -f image/tomato-E1200v1$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
175 endif
176 ifeq ($(LINKSYS_E1000v2),y)
177 @rm -f image/tomato-E1000v2-v21$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
178 @rm -f image/tomato-Cisco-M10v2$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
179 endif
180 ifeq ($(LINKSYS_E2500),y)
181 @rm -f image/tomato-E2500$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
182 endif
183 ifeq ($(LINKSYS_E3200),y)
184 @rm -f image/tomato-E3200$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
185 @rm -f image/tomato-E2500v3$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
186 endif
187 ifeq ($(BELKIN),y)
188 ifneq ($(NVRAM_SIZE),60)
189 @rm -f image/tomato-F7D????$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
190 @rm -f image/tomato-F5D8235v3$(current_BUILD_USB)-$(current_TOMATO_VER).$(current_TOMATO_V1)$(mips_rev)$(beta)$(current_TOMATO_V2)-$(current_BUILD_DESC).bin
191 endif
192 endif
193 @echo "" >>fpkg.log
194 @echo "***********************" `date` "************************" >>fpkg.log
195 @cat router/shared/tomato_version >>fpkg.log
196 @echo "" >>fpkg.log
197 @cat router/target.info >>fpkg.log
198 ifeq ($(WRT54),y)
199 ifneq ($(MIPS32),r2)
200 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
201 -l W54G,image/tomato-WRT54G_WRT54GL$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
202 -l W54S,image/tomato-WRT54GS$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
203 -l W54s,image/tomato-WRT54GSv4$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
204 -l W54U,image/tomato-WRTSL54GS$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
205 -m 0x10577050,image/tomato-WR850G$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
206 | tee -a fpkg.log
207 endif
208 endif
209 ifeq ($(LINKSYS_E),y)
210 # Linksys E-series(60k Nvram) images
211 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
212 -l 1550,image/tomato-E1550$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
213 -l 4200,image/tomato-E4200$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
214 -l 61XN,image/tomato-E3000$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
215 -l 32XN,image/tomato-E2000$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
216 | tee -a fpkg.log
217 endif
218 ifeq ($(LINKSYS_E2500),y)
219 # Linksys E2500(60k Nvram) image
220 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
221 -l E25X,image/tomato-E2500$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
222 | tee -a fpkg.log
223 endif
224 ifeq ($(LINKSYS_E3200),y)
225 # Linksys E3200/E2500v3(60k Nvram) image
226 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
227 -l 25V3,image/tomato-E2500v3$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
228 -l 3200,image/tomato-E3200$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
229 | tee -a fpkg.log
230 endif
231 ifeq ($(LINKSYS_E_64k),y)
232 # Linksys E-series(64k Nvram) images
233 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
234 -l E800,image/tomato-E800$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
235 -l E900,image/tomato-E900$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
236 -l E122,image/tomato-E1200v2$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
237 -l E150,image/tomato-E1500$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
238 | tee -a fpkg.log
239 endif
240 ifeq ($(LINKSYS_E1000v2),y)
241 # Linksys E1000v2/v2.1 images
242 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
243 -l E100,image/tomato-E1000v2-v21$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
244 -l M010,image/tomato-Cisco-M10v2$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
245 | tee -a fpkg.log
246 endif
247 ifeq ($(LINKSYS_E1200v1),y)
248 # Linksys E1200v1 images
249 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
250 -l E120,image/tomato-E1200v1$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
251 | tee -a fpkg.log
252 endif
253 ifeq ($(BELKIN),y)
254 ifneq ($(NVRAM_SIZE),60)
255 # Create Belkin images
256 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
257 -b 0x20100322,image/tomato-F7D3301$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
258 -b 0x20090928,image/tomato-F7D3302$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
259 -b 0x20091006,image/tomato-F7D4302$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
260 -b 0x00017116,image/tomato-F5D8235v3$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
261 | tee -a fpkg.log
262 endif
263 endif
264 # Create generic TRX image
265 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
266 -t image/tomato-$(ND)$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).trx \
267 | tee -a fpkg.log
269 @cp fpkg.log image/fpkg-$(V1)$(mips_rev)$(beta)$(V2).log
270 @echo ""
271 @echo "-----------------"
272 @echo `cat router/shared/tomato_version` " ready"
273 @echo "-----------------"
274 ifneq ($(NOVERSION),1)
275 @cp router/shared/tomato_version router/shared/tomato_version_last
276 @btools/uversion.pl --bump
277 endif
278 endif
282 clean:
283 @touch router/.config
284 @rm -f router/config_[a-z]
285 @rm -f router/busybox/config_[a-z]
286 @$(MAKE) -C router $@
287 @-rmdir router/mipsel-uclibc
289 cleanimage:
290 @rm -f fpkg.log
291 @rm -fr image/*
292 @rm -f router/.config
293 @touch router/.config
294 @-mkdir image
296 cleantools:
297 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs clean
298 @$(MAKE) -C btools clean
300 cleankernel:
301 @cd $(LINUXDIR) && \
302 mv .config save-config && \
303 $(MAKE) distclean || true; \
304 cp -p save-config .config || true
306 kernel:
307 @$(MAKE) -C router kernel
308 @ls -l $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage
310 distclean: clean cleanimage cleankernel cleantools
311 ifneq ($(INSIDE_MAK),1)
312 @$(MAKE) -C router $@ INSIDE_MAK=1
313 endif
314 mv router/busybox/.config busybox-saved-config || true
315 @$(MAKE) -C router/busybox distclean
316 @rm -f router/busybox/config_current
317 @cp -p busybox-saved-config router/busybox/.config || true
318 @cp -p router/busybox/.config router/busybox/config_current || true
319 @rm -f router/config_current
320 @rm -f router/.config.cmd router/.config.old router/.config
321 @rm -f router/libfoo_xref.txt
322 @rm -f tomato_profile.mak router/shared/tomato_profile.h
323 @touch tomato_profile.mak
324 @touch router/shared/tomato_profile.h
327 prepk:
328 @cd $(LINUXDIR) ; \
329 rm -f config_current ; \
330 ln -s config_base config_current ; \
331 cp -f config_current .config
332 $(MAKE) -C $(LINUXDIR) oldconfig
333 ifneq ($(CONFIG_LINUX26),y)
334 $(MAKE) -C $(LINUXDIR) dep
335 endif
337 what:
338 @echo ""
339 @echo "$(current_BUILD_DESC)-$(current_BUILD_NAME)-$(TOMATO_PROFILE_NAME) Profile"
340 @echo ""
343 # The methodology for making the different builds is to
344 # copy the "base" config file to the "target" config file in
345 # the appropriate directory, and then edit it by removing and
346 # inserting the desired configuration lines.
347 # You can't just delete the "whatever=y" line, you must have
348 # a "...is not set" line, or the make oldconfig will stop and ask
349 # what to do.
351 # Options for "make bin" :
352 # BUILD_DESC (Std|Lite|Ext|...)
353 # MIPS32 (r2|r1)
354 # WNR3500LV2 (0|1)
355 # KERN_SIZE_OPT
356 # USB ("USB"|"")
357 # JFFSv1 | NO_JFFS
358 # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_HTTPS, NO_XXTP, NO_LIBOPT
359 # SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, UFSD, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM, NOCAT CTF NGINX
360 # NFS BTCLIENT BTGUI TR_EXTRAS SNMP SDHC HFS UPS DNSCRYPT PPTPD TOR IPSEC RAID MICROSD USBAP NO_USBAPP
362 define RouterOptions
363 @( \
364 if [ "$(CONFIG_LINUX26)" = "y" ] || [ "$(SAMBA3)" = "y" ]; then \
365 sed -i "/TCONFIG_SAMBA3/d" $(1); \
366 echo "TCONFIG_SAMBA3=y" >>$(1); \
367 fi; \
368 sed -i "/TCONFIG_EMF/d" $(1); \
369 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
370 if [ "$(SLIM)" = "y" ]; then \
371 echo "# TCONFIG_EMF is not set" >>$(1); \
372 else \
373 echo "TCONFIG_EMF=y" >>$(1); \
374 fi; \
375 else \
376 echo "# TCONFIG_EMF is not set" >>$(1); \
377 fi; \
378 sed -i "/TCONFIG_JFFSV1/d" $(1); \
379 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
380 if [ "$(JFFSv1)" = "y" ]; then \
381 echo "TCONFIG_JFFSV1=y" >>$(1); \
382 else \
383 echo "# TCONFIG_JFFSV1 is not set" >>$(1); \
384 fi; \
385 else \
386 echo "TCONFIG_JFFSV1=y" >>$(1); \
387 fi; \
388 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(IPSEC)" = "y" ]; then \
389 echo "TCONFIG_IPSEC=y" >>$(1); \
390 else \
391 echo "# TCONFIG_IPSEC is not set" >>$(1); \
392 fi; \
393 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(RAID)" = "y" ]; then \
394 echo "TCONFIG_RAID=y" >>$(1); \
395 else \
396 echo "# TCONFIG_RAID is not set" >>$(1); \
397 fi; \
398 if [ "$(USB)" = "USB" ]; then \
399 sed -i "/TCONFIG_USB is not set/d" $(1); \
400 echo "TCONFIG_USB=y" >>$(1); \
401 if [ "$(USBEXTRAS)" = "y" ]; then \
402 sed -i "/TCONFIG_USB_EXTRAS/d" $(1); \
403 echo "TCONFIG_USB_EXTRAS=y" >>$(1); \
404 fi; \
405 if [ "$(NTFS)" = "y" ]; then \
406 sed -i "/TCONFIG_NTFS/d" $(1); \
407 echo "TCONFIG_NTFS=y" >>$(1); \
408 fi; \
409 if [ "$(UFSD)" = "y" ]; then \
410 sed -i "/TCONFIG_UFSD/d" $(1); \
411 echo "TCONFIG_UFSD=y" >>$(1); \
412 fi; \
413 if [ "$(MEDIASRV)" = "y" ]; then \
414 sed -i "/TCONFIG_MEDIA_SERVER/d" $(1); \
415 echo "TCONFIG_MEDIA_SERVER=y" >>$(1); \
416 fi; \
417 else \
418 sed -i "/TCONFIG_USB=y/d" $(1); \
419 echo "# TCONFIG_USB is not set" >>$(1); \
420 fi; \
421 if [ "$(NO_SAMBA)" = "y" ]; then \
422 sed -i "/TCONFIG_SAMBASRV/d" $(1); \
423 echo "# TCONFIG_SAMBASRV is not set" >>$(1); \
424 fi; \
425 if [ "$(NO_ZEBRA)" = "y" ]; then \
426 sed -i "/TCONFIG_ZEBRA/d" $(1); \
427 echo "# TCONFIG_ZEBRA is not set" >>$(1); \
428 fi; \
429 if [ "$(NO_JFFS)" = "y" ]; then \
430 sed -i "/TCONFIG_JFFS2/d" $(1); \
431 echo "# TCONFIG_JFFS2 is not set" >>$(1); \
432 sed -i "/TCONFIG_JFFSV1/d" $(1); \
433 echo "# TCONFIG_JFFSV1 is not set" >>$(1); \
434 fi; \
435 if [ "$(NO_CIFS)" = "y" ]; then \
436 sed -i "/TCONFIG_CIFS/d" $(1); \
437 echo "# TCONFIG_CIFS is not set" >>$(1); \
438 fi; \
439 if [ "$(NO_SSH)" = "y" ]; then \
440 sed -i "/TCONFIG_SSH/d" $(1); \
441 echo "# TCONFIG_SSH is not set" >>$(1); \
442 fi; \
443 if [ "$(NO_HTTPS)" = "y" ]; then \
444 sed -i "/TCONFIG_HTTPS/d" $(1); \
445 echo "# TCONFIG_HTTPS is not set" >>$(1); \
446 fi; \
447 if [ "$(NO_XXTP)" = "y" ]; then \
448 sed -i "/TCONFIG_L2TP/d" $(1); \
449 echo "# TCONFIG_L2TP is not set" >>$(1); \
450 sed -i "/TCONFIG_PPTP/d" $(1); \
451 echo "# TCONFIG_PPTP is not set" >>$(1); \
452 fi; \
453 if [ "$(NO_LIBOPT)" = "y" ]; then \
454 sed -i "/TCONFIG_OPTIMIZE_SHARED_LIBS/d" $(1); \
455 echo "# TCONFIG_OPTIMIZE_SHARED_LIBS is not set" >>$(1); \
456 fi; \
457 if [ "$(EBTABLES)" = "y" ]; then \
458 sed -i "/TCONFIG_EBTABLES/d" $(1); \
459 echo "TCONFIG_EBTABLES=y" >>$(1); \
460 fi; \
461 if [ "$(IPV6SUPP)" = "y" ]; then \
462 sed -i "/TCONFIG_IPV6/d" $(1); \
463 echo "TCONFIG_IPV6=y" >>$(1); \
464 fi; \
465 if [ "$(NOCAT)" = "y" ]; then \
466 sed -i "/TCONFIG_NOCAT/d" $(1); \
467 echo "TCONFIG_NOCAT=y" >>$(1); \
468 fi; \
469 if [ "$(NGINX)" = "y" ]; then \
470 sed -i "/TCONFIG_NGINX/d" $(1); \
471 echo "TCONFIG_NGINX=y" >>$(1); \
472 fi; \
473 if [ "$(OPENVPN)" = "y" ]; then \
474 sed -i "/TCONFIG_LZO/d" $(1); \
475 echo "TCONFIG_LZO=y" >>$(1); \
476 sed -i "/TCONFIG_OPENVPN/d" $(1); \
477 echo "TCONFIG_OPENVPN=y" >>$(1); \
478 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
479 sed -i "/TCONFIG_FTP_SSL/d" $(1); \
480 echo "TCONFIG_FTP_SSL=y" >>$(1); \
481 fi; \
482 fi; \
483 if [ "$(PPTPD)" = "y" ]; then \
484 sed -i "/TCONFIG_PPTPD/d" $(1); \
485 echo "TCONFIG_PPTPD=y" >>$(1); \
486 fi; \
487 if [ "$(BTCLIENT)" = "y" ]; then \
488 sed -i "/TCONFIG_BT/d" $(1); \
489 echo "TCONFIG_BT=y" >>$(1); \
490 sed -i "/TCONFIG_BBT/d" $(1); \
491 echo "TCONFIG_BBT=y" >>$(1); \
492 fi; \
493 if [ "$(BTGUI)" = "y" ]; then \
494 sed -i "/TCONFIG_BT/d" $(1); \
495 echo "TCONFIG_BT=y" >>$(1); \
496 fi; \
497 if [ "$(TR_EXTRAS)" = "y" ]; then \
498 sed -i "/TCONFIG_TR_EXTRAS/d" $(1); \
499 echo "TCONFIG_TR_EXTRAS=y" >>$(1); \
500 fi; \
501 if [ "$(NFS)" = "y" ]; then \
502 sed -i "/TCONFIG_NFS/d" $(1); \
503 echo "TCONFIG_NFS=y" >>$(1); \
504 fi; \
505 if [ "$(SNMP)" = "y" ]; then \
506 sed -i "/TCONFIG_SNMP/d" $(1); \
507 echo "TCONFIG_SNMP=y" >>$(1); \
508 fi; \
509 if [ "$(SDHC)" = "y" ]; then \
510 sed -i "/TCONFIG_SDHC/d" $(1); \
511 echo "TCONFIG_SDHC=y" >>$(1); \
512 fi; \
513 if [ "$(DNSSEC)" = "y" ]; then \
514 sed -i "/TCONFIG_DNSSEC/d" $(1); \
515 echo "TCONFIG_DNSSEC=y" >>$(1); \
516 fi; \
517 if [ "$(HFS)" = "y" ]; then \
518 sed -i "/TCONFIG_HFS/d" $(1); \
519 echo "TCONFIG_HFS=y" >>$(1); \
520 fi; \
521 if [ "$(UPS)" = "y" ]; then \
522 sed -i "/TCONFIG_UPS/d" $(1); \
523 echo "TCONFIG_UPS=y" >>$(1); \
524 fi; \
525 if [ "$(DNSCRYPT)" = "y" ]; then \
526 sed -i "/TCONFIG_DNSCRYPT/d" $(1); \
527 echo "TCONFIG_DNSCRYPT=y" >>$(1); \
528 fi; \
529 if [ "$(NVRAM_64K)" = "y" ]; then \
530 sed -i "/TCONFIG_NVRAM_64K/d" $(1); \
531 echo "TCONFIG_NVRAM_64K=y" >>$(1); \
532 fi; \
533 if [ "$(TOR)" = "y" ]; then \
534 sed -i "/TCONFIG_TOR/d" $(1); \
535 echo "TCONFIG_TOR=y" >>$(1); \
536 fi; \
537 if [ "$(MICROSD)" = "y" ]; then \
538 sed -i "/TCONFIG_MICROSD/d" $(1); \
539 echo "TCONFIG_MICROSD=y" >>$(1); \
540 fi; \
541 if [ "$(USBAP)" = "y" ]; then \
542 sed -i "/TCONFIG_USBAP/d" $(1); \
543 echo "TCONFIG_USBAP=y" >>$(1); \
544 if [ "$(NO_USBAPP)" = "y" ]; then \
545 sed -i "/TCONFIG_REMOVE_USBAPP/d" $(1); \
546 echo "TCONFIG_REMOVE_USBAPP=y" >>$(1); \
547 sed -i "/TCONFIG_FTP/d" $(1); \
548 echo "# TCONFIG_FTP is not set" >>$(1); \
549 echo "# TCONFIG_FTP_SSL is not set" >>$(1); \
550 sed -i "/TCONFIG_SAMBA/d" $(1); \
551 echo "# TCONFIG_SAMBASRV is not set" >>$(1); \
552 echo "# TCONFIG_SAMBA3 is not set" >>$(1); \
553 fi; \
554 fi; \
555 if [ "$(ASUS_TRX)" = "RT-AC66U" ]; then \
556 sed -i "/TCONFIG_AC66U/d" $(1); \
557 echo "TCONFIG_AC66U=y" >>$(1); \
558 else \
559 sed -i "/TCONFIG_AC66U/d" $(1); \
560 echo "# TCONFIG_AC66U is not set" >>$(1); \
561 fi; \
562 if [ "$(CTF)" = "y" ]; then \
563 sed -i "/TCONFIG_CTF/d" $(1); \
564 echo "TCONFIG_CTF=y" >>$(1); \
565 fi; \
566 if [ "$(TINC)" = "y" ]; then \
567 sed -i "/TCONFIG_TINC/d" $(1); \
568 echo "TCONFIG_TINC=y" >>$(1); \
569 fi; \
571 endef
573 define BusyboxOptions
574 @( \
575 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
576 sed -i "/CONFIG_FEATURE_2_4_MODULES/d" $(1); \
577 echo "# CONFIG_FEATURE_2_4_MODULES is not set" >>$(1); \
578 sed -i "/CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT/d" $(1); \
579 echo "CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y" >>$(1); \
580 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
581 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
582 sed -i "/CONFIG_MKNOD/d" $(1); \
583 echo "CONFIG_MKNOD=y" >>$(1); \
584 sed -i "/CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE/d" $(1); \
585 echo "CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=512" >>$(1); \
586 else \
587 sed -i "/CONFIG_UDHCPC=y/d" $(1); \
588 sed -i "/CONFIG_UDHCPC_OLD/d" $(1); \
589 echo "CONFIG_UDHCPC_OLD=y" >>$(1); \
590 echo "# CONFIG_UDHCPC is not set" >>$(1); \
591 fi; \
592 if [ "$(NO_CIFS)" = "y" ]; then \
593 sed -i "/CONFIG_FEATURE_MOUNT_CIFS/d" $(1); \
594 echo "# CONFIG_FEATURE_MOUNT_CIFS is not set" >>$(1); \
595 fi; \
596 if [ "$(BBEXTRAS)" = "y" ]; then \
597 sed -i "/CONFIG_SENDMAIL/d" $(1); \
598 echo "CONFIG_SENDMAIL=y" >>$(1); \
599 sed -i "/CONFIG_WHOIS/d" $(1); \
600 echo "CONFIG_WHOIS=y" >>$(1); \
601 sed -i "/CONFIG_FEATURE_SORT_BIG/d" $(1); \
602 echo "CONFIG_FEATURE_SORT_BIG=y" >>$(1); \
603 sed -i "/CONFIG_CLEAR/d" $(1); \
604 echo "CONFIG_CLEAR=y" >>$(1); \
605 sed -i "/CONFIG_NICE/d" $(1); \
606 echo "CONFIG_NICE=y" >>$(1); \
607 sed -i "/CONFIG_SETCONSOLE/d" $(1); \
608 echo "CONFIG_SETCONSOLE=y" >>$(1); \
609 sed -i "/CONFIG_MKFIFO/d" $(1); \
610 echo "CONFIG_MKFIFO=y" >>$(1); \
611 sed -i "/CONFIG_SEQ/d" $(1); \
612 echo "CONFIG_SEQ=y" >>$(1); \
613 sed -i "/CONFIG_STTY/d" $(1); \
614 echo "CONFIG_STTY=y" >>$(1); \
615 fi; \
616 if [ "$(USB)" = "USB" ]; then \
617 if [ "$(USBEXTRAS)" = "y" ]; then \
618 sed -i "/CONFIG_E2FSCK/d" $(1); \
619 echo "CONFIG_E2FSCK=y" >>$(1); \
620 sed -i "/CONFIG_MKE2FS/d" $(1); \
621 echo "CONFIG_MKE2FS=y" >>$(1); \
622 sed -i "/CONFIG_FDISK/d" $(1); \
623 echo "CONFIG_FDISK=y" >>$(1); \
624 sed -i "/CONFIG_FEATURE_FDISK_WRITABLE/d" $(1); \
625 echo "CONFIG_FEATURE_FDISK_WRITABLE=y" >>$(1); \
626 sed -i "/CONFIG_MKFS_VFAT/d" $(1); \
627 echo "CONFIG_MKFS_VFAT=y" >>$(1); \
628 sed -i "/CONFIG_MKSWAP/d" $(1); \
629 echo "CONFIG_MKSWAP=y" >>$(1); \
630 sed -i "/CONFIG_FLOCK/d" $(1); \
631 echo "CONFIG_FLOCK=y" >>$(1); \
632 sed -i "/CONFIG_FSYNC/d" $(1); \
633 echo "CONFIG_FSYNC=y" >>$(1); \
634 sed -i "/CONFIG_TUNE2FS/d" $(1); \
635 echo "CONFIG_TUNE2FS=y" >>$(1); \
636 sed -i "/CONFIG_E2LABEL/d" $(1); \
637 echo "CONFIG_E2LABEL=y" >>$(1); \
638 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
639 sed -i "/CONFIG_LSUSB/d" $(1); \
640 echo "CONFIG_LSUSB=y" >>$(1); \
641 sed -i "/CONFIG_FEATURE_WGET_STATUSBAR/d" $(1); \
642 echo "CONFIG_FEATURE_WGET_STATUSBAR=y" >>$(1); \
643 sed -i "/CONFIG_FEATURE_VERBOSE_USAGE/d" $(1); \
644 echo "CONFIG_FEATURE_VERBOSE_USAGE=y" >>$(1); \
645 fi; \
646 fi; \
647 else \
648 sed -i "/CONFIG_FEATURE_MOUNT_LOOP/d" $(1); \
649 echo "# CONFIG_FEATURE_MOUNT_LOOP is not set" >>$(1); \
650 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
651 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
652 sed -i "/CONFIG_FEATURE_MOUNT_LABEL/d" $(1); \
653 echo "# CONFIG_FEATURE_MOUNT_LABEL is not set" >>$(1); \
654 sed -i "/CONFIG_FEATURE_MOUNT_FSTAB/d" $(1); \
655 echo "# CONFIG_FEATURE_MOUNT_FSTAB is not set" >>$(1); \
656 sed -i "/CONFIG_VOLUMEID/d" $(1); \
657 echo "# CONFIG_VOLUMEID is not set" >>$(1); \
658 sed -i "/CONFIG_BLKID/d" $(1); \
659 echo "# CONFIG_BLKID is not set" >>$(1); \
660 sed -i "/CONFIG_SWAPONOFF/d" $(1); \
661 echo "# CONFIG_SWAPONOFF is not set" >>$(1); \
662 sed -i "/CONFIG_CHROOT/d" $(1); \
663 echo "# CONFIG_CHROOT is not set" >>$(1); \
664 sed -i "/CONFIG_PIVOT_ROOT/d" $(1); \
665 echo "# CONFIG_PIVOT_ROOT is not set" >>$(1); \
666 sed -i "/CONFIG_TRUE/d" $(1); \
667 echo "# CONFIG_TRUE is not set" >>$(1); \
668 fi; \
669 if [ "$(IPV6SUPP)" = "y" ]; then \
670 sed -i "/CONFIG_FEATURE_IPV6/d" $(1); \
671 echo "CONFIG_FEATURE_IPV6=y" >>$(1); \
672 sed -i "/CONFIG_PING6/d" $(1); \
673 echo "CONFIG_PING6=y" >>$(1); \
674 sed -i "/CONFIG_TRACEROUTE6/d" $(1); \
675 echo "CONFIG_TRACEROUTE6=y" >>$(1); \
676 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
677 sed -i "/CONFIG_FEATURE_UDHCP_RFC5969/d" $(1); \
678 echo "CONFIG_FEATURE_UDHCP_RFC5969=y" >>$(1); \
679 fi; \
680 fi; \
681 if [ "$(SLIM)" = "y" ]; then \
682 sed -i "/CONFIG_AWK/d" $(1); \
683 echo "# CONFIG_AWK is not set" >>$(1); \
684 sed -i "/CONFIG_BASENAME/d" $(1); \
685 echo "# CONFIG_BASENAME is not set" >>$(1); \
686 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
687 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
688 sed -i "/CONFIG_BLKID/d" $(1); \
689 echo "# CONFIG_BLKID is not set" >>$(1); \
690 sed -i "/CONFIG_TELNET=y/d" $(1); \
691 echo "# CONFIG_TELNET is not set" >>$(1); \
692 sed -i "/CONFIG_ARPING/d" $(1); \
693 echo "# CONFIG_ARPING is not set" >>$(1); \
694 sed -i "/CONFIG_FEATURE_LS_COLOR/d" $(1); \
695 echo "# CONFIG_FEATURE_LS_COLOR is not set" >>$(1); \
696 sed -i "/CONFIG_CHOWN/d" $(1); \
697 echo "# CONFIG_CHOWN is not set" >>$(1); \
698 else \
699 sed -i "/CONFIG_FEATURE_LS_COLOR/d" $(1); \
700 echo "CONFIG_FEATURE_LS_COLOR=y" >>$(1); \
701 sed -i "/CONFIG_FEATURE_LS_COLOR_IS_DEFAULT/d" $(1); \
702 echo "CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y" >>$(1); \
703 fi; \
705 endef
707 define KernelConfig
708 @( \
709 sed -i "/CONFIG_NVRAM_SIZE/d" $(1); \
710 echo "CONFIG_NVRAM_SIZE="$(NVRAM_SIZE) >>$(1); \
711 sed -i "/CONFIG_CC_OPTIMIZE_FOR_SIZE/d" $(1); \
712 if [ "$(KERN_SIZE_OPT)" = "y" ]; then \
713 echo "CONFIG_CC_OPTIMIZE_FOR_SIZE=y" >>$(1); \
714 else \
715 echo "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set" >>$(1); \
716 fi; \
717 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(MIPS32)" = "r2" ]; then \
718 sed -i "/CONFIG_CPU_MIPS32_R1/d" $(1); \
719 echo "# CONFIG_CPU_MIPS32_R1 is not set" >>$(1); \
720 sed -i "/CONFIG_CPU_MIPS32_R2/d" $(1); \
721 echo "CONFIG_CPU_MIPS32_R2=y" >>$(1); \
722 sed -i "/CONFIG_CPU_MIPSR1/d" $(1); \
723 echo "CONFIG_CPU_MIPSR2=y" >>$(1); \
724 if [ "$(NAND)" = "y" ]; then \
725 sed -i "/CONFIG_MTD_NFLASH/d" $(1); \
726 echo "CONFIG_MTD_NFLASH=y" >>$(1); \
727 sed -i "/CONFIG_MTD_NAND/d" $(1); \
728 echo "CONFIG_MTD_NAND=y" >>$(1); \
729 echo "CONFIG_MTD_NAND_IDS=y" >>$(1); \
730 echo "# CONFIG_MTD_NAND_VERIFY_WRITE is not set" >>$(1); \
731 echo "# CONFIG_MTD_NAND_ECC_SMC is not set" >>$(1); \
732 echo "# CONFIG_MTD_NAND_MUSEUM_IDS is not set" >>$(1); \
733 echo "# CONFIG_MTD_NAND_DISKONCHIP is not set" >>$(1); \
734 echo "# CONFIG_MTD_NAND_CAFE is not set" >>$(1); \
735 echo "# CONFIG_MTD_NAND_NANDSIM is not set" >>$(1); \
736 echo "# CONFIG_MTD_NAND_PLATFORM is not set" >>$(1); \
737 echo "# CONFIG_MTD_NAND_ONENAND is not set" >>$(1); \
738 sed -i "/CONFIG_MTD_BRCMNAND/d" $(1); \
739 echo "CONFIG_MTD_BRCMNAND=y" >>$(1); \
740 fi; \
741 if [ "$(WNR3500LV2)" = "1" ]; then \
742 sed -i "/CONFIG_MTD_NFLASH/d" $(1); \
743 echo "CONFIG_MTD_NFLASH=y" >>$(1); \
744 fi; \
745 fi; \
746 if [ "$(UPS)" = "y" ]; then \
747 sed -i "/CONFIG_INPUT=m/d" $(1); \
748 echo "CONFIG_INPUT=y" >>$(1); \
749 sed -i "/CONFIG_USB=m/d" $(1); \
750 echo "CONFIG_USB=y" >>$(1); \
751 sed -i "/CONFIG_HID=m/d" $(1); \
752 echo "CONFIG_HID=y" >>$(1); \
753 sed -i "/CONFIG_USB_HID=m/d" $(1); \
754 echo "CONFIG_USB_HID=y" >>$(1); \
755 sed -i "/CONFIG_USB_HIDDEV=m/d" $(1); \
756 echo "CONFIG_USB_HIDDEV=y" >>$(1); \
757 sed -i "/CONFIG_USB_DEVICEFS=m/d" $(1); \
758 echo "CONFIG_USB_DEVICEFS=y" >>$(1); \
759 fi; \
760 if [ "$(USB)" = "" ]; then \
761 sed -i "/CONFIG_EFI_PARTITION/d" $(1); \
762 echo "# CONFIG_EFI_PARTITION is not set" >>$(1); \
763 fi; \
764 if [ "$(IPV6SUPP)" = "y" ]; then \
765 sed -i "/CONFIG_IPV6 is not set/d" $(1); \
766 echo "CONFIG_IPV6=y" >>$(1); \
767 sed -i "/CONFIG_IP6_NF_IPTABLES/d" $(1); \
768 echo "CONFIG_IP6_NF_IPTABLES=y" >>$(1); \
769 sed -i "/CONFIG_IP6_NF_MATCH_RT/d" $(1); \
770 echo "CONFIG_IP6_NF_MATCH_RT=y" >>$(1); \
771 sed -i "/CONFIG_IP6_NF_FILTER/d" $(1); \
772 echo "CONFIG_IP6_NF_FILTER=m" >>$(1); \
773 sed -i "/CONFIG_IP6_NF_TARGET_LOG/d" $(1); \
774 echo "CONFIG_IP6_NF_TARGET_LOG=m" >>$(1); \
775 sed -i "/CONFIG_IP6_NF_TARGET_REJECT/d" $(1); \
776 echo "CONFIG_IP6_NF_TARGET_REJECT=m" >>$(1); \
777 sed -i "/CONFIG_IP6_NF_MANGLE/d" $(1); \
778 echo "CONFIG_IP6_NF_MANGLE=m" >>$(1); \
779 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
780 sed -i "/CONFIG_NF_CONNTRACK_IPV6/d" $(1); \
781 echo "CONFIG_NF_CONNTRACK_IPV6=m" >>$(1); \
782 sed -i "/CONFIG_NETFILTER_XT_MATCH_HL/d" $(1); \
783 echo "CONFIG_NETFILTER_XT_MATCH_HL=m" >>$(1); \
784 sed -i "/CONFIG_IPV6_ROUTER_PREF/d" $(1); \
785 echo "CONFIG_IPV6_ROUTER_PREF=y" >>$(1); \
786 sed -i "/CONFIG_IPV6_SIT/d" $(1); \
787 echo "CONFIG_IPV6_SIT=m" >>$(1); \
788 sed -i "/CONFIG_IPV6_SIT_6RD/d" $(1); \
789 echo "CONFIG_IPV6_SIT_6RD=y" >>$(1); \
790 sed -i "/CONFIG_IPV6_MULTIPLE_TABLES/d" $(1); \
791 echo "CONFIG_IPV6_MULTIPLE_TABLES=y" >>$(1); \
792 sed -i "/CONFIG_IP6_NF_RAW/d" $(1); \
793 echo "CONFIG_IP6_NF_RAW=m" >>$(1); \
794 sed -i "/CONFIG_IPV6_OPTIMISTIC_DAD/d" $(1); \
795 echo "CONFIG_IPV6_OPTIMISTIC_DAD=y" >>$(1); \
796 sed -i "/CONFIG_IPV6_MROUTE/d" $(1); \
797 echo "CONFIG_IPV6_MROUTE=y" >>$(1); \
798 sed -i "/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
799 echo "CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
800 sed -i "/CONFIG_INET6_XFRM_TUNNEL/d" $(1); \
801 echo "CONFIG_INET6_XFRM_TUNNEL=m" >>$(1); \
802 sed -i "/CONFIG_INET6_AH/d" $(1); \
803 echo "CONFIG_INET6_AH=m" >>$(1); \
804 sed -i "/CONFIG_INET6_ESP/d" $(1); \
805 echo "CONFIG_INET6_ESP=m" >>$(1); \
806 sed -i "/CONFIG_INET6_IPCOMP/d" $(1); \
807 echo "CONFIG_INET6_IPCOMP=m" >>$(1); \
808 sed -i "/CONFIG_INET6_XFRM_MODE_TRANSPORT/d" $(1); \
809 echo "CONFIG_INET6_XFRM_MODE_TRANSPORT=m" >>$(1); \
810 sed -i "/CONFIG_INET6_XFRM_MODE_TUNNEL/d" $(1); \
811 echo "CONFIG_INET6_XFRM_MODE_TUNNEL=m" >>$(1); \
812 sed -i "/CONFIG_INET6_XFRM_MODE_BEET/d" $(1); \
813 echo "CONFIG_INET6_XFRM_MODE_BEET=m" >>$(1); \
814 else \
815 sed -i "/CONFIG_IP6_NF_CONNTRACK/d" $(1); \
816 echo "CONFIG_IP6_NF_CONNTRACK=m" >>$(1); \
817 sed -i "/CONFIG_IP6_NF_MATCH_HL/d" $(1); \
818 echo "CONFIG_IP6_NF_MATCH_HL=m" >>$(1); \
819 sed -i "/CONFIG_IP6_NF_FTP/d" $(1); \
820 echo "CONFIG_IP6_NF_FTP=m" >>$(1); \
821 sed -i "/CONFIG_IP6_NF_MATCH_LIMIT/d" $(1); \
822 echo "CONFIG_IP6_NF_MATCH_LIMIT=m" >>$(1); \
823 sed -i "/CONFIG_IP6_NF_MATCH_CONDITION/d" $(1); \
824 echo "CONFIG_IP6_NF_MATCH_CONDITION=m" >>$(1); \
825 sed -i "/CONFIG_IP6_NF_MATCH_MAC/d" $(1); \
826 echo "CONFIG_IP6_NF_MATCH_MAC=m" >>$(1); \
827 sed -i "/CONFIG_IP6_NF_MATCH_MULTIPORT/d" $(1); \
828 echo "CONFIG_IP6_NF_MATCH_MULTIPORT=m" >>$(1); \
829 sed -i "/CONFIG_IP6_NF_MATCH_MARK/d" $(1); \
830 echo "CONFIG_IP6_NF_MATCH_MARK=m" >>$(1); \
831 sed -i "/CONFIG_IP6_NF_MATCH_LENGTH/d" $(1); \
832 echo "CONFIG_IP6_NF_MATCH_LENGTH=m" >>$(1); \
833 sed -i "/CONFIG_IP6_NF_MATCH_STATE/d" $(1); \
834 echo "CONFIG_IP6_NF_MATCH_STATE=m" >>$(1); \
835 sed -i "/CONFIG_IP6_NF_TARGET_MARK/d" $(1); \
836 echo "CONFIG_IP6_NF_TARGET_MARK=m" >>$(1); \
837 sed -i "/CONFIG_IP6_NF_TARGET_TCPMSS/d" $(1); \
838 echo "CONFIG_IP6_NF_TARGET_TCPMSS=m" >>$(1); \
839 sed -i "/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
840 echo "CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
841 fi; \
842 fi; \
843 sed -i "/CONFIG_BCM57XX/d" $(1); \
844 if [ "$(BCM57)" = "y" ]; then \
845 echo "CONFIG_BCM57XX=m" >>$(1); \
846 else \
847 echo "# CONFIG_BCM57XX is not set" >>$(1); \
848 fi; \
849 if [ "$(USBAP)" = "y" ]; then \
850 echo "CONFIG_WL_USBAP=y" >>$(1); \
851 echo 'CONFIG_WL_APSTA="wlconfig_lx_router_high"' >>$(1); \
852 else \
853 echo "# CONFIG_WL_USBAP is not set" >>$(1); \
854 echo 'CONFIG_WL_APSTA="wlconfig_lx_router_apsta"' >>$(1); \
855 fi; \
856 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(EBTABLES)" = "y" ]; then \
857 sed -i "/CONFIG_BRIDGE_NF_EBTABLES/d" $(1); \
858 echo "CONFIG_BRIDGE_NF_EBTABLES=m" >>$(1); \
859 if [ "$(IPV6SUPP)" = "y" ]; then \
860 sed -i "/CONFIG_BRIDGE_EBT_IP6/d" $(1); \
861 echo "CONFIG_BRIDGE_EBT_IP6=m" >>$(1); \
862 fi; \
863 fi; \
864 sed -i "/CONFIG_NVRAM_64K/d" $(1); \
865 if [ "$(NVRAM_64K)" = "y" ]; then \
866 echo "CONFIG_NVRAM_64K=y" >>$(1); \
867 else \
868 echo "# CONFIG_NVRAM_64K is not set" >>$(1); \
869 fi \
871 endef
874 bin:
875 ifeq ($(B),)
876 @echo $@" is not a valid target!"
877 @false
878 endif
879 @cp router/config_base router/config_$(lowercase_B)
880 @cp router/busybox/config_base router/busybox/config_$(lowercase_B)
881 @cp $(LINUXDIR)/config_base $(LINUXDIR)/config_$(lowercase_B)
883 $(call RouterOptions, router/config_$(lowercase_B))
884 $(call KernelConfig, $(LINUXDIR)/config_$(lowercase_B))
885 $(call BusyboxOptions, router/busybox/config_$(lowercase_B))
887 @$(MAKE) setprofile N=$(TPROFILE) B=$(B) DESC="$(BUILD_DESC)" USB="$(USB)"
888 @$(MAKE) all
890 ## mini-USB - K24 only
892 ifneq ($(CONFIG_LINUX26),y)
893 @$(MAKE) bin BBEXTRAS=y USBEXTRAS=y B=E BUILD_DESC="mini-USB" USB="USB"
894 endif
896 ## VPN
898 ifeq ($(CONFIG_LINUX26),y)
899 @$(MAKE) bin OPENVPN=y NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=E BUILD_DESC="$(VPN)" USB="USB" DNSCRYPT=y PPTPD=y
900 else
901 @$(MAKE) bin OPENVPN=y NTFS=y BBEXTRAS=y USBEXTRAS=y B=E BUILD_DESC="$(VPN)" USB="USB" DNSCRYPT=y PPTPD=y
902 endif
904 ## BTgui-VPN
906 ifeq ($(CONFIG_LINUX26),y)
907 @$(MAKE) bin NTFS=y OPENVPN=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="BTgui-VPN" USB="USB" BTGUI=y DNSCRYPT=y PPTPD=y
908 else
909 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y B=M BUILD_DESC="BTgui" USB="USB" BTGUI=y DNSCRYPT=y PPTPD=y
910 endif
912 ## Nocat-VPN
914 ifeq ($(CONFIG_LINUX26),y)
915 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="Nocat-VPN" USB="USB" BTGUI=y NOCAT=y OPENVPN=y DNSCRYPT=y PPTPD=y
916 else
917 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y B=M BUILD_DESC="Nocat-VPN" USB="USB" BTGUI=y NOCAT=y OPENVPN=y DNSCRYPT=y PPTPD=y
918 endif
920 ## TOR-VPN
922 ifeq ($(CONFIG_LINUX26),y)
923 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="Tor-VPN" USB="USB" BTGUI=y TOR=y OPENVPN=y PPTPD=y NO_CIFS=y NO_JFFS=y
924 else
925 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y B=M BUILD_DESC="Tor-VPN" USB="USB" BTGUI=y TOR=y OPENVPN=y PPTPD=y NO_CIFS=y NO_JFFS=y
926 endif
928 ## BT
930 ifeq ($(CONFIG_LINUX26),y)
931 @$(MAKE) bin NTFS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="BT" USB="USB" BTCLIENT=y
932 else
933 @$(MAKE) bin NTFS=y USBEXTRAS=y B=M BUILD_DESC="BT" USB="USB" BTCLIENT=y
934 endif
936 ## BT-VPN
938 ifeq ($(CONFIG_LINUX26),y)
939 @$(MAKE) bin OPENVPN=y NTFS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="BT-VPN" USB="USB" BTCLIENT=y NO_JFFS=y PPTPD=y
940 else
941 @$(MAKE) bin OPENVPN=y NTFS=y USBEXTRAS=y B=M BUILD_DESC="BT-VPN" USB="USB" BTCLIENT=y NO_JFFS=y PPTPD=y
942 endif
944 ## Big-VPN
946 ifeq ($(CONFIG_LINUX26),y)
947 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=M BUILD_DESC="Big-VPN" USB="USB" BTGUI=y NFS=y NOCAT=y OPENVPN=y DNSCRYPT=y PPTPD=y NO_JFFS=y NO_CIFS=y
948 else
949 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y B=M BUILD_DESC="Big-VPN" USB="USB" BTGUI=y NOCAT=y NFS=y OPENVPN=y DNSCRYPT=y PPTPD=y NO_JJFS=y NO_CIFS=y
950 endif
952 ## Mega-VPN
954 ifeq ($(CONFIG_LINUX26),y)
955 @$(MAKE) bin OPENVPN=y NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=E BUILD_DESC="Mega-VPN" USB="USB" NOCAT=y BTCLIENT=y DNSCRYPT=y SNMP=y UPS=y PPTPD=y TR_EXTRAS=y TOR=y IPSEC=y RAID=y
957 ## All-In-One (AIO) MIPS1 - only for router with more than 8MB flash!! ZTE H618B
959 @$(MAKE) bin OPENVPN=y NTFS=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y MEDIASRV=y IPV6SUPP=y B=E BUILD_DESC="AIO" USB="USB" NOCAT=y BTCLIENT=y TR_EXTRAS=y NFS=y SNMP=y HFS=y DNSCRYPT=y UPS=y PPTPD=y TOR=y IPSEC=y RAID=y NGINX=y DNSSEC=y TINC=y
960 endif
962 #################################
964 ifeq ($(CONFIG_LINUX26),y)
966 ## Mini - targeted for Netgear routers
968 @$(MAKE) bin NO_JFFS=y NO_CIFS=y NO_ZEBRA=y B=F BUILD_DESC="Mini" USB=""
970 ## MiniIPv6 - for 4MB routers
972 @$(MAKE) bin NO_JFFS=y NO_CIFS=y NO_ZEBRA=y IPV6SUPP=y B=I BUILD_DESC="MiniIPv6" USB=""
974 ## MiniVPN - for 4MB routers
976 @$(MAKE) bin NO_JFFS=y NO_CIFS=y NO_ZEBRA=y B=V BUILD_DESC="MiniVPN" USB="" PPTPD=y OPENVPN=y
977 endif
979 ## VPN with no USB support (IPv6 in K26 build)
981 ifeq ($(CONFIG_LINUX26),y)
982 @$(MAKE) bin OPENVPN=y NO_JFFS=y B=V BUILD_DESC="IPv6-$(VPN)" USB="" PPTPD=y IPV6SUPP=y
983 else
984 @$(MAKE) bin OPENVPN=y BBEXTRAS=y BCM57=y B=V BUILD_DESC="$(VPN)" USB="" PPTPD=y
985 endif
987 ## Max build for router with 8MB flash without USB Support
989 ifeq ($(CONFIG_LINUX26),y)
990 @$(MAKE) bin OPENVPN=y BBEXTRAS=y EBTABLES=y IPV6SUPP=y B=E BUILD_DESC="Max" USB="" NOCAT=y NFS=y SNMP=y DNSCRYPT=y PPTPD=y TOR=y IPSEC=y
991 endif
993 ## SD-VPN - Only k24
995 ifneq ($(CONFIG_LINUX26),y)
996 @$(MAKE) bin OPENVPN=y BBEXTRAS=y BCM57=y B=V BUILD_DESC="SD-VPN" USB="" SDHC=y DNSCRYPT=y PPTPD=y
997 endif
1000 ## Make Mips32r2 builds ##
1001 ifeq ($(CONFIG_LINUX26),y)
1003 #AIO MIPS2 for RT-N16 and E4200
1004 r2z:
1005 @$(MAKE) z MIPS32=r2
1007 r2e:
1008 @$(MAKE) e MIPS32=r2
1010 r2c:
1011 @$(MAKE) c MIPS32=r2
1013 r2u:
1014 @$(MAKE) u MIPS32=r2
1016 r2t:
1017 @$(MAKE) t MIPS32=r2
1019 r2d:
1020 @$(MAKE) d MIPS32=r2
1022 r2g:
1023 @$(MAKE) g MIPS32=r2
1025 r2b:
1026 @$(MAKE) b MIPS32=r2
1028 r2o:
1029 @$(MAKE) o MIPS32=r2
1031 r2f:
1032 @$(MAKE) f MIPS32=r2 BELKIN=y
1034 r2i:
1035 @$(MAKE) i MIPS32=r2
1037 r2j:
1038 @$(MAKE) j MIPS32=r2
1040 r2v:
1041 @$(MAKE) v MIPS32=r2
1043 r2m:
1044 @$(MAKE) m MIPS32=r2
1046 #Linksys E-series witk 60K NVRAM builds
1047 n60z:
1048 @$(MAKE) r2z NVRAM_SIZE=60 LINKSYS_E=y
1050 n60e:
1051 @$(MAKE) r2e NVRAM_SIZE=60 LINKSYS_E=y
1053 n60c:
1054 @$(MAKE) r2c NVRAM_SIZE=60 LINKSYS_E=y
1056 n60u:
1057 @$(MAKE) r2u NVRAM_SIZE=60 LINKSYS_E=y
1059 n60t:
1060 @$(MAKE) r2t NVRAM_SIZE=60 LINKSYS_E=y
1062 n60b:
1063 @$(MAKE) r2b NVRAM_SIZE=60 LINKSYS_E=y
1065 n60d:
1066 @$(MAKE) r2d NVRAM_SIZE=60 LINKSYS_E=y
1068 n60g:
1069 @$(MAKE) r2g NVRAM_SIZE=60 LINKSYS_E=y
1071 n60o:
1072 @$(MAKE) r2o NVRAM_SIZE=60 LINKSYS_E=y
1074 n60i:
1075 @$(MAKE) r2i NVRAM_SIZE=60 LINKSYS_E=y
1077 n60j:
1078 @$(MAKE) r2j NVRAM_SIZE=60 LINKSYS_E=y
1080 n60v:
1081 @$(MAKE) r2v NVRAM_SIZE=60 LINKSYS_E=y
1083 n60m:
1084 @$(MAKE) r2m NVRAM_SIZE=60 LINKSYS_E=y
1086 #Linksys E-Series with 64K Nvram Builds
1088 n64z:
1089 @$(MAKE) r2z NVRAM_SIZE=64 LINKSYS_E_64k=y
1091 n64e:
1092 @$(MAKE) r2e NVRAM_SIZE=64 LINKSYS_E_64k=y
1094 n64c:
1095 @$(MAKE) r2c NVRAM_SIZE=64 LINKSYS_E_64k=y
1097 n64u:
1098 @$(MAKE) r2u NVRAM_SIZE=64 LINKSYS_E_64k=y
1100 n64t:
1101 @$(MAKE) r2t NVRAM_SIZE=64 LINKSYS_E_64k=y
1103 n64b:
1104 @$(MAKE) r2b NVRAM_SIZE=64 LINKSYS_E_64k=y
1106 n64d:
1107 @$(MAKE) r2d NVRAM_SIZE=64 LINKSYS_E_64k=y
1109 n64g:
1110 @$(MAKE) r2g NVRAM_SIZE=64 LINKSYS_E_64k=y
1112 n64o:
1113 @$(MAKE) r2o NVRAM_SIZE=64 LINKSYS_E_64k=y
1115 n64v:
1116 @$(MAKE) r2v NVRAM_SIZE=64 LINKSYS_E_64k=y
1118 n64m:
1119 @$(MAKE) r2m NVRAM_SIZE=64 LINKSYS_E_64k=y
1122 #Linksys E-Series with 4MB Flash (Max Flashsize=3866624)
1124 e1000v2f:
1125 @$(MAKE) bin MIPS32=r2 NVRAM_SIZE=32 LINKSYS_E1000v2=y NO_JFFS=y NO_ZEBRA=y B=F BUILD_DESC="Mini" USB="" NO_HTTPS=y KERN_SIZE_OPT=y
1127 e1000v2i:
1128 @$(MAKE) bin MIPS32=r2 NVRAM_SIZE=32 LINKSYS_E1000v2=y NO_JFFS=y NO_CIFS=y NO_ZEBRA=y IPV6SUPP=y B=I USB="" NO_HTTPS=y KERN_SIZE_OPT=y BUILD_DESC="MiniIPv6"
1130 e1200v1f:
1131 @$(MAKE) bin MIPS32=r2 NVRAM_SIZE=64 LINKSYS_E1200v1=y NO_JFFS=y NO_ZEBRA=y B=F BUILD_DESC="Mini" USB="" NO_HTTPS=y KERN_SIZE_OPT=y
1133 e1200v1i:
1134 @$(MAKE) bin MIPS32=r2 NVRAM_SIZE=64 LINKSYS_E1200v1=y NO_JFFS=y NO_CIFS=y NO_ZEBRA=y IPV6SUPP=y B=I USB="" NO_HTTPS=y KERN_SIZE_OPT=y BUILD_DESC="MiniIPv6"
1136 #Builds for WNR3500L v2
1137 v2z:
1138 @$(MAKE) z MIPS32=r2 WNR3500LV2=1 NO_JFFS=y
1140 v2e:
1141 @$(MAKE) e MIPS32=r2 WNR3500LV2=1 NO_JFFS=y
1143 #Builds with wl_high module
1144 rtn53:
1145 @$(MAKE) bin MIPS32=r2 OPENVPN=y BBEXTRAS=y EBTABLES=y NO_LIBOPT=y IPV6SUPP=y B=E BUILD_DESC="RT-N53" USB="USB" SNMP=y DNSCRYPT=y PPTPD=y TOR=y NOCAT=y USBAP=y NO_USBAPP=y
1147 e2500:
1148 @$(MAKE) bin MIPS32=r2 OPENVPN=y BBEXTRAS=y EBTABLES=y NO_LIBOPT=y IPV6SUPP=y B=E BUILD_DESC="Max" USB="USB" SNMP=y DNSCRYPT=y PPTPD=y TOR=y NOCAT=y USBAP=y NO_USBAPP=y NVRAM_SIZE=60 LINKSYS_E2500=y
1150 e3200:
1151 @$(MAKE) r2o USBAP=y NVRAM_SIZE=60 LINKSYS_E3200=y
1154 @$(MAKE) bin MIPS32=r2 OPENVPN=y BBEXTRAS=y EBTABLES=y IPV6SUPP=y B=E BUILD_DESC="TendaN6" USB="USB" TOR=y NOCAT=y DNSCRYPT=y PPTPD=y USBAP=y NO_USBAPP=y
1156 n60:
1157 @$(MAKE) bin MIPS32=r2 BBEXTRAS=y USBEXTRAS=y EBTABLES=y IPV6SUPP=y B=E BUILD_DESC="TendaN60" USB="USB" NO_JFFS=y NTFS=y MEDIASRV=y USBAP=y
1159 n60init:
1160 @$(MAKE) bin MIPS32=r2 B=E BUILD_DESC="TendaN60-init" USB="" NO_JFFS=y NO_CIFS=y NO_HTTPS=y NO_XXTP=y NO_ZEBRA=y NO_SSH=y
1162 # it`s not possible to flash tomato on this router. Maybe in the future.
1163 #l600n:
1164 # @$(MAKE) bin MIPS32=r2 OPENVPN=y BBEXTRAS=y EBTABLES=y NO_LIBOPT=y IPV6SUPP=y B=E BUILD_DESC="L600N" USB="USB" SNMP=y DNSCRYPT=y PPTPD=y TOR=y NOCAT=y USBAP=y
1166 #Builds for Asus RT-N66u with 64k NVRAM support
1167 ifeq ($(CONFIG_BCMWL6),y)
1168 r64z:
1169 @$(MAKE) z MIPS32=r2 NVRAM_64K=y MICROSD=y ASUS_TRX="RT-N66U" UFSD=y
1171 r64e:
1172 @$(MAKE) e MIPS32=r2 NVRAM_64K=y MICROSD=y ASUS_TRX="RT-N66U" UFSD=y
1173 else
1174 r64z:
1175 @$(MAKE) z MIPS32=r2 NVRAM_64K=y MICROSD=y
1177 r64e:
1178 @$(MAKE) e MIPS32=r2 NVRAM_64K=y MICROSD=y
1179 endif
1181 ifeq ($(CONFIG_BCMWL6),y)
1182 ac66e:
1183 @$(MAKE) e MIPS32=r2 NVRAM_64K=y NAND=y ASUS_TRX="RT-AC66U" UFSD=y
1185 ac66z:
1186 @$(MAKE) z MIPS32=r2 NVRAM_64K=y NAND=y ASUS_TRX="RT-AC66U" UFSD=y
1188 w1800re:
1189 @$(MAKE) e MIPS32=r2 NVRAM_64K=y ASUS_TRX="W1800R"
1191 w1800rz:
1192 @$(MAKE) z MIPS32=r2 NVRAM_64K=y ASUS_TRX="W1800R"
1194 #d1800he:
1195 # @$(MAKE) e MIPS32=r2 NVRAM_64K=y NAND=y ASUS_TRX="D1800H"
1197 #d1800hz:
1198 # @$(MAKE) z MIPS32=r2 NVRAM_64K=y NAND=y ASUS_TRX="D1800H"
1200 #ea6500e:
1201 # @$(MAKE) e MIPS32=r2 NVRAM_64K=y NAND=y ASUS_TRX="EA6500V1"
1203 #ea6500z:
1204 # @$(MAKE) z MIPS32=r2 NVRAM_64K=y NAND=y ASUS_TRX="EA6500V1"
1205 endif
1207 # end of CONFIG_LINUX26
1208 endif
1210 setprofile:
1211 echo '#ifndef TOMATO_PROFILE' > router/shared/tomato_profile.h
1212 echo '#define TOMATO_$(N) 1' >> router/shared/tomato_profile.h
1213 echo '#define PROFILE_G 1' >> router/shared/tomato_profile.h
1214 echo '#define PROFILE_N 2' >> router/shared/tomato_profile.h
1215 echo '#define TOMATO_PROFILE PROFILE_$(N)' >> router/shared/tomato_profile.h
1216 echo '#define TOMATO_PROFILE_NAME "$(N)"' >> router/shared/tomato_profile.h
1217 echo '#define TOMATO_BUILD_NAME "$(B)"' >> router/shared/tomato_profile.h
1218 echo '#define TOMATO_BUILD_DESC "$(DESC)$(EXTRA_64KDESC)"' >> router/shared/tomato_profile.h
1219 echo '#ifndef CONFIG_NVRAM_SIZE' >> router/shared/tomato_profile.h
1220 echo '#define CONFIG_NVRAM_SIZE $(NVRAM_SIZE)' >> router/shared/tomato_profile.h
1221 echo '#endif' >> router/shared/tomato_profile.h
1222 echo '#endif' >> router/shared/tomato_profile.h
1224 echo 'TOMATO_$(N) = 1' > tomato_profile.mak
1225 echo 'PROFILE_G = 1' >> tomato_profile.mak
1226 echo 'PROFILE_N = 2' >> tomato_profile.mak
1227 echo 'TOMATO_PROFILE = $$(PROFILE_$(N))' >> tomato_profile.mak
1228 echo 'TOMATO_PROFILE_NAME = "$(N)"' >> tomato_profile.mak
1229 echo 'TOMATO_BUILD = "$(B)"' >> tomato_profile.mak
1230 echo 'TOMATO_BUILD_NAME = "$(B)"' >> tomato_profile.mak
1231 echo 'TOMATO_BUILD_DESC = "$(DESC)$(EXTRA_64KDESC)"' >> tomato_profile.mak
1232 echo 'TOMATO_PROFILE_L = $(lowercase_N)' >> tomato_profile.mak
1233 echo 'TOMATO_PROFILE_U = $(uppercase_N)' >> tomato_profile.mak
1234 echo 'TOMATO_BUILD_USB = "$(USB)"' >> tomato_profile.mak
1236 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)) $(EXTRA_64KCFLAG)' >> tomato_profile.mak
1238 # Note that changes to variables in tomato_profile.mak don't
1239 # get propogated to this invocation of make!
1240 @echo ""
1241 @echo "Using $(N) profile, $(B) build config."
1242 @echo ""
1244 @cd $(LINUXDIR) ; \
1245 rm -f config_current ; \
1246 ln -s config_$(lowercase_B) config_current ; \
1247 cp -f config_current .config
1249 @cd router/busybox && \
1250 rm -f config_current ; \
1251 ln -s config_$(lowercase_B) config_current ; \
1252 cp config_current .config
1254 @cd router ; \
1255 rm -f config_current ; \
1256 ln -s config_$(lowercase_B) config_current ; \
1257 cp config_current .config
1259 @$(MAKE) -C router oldconfig
1261 help:
1262 @echo "n Mini-USB - for oruter with 4MB flash and USB port - K24 only"
1263 @echo "e VPN - (standard plus VPN, extra utilities and NTFS support)"
1264 @echo "c BTgui-VPN - (Ext plus BT gui)"
1265 @echo "d Nocat-VPN - (BTgui plus VPN plus Nocat)"
1266 @echo "g Tor-VPN - (BTgui plus VPN plus TOR Project)"
1267 @echo "t BT-VPN - (BT plus VPN)"
1268 @echo "b Big-VPN - (Big plus VPN)"
1269 @echo "o Mega-VPN - (Mega plus VPN plus NOCAT minus NFS)"
1270 ifeq ($(CONFIG_LINUX26),y)
1271 @echo "z MIPS Release 15F AIO (for routers +8MB flash)"
1272 @echo "i MiniIPv6 - (IPv6 with no USB support minus CIFS and RIPv1/2)"
1273 @echo "j MiniVPN - (VPN with no USB support minus CIFS and RIPv1/2)"
1274 endif
1275 @echo "f Mini - (no USB support minus CIFS and RIPv1/2)"
1276 @echo "v VPN (no usb) - (VPN with no USB support)" / in K26 + IPv6 support
1277 @echo "m Max (no usb) - (Max with no USB support)" / in K26 + IPv6 support
1278 @echo "w SD-VPN (no usb) - (VPN with SD-MOD and no USB support)"
1279 ifeq ($(CONFIG_LINUX26),y)
1280 @echo "r2e MIPS Release 2 VPN"
1281 @echo "r2c MIPS Release 2 BTgui-VPN"
1282 @echo "r2d MIPS Release 2 Nocat-VPN"
1283 @echo "r2g MIPS Release 2 Tor-VPN"
1284 @echo "r2t MIPS Release 2 BT-VPN"
1285 @echo "r2b MIPS Release 2 Big-VPN"
1286 @echo "r2o MIPS Release 2 Mega-VPN (for routers +8MB flash)"
1287 @echo "r2z MIPS Release 2 AIO (for routers +8MB flash)"
1288 @echo "r2v MIPS Release 2 VPN (no usb)"
1289 @echo "r2m MIPS Release 2 Max (no usb)"
1290 @echo "r2i MIPS Release 2 MiniIPv6 (for 4MB flash)"
1291 @echo "r2j MIPS Release 2 MiniVPN (for 4MB flash)"
1292 @echo "r2f MIPS Release 2 Mini (for netgear)"
1293 @echo " Linksys E-Series with 4MB Flash(E1000v2/v2.1/E1200v1)"
1294 @echo "e1000v2f Linksys E1000v2-v2.1/Cisco M10v2 Mini"
1295 @echo "e1000v2i Linksys E1000v2-v2.1/Cisco M10v2 MiniIPv6"
1296 @echo "e1200v1f Linksys E1200v1 Mini"
1297 @echo "e1200v1i Linksys E1200v1 MiniIPv6"
1298 @echo " Linksys E-Series with 60k Nvram"
1299 @echo "n60e Linksys E-series build VPN"
1300 @echo "n60c Linksys E-series build BTGui-VPN"
1301 @echo "n60d Linksys E-series build BTGui-VPN plus Nocat"
1302 @echo "n60g Linksys E-series build BTGui-VPN plus TOR Project"
1303 @echo "n60t Linksys E-series build BT-VPN"
1304 @echo "n60b Linksys E-series build Big-VPN"
1305 @echo "n60o Linksys E-series build Mega-VPN"
1306 @echo "n60z Linksys E-series build AIO"
1307 @echo "n60i Linksys E-series build Mini for E2500"
1308 @echo "n60j Linksys E-series build MiniIPv6 for E2500"
1309 @echo "n60v Linksys E-series build IPv6-VPN for E2000"
1310 @echo "n60m Linksys E-series build Max for E2000"
1311 @echo " Linksys E-Series with 64k Nvram/8MB Flash(E800/E900/E1200v2/E1500)"
1312 @echo "n64e Linksys E-series(64k Nvram) build VPN"
1313 @echo "n64c Linksys E-series(64k Nvram) build BTGui-VPN"
1314 @echo "n64d Linksys E-series(64k Nvram) build BTGui-VPN plus Nocat"
1315 @echo "n64g Linksys E-series(64k Nvram) build BTGui-VPN plus TOR Project"
1316 @echo "n64u Linksys E-series(64k Nvram) build BT"
1317 @echo "n64t Linksys E-series(64k Nvram) build BT-VPN"
1318 @echo "n64b Linksys E-series(64k Nvram) build Big-VPN"
1319 @echo "n64o Linksys E-series(64k Nvram) build Mega-VPN"
1320 @echo "n64v Linksys E-series(64k Nvram) build IPv6-VPN"
1321 @echo "n64m Linksys E-series(64k Nvram) build Max"
1322 @echo " Routers with wl_high module"
1323 @echo "rtn53 Asus RT-N53 with wl_high module (dualband support)"
1324 @echo "e2500 Linksys E2500 with wl_high module (dualband support)"
1325 @echo "e3200 Linksys E3200/E2500v3 with wl_high module (dualband support) / max 16MB"
1326 @echo "n6 Tenda N6 with wl_high module (dualband support)"
1327 @echo "n60 Tenda N60 with wl_high module (dualband support)"
1328 # @echo "l600n Rosewill L600N Build with wl_high module (dualband support)"
1329 @echo " Netgear WNR3500L v2 builds (128MB Flash)"
1330 @echo "v2e Netgear WNR3500Lv2 build VPN"
1331 @echo "v2z Netgear WNR3500Lv2 build AIO"
1332 @echo ""
1333 @echo "r64e RT-N66u build VPN"
1334 @echo "r64z RT-N66u build AIO"
1335 ifeq ($(CONFIG_BCMWL6),y)
1336 @echo " Routers with AC mode support"
1337 @echo "ac66e RT-AC66u build VPN"
1338 @echo "ac66z RT-AC66u build AIO"
1339 @echo "w1800re Tenda W1800R build VPN"
1340 @echo "w1800rz Tenda W1800R build AIO"
1341 # @echo "d1800he Buffalo D1800H build VPN"
1342 # @echo "d1800hz Buffalo D1800H build AIO"
1343 # @echo "ea6500e Linksys EA6500v1 build VPN"
1344 # @echo "ea6500z Linksys EA6500v1 build AIO"
1345 endif
1346 endif
1347 @echo ""
1348 @echo "..etc.. other build configs"
1349 @echo "clean -C router clean"
1350 @echo "cleanimage rm -rf image"
1351 @echo "cleantools clean btools, mksquashfs"
1352 @echo "cleankernel -C Linux distclean (but preserves .config)"
1353 @echo "distclean distclean of Linux & busybox (but preserve .configs)"
1354 @echo "prepk -C Linux oldconfig dep"
1356 .PHONY: all clean distclean cleanimage cleantools cleankernel prepk what setprofile help
1357 .PHONY: a b c d m nc Makefile allversions tomato_profile.mak