Revert "dropbear 0.54 update"
[tomato.git] / release / src / Makefile
blobe7951dee354a428de5d6f4c018ebf5e8eeb9c938
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 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"
51 ifeq ($(NVRAM_SIZE),)
52 NVRAM_SIZE = 0
53 endif
55 -include tomato_profile.mak
57 # This could be simpler by just using $(TOMATO_PROFILE_NAME) like it used to be,
58 # but that's fragile. If you make one certain innocuous change elsewhere in the
59 # makefile(s), the build will silently be wrong. This way it works properly every time.
60 current_BUILD_NAME = $(strip $(shell grep "^TOMATO_BUILD_NAME" tomato_profile.mak | cut -d"=" -f2))
61 current_BUILD_DESC = $(strip $(shell grep "^TOMATO_BUILD_DESC" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g"))
62 current_BUILD_USB = $(strip $(shell grep "^TOMATO_BUILD_USB" tomato_profile.mak | cut -d"=" -f2 | sed -e "s/ //g"))
63 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))
65 uppercase_N = $(shell echo $(N) | tr a-z A-Z)
66 lowercase_N = $(shell echo $(N) | tr A-Z a-z)
67 uppercase_B = $(shell echo $(B) | tr a-z A-Z)
68 lowercase_B = $(shell echo $(B) | tr A-Z a-z)
70 ifeq ($(CONFIG_LINUX26),y)
71 mips_rev = $(if $(filter $(MIPS32),r2),MIPSR2,MIPSR1)
72 KERN_SIZE_OPT ?= n
73 else
74 mips_rev =
75 KERN_SIZE_OPT ?= y
76 endif
78 beta = $(if $(filter $(TOMATO_EXPERIMENTAL),1),-beta,)
80 tomato_ver:
81 @echo ""
82 @btools/uversion.pl --gen $(V1) $(mips_rev)$(beta)$(V2) $(ND) $(current_BUILD_USB) $(current_BUILD_DESC)
84 ifeq ($(TOMATO_BUILD),)
86 all:
87 $(MAKE) a
89 else
91 all: tomato_ver
92 @echo ""
93 @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"
95 @echo ""
96 @echo ""
98 @-mkdir image
99 @$(MAKE) -C router all
100 @$(MAKE) -C router install
101 @$(MAKE) -C btools
103 @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
104 @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
105 ifeq ($(WRT54),y)
106 ifneq ($(MIPS32),r2)
107 @rm -f image/tomato-WRT54*$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
108 @rm -f image/tomato-WRTSL54*$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
109 @rm -f image/tomato-WR850G$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
110 endif
111 endif
112 ifeq ($(LINKSYS_E),y)
113 @rm -f image/tomato-E??00$(current_BUILD_USB)$(if $(filter $(NVRAM_SIZE),0),,-NVRAM$(NVRAM_SIZE)K)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
114 endif
115 ifeq ($(BELKIN),y)
116 ifneq ($(NVRAM_SIZE),60)
117 @rm -f image/tomato-F7D????$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
118 @rm -f image/tomato-F5D8235v3$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
119 endif
120 endif
121 @echo "" >>fpkg.log
122 @echo "***********************" `date` "************************" >>fpkg.log
123 @cat router/shared/tomato_version >>fpkg.log
124 @echo "" >>fpkg.log
125 @cat router/target.info >>fpkg.log
126 ifeq ($(WRT54),y)
127 ifneq ($(MIPS32),r2)
128 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
129 -l W54G,image/tomato-WRT54G_WRT54GL$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
130 -l W54S,image/tomato-WRT54GS$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
131 -l W54s,image/tomato-WRT54GSv4$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
132 -l W54U,image/tomato-WRTSL54GS$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
133 -m 0x10577050,image/tomato-WR850G$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin
134 | tee -a fpkg.log
135 endif
136 endif
137 ifeq ($(LINKSYS_E),y)
138 # Linksys E-series images
139 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
140 -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 \
141 -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 \
142 -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 \
143 | tee -a fpkg.log
144 endif
145 ifeq ($(BELKIN),y)
146 ifneq ($(NVRAM_SIZE),60)
147 # Create Belkin images
148 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
149 -b 0x20100322,image/tomato-F7D3301$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
150 -b 0x20090928,image/tomato-F7D3302$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
151 -b 0x20091006,image/tomato-F7D4302$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
152 -b 0x00017116,image/tomato-F5D8235v3$(current_BUILD_USB)-$(current_TOMATO_VER).$(V1)$(mips_rev)$(beta)$(V2)-$(current_BUILD_DESC).bin \
153 | tee -a fpkg.log
154 endif
155 endif
156 # Create generic TRX image
157 @btools/fpkg -i lzma-loader/loader.gz -i $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz -a 1024 -i router/mipsel-uclibc/target.image \
158 -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 \
159 | tee -a fpkg.log
161 @cp fpkg.log image/fpkg-$(V1)$(mips_rev)$(beta)$(V2).log
162 @echo ""
163 @echo "-----------------"
164 @echo `cat router/shared/tomato_version` " ready"
165 @echo "-----------------"
166 ifneq ($(NOVERSION),1)
167 @cp router/shared/tomato_version router/shared/tomato_version_last
168 @btools/uversion.pl --bump
169 endif
170 endif
174 clean:
175 @touch router/.config
176 @rm -f router/config_[a-z]
177 @rm -f router/busybox/config_[a-z]
178 @$(MAKE) -C router $@
179 @-rmdir router/mipsel-uclibc
181 cleanimage:
182 @rm -f fpkg.log
183 @rm -fr image/*
184 @rm -f router/.config
185 @touch router/.config
186 @-mkdir image
188 cleantools:
189 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs clean
190 @$(MAKE) -C btools clean
192 cleankernel:
193 @cd $(LINUXDIR) && \
194 mv .config save-config && \
195 $(MAKE) distclean || true; \
196 cp -p save-config .config || true
198 kernel:
199 @$(MAKE) -C router kernel
200 @ls -l $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage
202 distclean: clean cleanimage cleankernel cleantools
203 ifneq ($(INSIDE_MAK),1)
204 @$(MAKE) -C router $@ INSIDE_MAK=1
205 endif
206 mv router/busybox/.config busybox-saved-config || true
207 @$(MAKE) -C router/busybox distclean
208 @rm -f router/busybox/config_current
209 @cp -p busybox-saved-config router/busybox/.config || true
210 @cp -p router/busybox/.config router/busybox/config_current || true
211 @rm -f router/config_current
212 @rm -f router/.config.cmd router/.config.old router/.config
213 @rm -f router/libfoo_xref.txt
214 @rm -f tomato_profile.mak router/shared/tomato_profile.h
215 @touch tomato_profile.mak
216 @touch router/shared/tomato_profile.h
219 prepk:
220 @cd $(LINUXDIR) ; \
221 rm -f config_current ; \
222 ln -s config_base config_current ; \
223 cp -f config_current .config
224 $(MAKE) -C $(LINUXDIR) oldconfig
225 ifneq ($(CONFIG_LINUX26),y)
226 $(MAKE) -C $(LINUXDIR) dep
227 endif
229 what:
230 @echo ""
231 @echo "$(current_BUILD_DESC)-$(current_BUILD_NAME)-$(TOMATO_PROFILE_NAME) Profile"
232 @echo ""
235 # The methodology for making the different builds is to
236 # copy the "base" config file to the "target" config file in
237 # the appropriate directory, and then edit it by removing and
238 # inserting the desired configuration lines.
239 # You can't just delete the "whatever=y" line, you must have
240 # a "...is not set" line, or the make oldconfig will stop and ask
241 # what to do.
243 # Options for "make bin" :
244 # BUILD_DESC (Std|Lite|Ext|...)
245 # MIPS32 (r2|r1)
246 # KERN_SIZE_OPT
247 # USB ("USB"|"")
248 # JFFSv1 | NO_JFFS
249 # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_HTTPS, NO_XXTP, NO_LIBOPT
250 # SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM
251 # NOCAT
252 # SNMP
253 # USERPPTP
254 # VLAN
256 define RouterOptions
257 @( \
258 if [ "$(CONFIG_LINUX26)" = "y" ] || [ "$(SAMBA3)" = "y" ]; then \
259 sed -i "/TCONFIG_SAMBA3/d" $(1); \
260 echo "TCONFIG_SAMBA3=y" >>$(1); \
261 fi; \
262 sed -i "/TCONFIG_EMF/d" $(1); \
263 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
264 if [ "$(SLIM)" = "y" ]; then \
265 echo "# TCONFIG_EMF is not set" >>$(1); \
266 else \
267 echo "TCONFIG_EMF=y" >>$(1); \
268 fi; \
269 else \
270 echo "# TCONFIG_EMF is not set" >>$(1); \
271 fi; \
272 sed -i "/TCONFIG_JFFSV1/d" $(1); \
273 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
274 if [ "$(JFFSv1)" = "y" ]; then \
275 echo "TCONFIG_JFFSV1=y" >>$(1); \
276 else \
277 echo "# TCONFIG_JFFSV1 is not set" >>$(1); \
278 fi; \
279 else \
280 echo "TCONFIG_JFFSV1=y" >>$(1); \
281 fi; \
282 if [ "$(USB)" = "USB" ]; then \
283 sed -i "/TCONFIG_USB is not set/d" $(1); \
284 echo "TCONFIG_USB=y" >>$(1); \
285 if [ "$(USBEXTRAS)" = "y" ]; then \
286 sed -i "/TCONFIG_USB_EXTRAS/d" $(1); \
287 echo "TCONFIG_USB_EXTRAS=y" >>$(1); \
288 fi; \
289 if [ "$(NTFS)" = "y" ]; then \
290 sed -i "/TCONFIG_NTFS/d" $(1); \
291 echo "TCONFIG_NTFS=y" >>$(1); \
292 fi; \
293 if [ "$(MEDIASRV)" = "y" ]; then \
294 sed -i "/TCONFIG_MEDIA_SERVER/d" $(1); \
295 echo "TCONFIG_MEDIA_SERVER=y" >>$(1); \
296 fi; \
297 else \
298 sed -i "/TCONFIG_USB=y/d" $(1); \
299 echo "# TCONFIG_USB is not set" >>$(1); \
300 fi; \
301 if [ "$(NO_SAMBA)" = "y" ]; then \
302 sed -i "/TCONFIG_SAMBASRV/d" $(1); \
303 echo "# TCONFIG_SAMBASRV is not set" >>$(1); \
304 fi; \
305 if [ "$(NO_ZEBRA)" = "y" ]; then \
306 sed -i "/TCONFIG_ZEBRA/d" $(1); \
307 echo "# TCONFIG_ZEBRA is not set" >>$(1); \
308 fi; \
309 if [ "$(NO_JFFS)" = "y" ]; then \
310 sed -i "/TCONFIG_JFFS2/d" $(1); \
311 echo "# TCONFIG_JFFS2 is not set" >>$(1); \
312 sed -i "/TCONFIG_JFFSV1/d" $(1); \
313 echo "# TCONFIG_JFFSV1 is not set" >>$(1); \
314 fi; \
315 if [ "$(NO_CIFS)" = "y" ]; then \
316 sed -i "/TCONFIG_CIFS/d" $(1); \
317 echo "# TCONFIG_CIFS is not set" >>$(1); \
318 fi; \
319 if [ "$(NO_SSH)" = "y" ]; then \
320 sed -i "/TCONFIG_SSH/d" $(1); \
321 echo "# TCONFIG_SSH is not set" >>$(1); \
322 fi; \
323 if [ "$(NO_HTTPS)" = "y" ]; then \
324 sed -i "/TCONFIG_HTTPS/d" $(1); \
325 echo "# TCONFIG_HTTPS is not set" >>$(1); \
326 fi; \
327 if [ "$(NO_XXTP)" = "y" ]; then \
328 sed -i "/TCONFIG_L2TP/d" $(1); \
329 echo "# TCONFIG_L2TP is not set" >>$(1); \
330 sed -i "/TCONFIG_PPTP/d" $(1); \
331 echo "# TCONFIG_PPTP is not set" >>$(1); \
332 fi; \
333 if [ "$(NO_LIBOPT)" = "y" ]; then \
334 sed -i "/TCONFIG_OPTIMIZE_SHARED_LIBS/d" $(1); \
335 echo "# TCONFIG_OPTIMIZE_SHARED_LIBS is not set" >>$(1); \
336 fi; \
337 if [ "$(EBTABLES)" = "y" ]; then \
338 sed -i "/TCONFIG_EBTABLES/d" $(1); \
339 echo "TCONFIG_EBTABLES=y" >>$(1); \
340 fi; \
341 if [ "$(IPV6SUPP)" = "y" ]; then \
342 sed -i "/TCONFIG_IPV6/d" $(1); \
343 echo "TCONFIG_IPV6=y" >>$(1); \
344 fi; \
345 if [ "$(NOCAT)" = "y" ]; then \
346 sed -i "/TCONFIG_NOCAT/d" $(1); \
347 echo "TCONFIG_NOCAT=y" >>$(1); \
348 fi; \
349 if [ "$(OPENVPN)" = "y" ]; then \
350 sed -i "/TCONFIG_LZO/d" $(1); \
351 echo "TCONFIG_LZO=y" >>$(1); \
352 sed -i "/TCONFIG_OPENVPN/d" $(1); \
353 echo "TCONFIG_OPENVPN=y" >>$(1); \
354 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
355 sed -i "/TCONFIG_FTP_SSL/d" $(1); \
356 echo "TCONFIG_FTP_SSL=y" >>$(1); \
357 fi; \
358 fi; \
359 if [ "$(SNMP)" = "y" ]; then \
360 sed -i "/TCONFIG_SNMP/d" $(1); \
361 echo "TCONFIG_SNMP=y" >>$(1); \
362 fi; \
363 if [ "$(USERPPTP)" = "y" ]; then \
364 sed -i "/TCONFIG_USERPPTP/d" $(1); \
365 echo "TCONFIG_USERPPTP=y" >>$(1); \
366 fi; \
367 if [ "$(VLAN)" = "y" ]; then \
368 sed -i "/TCONFIG_VLAN/d" $(1); \
369 echo "TCONFIG_VLAN=y" >>$(1); \
370 fi; \
372 endef
374 define BusyboxOptions
375 @( \
376 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
377 sed -i "/CONFIG_FEATURE_2_4_MODULES/d" $(1); \
378 echo "# CONFIG_FEATURE_2_4_MODULES is not set" >>$(1); \
379 sed -i "/CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT/d" $(1); \
380 echo "CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y" >>$(1); \
381 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
382 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
383 sed -i "/CONFIG_MKNOD/d" $(1); \
384 echo "CONFIG_MKNOD=y" >>$(1); \
385 sed -i "/CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE/d" $(1); \
386 echo "CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=512" >>$(1); \
387 fi; \
388 if [ "$(NO_CIFS)" = "y" ]; then \
389 sed -i "/CONFIG_FEATURE_MOUNT_CIFS/d" $(1); \
390 echo "# CONFIG_FEATURE_MOUNT_CIFS is not set" >>$(1); \
391 fi; \
392 if [ "$(BBEXTRAS)" = "y" ]; then \
393 sed -i "/CONFIG_SENDMAIL/d" $(1); \
394 echo "CONFIG_SENDMAIL=y" >>$(1); \
395 sed -i "/CONFIG_FEATURE_SORT_BIG/d" $(1); \
396 echo "CONFIG_FEATURE_SORT_BIG=y" >>$(1); \
397 sed -i "/CONFIG_FTPPUT/d" $(1); \
398 echo "CONFIG_FTPPUT=y" >>$(1); \
399 sed -i "/CONFIG_FTPGET/d" $(1); \
400 echo "CONFIG_FTPGET=y" >>$(1); \
401 sed -i "/CONFIG_CLEAR/d" $(1); \
402 echo "CONFIG_CLEAR=y" >>$(1); \
403 sed -i "/CONFIG_NICE/d" $(1); \
404 echo "CONFIG_NICE=y" >>$(1); \
405 sed -i "/CONFIG_SETCONSOLE/d" $(1); \
406 echo "CONFIG_SETCONSOLE=y" >>$(1); \
407 sed -i "/CONFIG_MKFIFO/d" $(1); \
408 echo "CONFIG_MKFIFO=y" >>$(1); \
409 fi; \
410 if [ "$(USB)" = "USB" ]; then \
411 if [ "$(USBEXTRAS)" = "y" ]; then \
412 sed -i "/CONFIG_E2FSCK/d" $(1); \
413 echo "CONFIG_E2FSCK=y" >>$(1); \
414 sed -i "/CONFIG_MKE2FS/d" $(1); \
415 echo "CONFIG_MKE2FS=y" >>$(1); \
416 sed -i "/CONFIG_FDISK/d" $(1); \
417 echo "CONFIG_FDISK=y" >>$(1); \
418 sed -i "/CONFIG_FEATURE_FDISK_WRITABLE/d" $(1); \
419 echo "CONFIG_FEATURE_FDISK_WRITABLE=y" >>$(1); \
420 sed -i "/CONFIG_MKFS_VFAT/d" $(1); \
421 echo "CONFIG_MKFS_VFAT=y" >>$(1); \
422 sed -i "/CONFIG_MKSWAP/d" $(1); \
423 echo "CONFIG_MKSWAP=y" >>$(1); \
424 sed -i "/CONFIG_FLOCK/d" $(1); \
425 echo "CONFIG_FLOCK=y" >>$(1); \
426 sed -i "/CONFIG_FSYNC/d" $(1); \
427 echo "CONFIG_FSYNC=y" >>$(1); \
428 sed -i "/CONFIG_UNZIP/d" $(1); \
429 echo "CONFIG_UNZIP=y" >>$(1); \
430 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
431 sed -i "/CONFIG_LSUSB/d" $(1); \
432 echo "CONFIG_LSUSB=y" >>$(1); \
433 sed -i "/CONFIG_FEATURE_WGET_STATUSBAR/d" $(1); \
434 echo "CONFIG_FEATURE_WGET_STATUSBAR=y" >>$(1); \
435 sed -i "/CONFIG_FEATURE_VERBOSE_USAGE/d" $(1); \
436 echo "CONFIG_FEATURE_VERBOSE_USAGE=y" >>$(1); \
437 fi; \
438 fi; \
439 else \
440 sed -i "/CONFIG_FEATURE_MOUNT_LOOP/d" $(1); \
441 echo "# CONFIG_FEATURE_MOUNT_LOOP is not set" >>$(1); \
442 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
443 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
444 sed -i "/CONFIG_FEATURE_MOUNT_LABEL/d" $(1); \
445 echo "# CONFIG_FEATURE_MOUNT_LABEL is not set" >>$(1); \
446 sed -i "/CONFIG_FEATURE_MOUNT_FSTAB/d" $(1); \
447 echo "# CONFIG_FEATURE_MOUNT_FSTAB is not set" >>$(1); \
448 sed -i "/CONFIG_VOLUMEID/d" $(1); \
449 echo "# CONFIG_VOLUMEID is not set" >>$(1); \
450 sed -i "/CONFIG_BLKID/d" $(1); \
451 echo "# CONFIG_BLKID is not set" >>$(1); \
452 sed -i "/CONFIG_SWAPONOFF/d" $(1); \
453 echo "# CONFIG_SWAPONOFF is not set" >>$(1); \
454 sed -i "/CONFIG_CHROOT/d" $(1); \
455 echo "# CONFIG_CHROOT is not set" >>$(1); \
456 sed -i "/CONFIG_PIVOT_ROOT/d" $(1); \
457 echo "# CONFIG_PIVOT_ROOT is not set" >>$(1); \
458 sed -i "/CONFIG_TRUE/d" $(1); \
459 echo "# CONFIG_TRUE is not set" >>$(1); \
460 fi; \
461 if [ "$(IPV6SUPP)" = "y" ]; then \
462 sed -i "/CONFIG_FEATURE_IPV6/d" $(1); \
463 echo "CONFIG_FEATURE_IPV6=y" >>$(1); \
464 sed -i "/CONFIG_PING6/d" $(1); \
465 echo "CONFIG_PING6=y" >>$(1); \
466 sed -i "/CONFIG_TRACEROUTE6/d" $(1); \
467 echo "CONFIG_TRACEROUTE6=y" >>$(1); \
468 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
469 sed -i "/CONFIG_FEATURE_UDHCP_RFC5969/d" $(1); \
470 echo "CONFIG_FEATURE_UDHCP_RFC5969=y" >>$(1); \
471 fi; \
472 fi; \
473 if [ "$(SLIM)" = "y" ]; then \
474 sed -i "/CONFIG_AWK/d" $(1); \
475 echo "# CONFIG_AWK is not set" >>$(1); \
476 sed -i "/CONFIG_BASENAME/d" $(1); \
477 echo "# CONFIG_BASENAME is not set" >>$(1); \
478 sed -i "/CONFIG_FEATURE_DEVFS/d" $(1); \
479 echo "# CONFIG_FEATURE_DEVFS is not set" >>$(1); \
480 sed -i "/CONFIG_BLKID/d" $(1); \
481 echo "# CONFIG_BLKID is not set" >>$(1); \
482 sed -i "/CONFIG_TELNET=y/d" $(1); \
483 echo "# CONFIG_TELNET is not set" >>$(1); \
484 sed -i "/CONFIG_ARPING/d" $(1); \
485 echo "# CONFIG_ARPING is not set" >>$(1); \
486 sed -i "/CONFIG_FEATURE_LS_COLOR/d" $(1); \
487 echo "# CONFIG_FEATURE_LS_COLOR is not set" >>$(1); \
488 sed -i "/CONFIG_CHOWN/d" $(1); \
489 echo "# CONFIG_CHOWN is not set" >>$(1); \
490 else \
491 sed -i "/CONFIG_FEATURE_LS_COLOR/d" $(1); \
492 echo "CONFIG_FEATURE_LS_COLOR=y" >>$(1); \
493 sed -i "/CONFIG_FEATURE_LS_COLOR_IS_DEFAULT/d" $(1); \
494 echo "CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y" >>$(1); \
495 fi; \
497 endef
499 define KernelConfig
500 @( \
501 sed -i "/CONFIG_NVRAM_SIZE/d" $(1); \
502 echo "CONFIG_NVRAM_SIZE="$(NVRAM_SIZE) >>$(1); \
503 sed -i "/CONFIG_CC_OPTIMIZE_FOR_SIZE/d" $(1); \
504 if [ "$(KERN_SIZE_OPT)" = "y" ]; then \
505 echo "CONFIG_CC_OPTIMIZE_FOR_SIZE=y" >>$(1); \
506 else \
507 echo "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set" >>$(1); \
508 fi; \
509 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(MIPS32)" = "r2" ]; then \
510 sed -i "/CONFIG_CPU_MIPS32_R1/d" $(1); \
511 echo "# CONFIG_CPU_MIPS32_R1 is not set" >>$(1); \
512 sed -i "/CONFIG_CPU_MIPS32_R2/d" $(1); \
513 echo "CONFIG_CPU_MIPS32_R2=y" >>$(1); \
514 sed -i "/CONFIG_CPU_MIPSR1/d" $(1); \
515 echo "CONFIG_CPU_MIPSR2=y" >>$(1); \
516 fi; \
517 if [ "$(USB)" = "" ]; then \
518 sed -i "/CONFIG_EFI_PARTITION/d" $(1); \
519 echo "# CONFIG_EFI_PARTITION is not set" >>$(1); \
520 fi; \
521 if [ "$(IPV6SUPP)" = "y" ]; then \
522 sed -i "/CONFIG_IPV6 is not set/d" $(1); \
523 echo "CONFIG_IPV6=y" >>$(1); \
524 sed -i "/CONFIG_IP6_NF_IPTABLES/d" $(1); \
525 echo "CONFIG_IP6_NF_IPTABLES=y" >>$(1); \
526 sed -i "/CONFIG_IP6_NF_MATCH_RT/d" $(1); \
527 echo "CONFIG_IP6_NF_MATCH_RT=y" >>$(1); \
528 sed -i "/CONFIG_IP6_NF_FILTER/d" $(1); \
529 echo "CONFIG_IP6_NF_FILTER=m" >>$(1); \
530 sed -i "/CONFIG_IP6_NF_TARGET_LOG/d" $(1); \
531 echo "CONFIG_IP6_NF_TARGET_LOG=m" >>$(1); \
532 sed -i "/CONFIG_IP6_NF_TARGET_REJECT/d" $(1); \
533 echo "CONFIG_IP6_NF_TARGET_REJECT=m" >>$(1); \
534 sed -i "/CONFIG_IP6_NF_MANGLE/d" $(1); \
535 echo "CONFIG_IP6_NF_MANGLE=m" >>$(1); \
536 if [ "$(CONFIG_LINUX26)" = "y" ]; then \
537 sed -i "/CONFIG_NF_CONNTRACK_IPV6/d" $(1); \
538 echo "CONFIG_NF_CONNTRACK_IPV6=m" >>$(1); \
539 sed -i "/CONFIG_NETFILTER_XT_MATCH_HL/d" $(1); \
540 echo "CONFIG_NETFILTER_XT_MATCH_HL=m" >>$(1); \
541 sed -i "/CONFIG_IPV6_ROUTER_PREF/d" $(1); \
542 echo "CONFIG_IPV6_ROUTER_PREF=y" >>$(1); \
543 sed -i "/CONFIG_IPV6_SIT/d" $(1); \
544 echo "CONFIG_IPV6_SIT=m" >>$(1); \
545 sed -i "/CONFIG_IPV6_SIT_6RD/d" $(1); \
546 echo "CONFIG_IPV6_SIT_6RD=y" >>$(1); \
547 sed -i "/CONFIG_IPV6_MULTIPLE_TABLES/d" $(1); \
548 echo "CONFIG_IPV6_MULTIPLE_TABLES=y" >>$(1); \
549 sed -i "/CONFIG_IP6_NF_RAW/d" $(1); \
550 echo "CONFIG_IP6_NF_RAW=m" >>$(1); \
551 sed -i "/CONFIG_IPV6_OPTIMISTIC_DAD/d" $(1); \
552 echo "CONFIG_IPV6_OPTIMISTIC_DAD=y" >>$(1); \
553 sed -i "/CONFIG_IPV6_MROUTE/d" $(1); \
554 echo "CONFIG_IPV6_MROUTE=y" >>$(1); \
555 sed -i "/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
556 echo "CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
557 else \
558 sed -i "/CONFIG_IP6_NF_CONNTRACK/d" $(1); \
559 echo "CONFIG_IP6_NF_CONNTRACK=m" >>$(1); \
560 sed -i "/CONFIG_IP6_NF_MATCH_HL/d" $(1); \
561 echo "CONFIG_IP6_NF_MATCH_HL=m" >>$(1); \
562 sed -i "/CONFIG_IP6_NF_FTP/d" $(1); \
563 echo "CONFIG_IP6_NF_FTP=m" >>$(1); \
564 sed -i "/CONFIG_IP6_NF_MATCH_LIMIT/d" $(1); \
565 echo "CONFIG_IP6_NF_MATCH_LIMIT=m" >>$(1); \
566 sed -i "/CONFIG_IP6_NF_MATCH_CONDITION/d" $(1); \
567 echo "CONFIG_IP6_NF_MATCH_CONDITION=m" >>$(1); \
568 sed -i "/CONFIG_IP6_NF_MATCH_MAC/d" $(1); \
569 echo "CONFIG_IP6_NF_MATCH_MAC=m" >>$(1); \
570 sed -i "/CONFIG_IP6_NF_MATCH_MULTIPORT/d" $(1); \
571 echo "CONFIG_IP6_NF_MATCH_MULTIPORT=m" >>$(1); \
572 sed -i "/CONFIG_IP6_NF_MATCH_MARK/d" $(1); \
573 echo "CONFIG_IP6_NF_MATCH_MARK=m" >>$(1); \
574 sed -i "/CONFIG_IP6_NF_MATCH_LENGTH/d" $(1); \
575 echo "CONFIG_IP6_NF_MATCH_LENGTH=m" >>$(1); \
576 sed -i "/CONFIG_IP6_NF_MATCH_STATE/d" $(1); \
577 echo "CONFIG_IP6_NF_MATCH_STATE=m" >>$(1); \
578 sed -i "/CONFIG_IP6_NF_TARGET_MARK/d" $(1); \
579 echo "CONFIG_IP6_NF_TARGET_MARK=m" >>$(1); \
580 sed -i "/CONFIG_IP6_NF_TARGET_TCPMSS/d" $(1); \
581 echo "CONFIG_IP6_NF_TARGET_TCPMSS=m" >>$(1); \
582 sed -i "/CONFIG_IP6_NF_TARGET_ROUTE/d" $(1); \
583 echo "CONFIG_IP6_NF_TARGET_ROUTE=m" >>$(1); \
584 fi; \
585 fi; \
586 sed -i "/CONFIG_BCM57XX/d" $(1); \
587 if [ "$(BCM57)" = "y" ]; then \
588 echo "CONFIG_BCM57XX=m" >>$(1); \
589 else \
590 echo "# CONFIG_BCM57XX is not set" >>$(1); \
591 fi; \
592 if [ "$(CONFIG_LINUX26)" = "y" ] && [ "$(EBTABLES)" = "y" ]; then \
593 sed -i "/CONFIG_BRIDGE_NF_EBTABLES/d" $(1); \
594 echo "CONFIG_BRIDGE_NF_EBTABLES=m" >>$(1); \
595 if [ "$(IPV6SUPP)" = "y" ]; then \
596 sed -i "/CONFIG_BRIDGE_EBT_IP6/d" $(1); \
597 echo "CONFIG_BRIDGE_EBT_IP6=m" >>$(1); \
598 fi; \
599 fi; \
601 endef
604 bin:
605 ifeq ($(B),)
606 @echo $@" is not a valid target!"
607 @false
608 endif
609 @cp router/config_base router/config_$(lowercase_B)
610 @cp router/busybox/config_base router/busybox/config_$(lowercase_B)
611 @cp $(LINUXDIR)/config_base $(LINUXDIR)/config_$(lowercase_B)
613 $(call RouterOptions, router/config_$(lowercase_B))
614 $(call KernelConfig, $(LINUXDIR)/config_$(lowercase_B))
615 $(call BusyboxOptions, router/busybox/config_$(lowercase_B))
617 @$(MAKE) setprofile N=$(TPROFILE) B=$(B) DESC="$(BUILD_DESC)" USB="$(USB)"
618 @$(MAKE) all
620 ## Make the "normal" build
622 @$(MAKE) bin B=A BUILD_DESC="Std" USB="USB" VLAN="$(VLAN)" SNMP=y
624 ## Make the "normal but without SSH" build
626 @$(MAKE) bin NO_SSH=y B=B BUILD_DESC="No SSH" USB="USB" VLAN="$(VLAN)" SNMP=y
628 ## Make the "normal but without CIFS" build
630 @$(MAKE) bin NO_CIFS=y B=C BUILD_DESC="No CIFS" USB="USB" VLAN="$(VLAN)" SNMP=y
632 ## Make the "normal but without SAMBA" (Lite) build
634 ifeq ($(CONFIG_LINUX26),y)
635 @$(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)"
636 else
637 @$(MAKE) bin NO_SAMBA=y SLIM=y B=D BUILD_DESC="Lite" USB="USB" VLAN="$(VLAN)" SNMP="$(SNMP)"
638 endif
640 ## Make the "normal (with NTFS support) + VPN" build
642 ifeq ($(CONFIG_LINUX26),y)
643 @$(MAKE) bin OPENVPN=y USERPPTP=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
644 else
645 # @$(MAKE) bin OPENVPN=y USERPPTP=y NTFS=y B=E BUILD_DESC="$(VPN)" USB="USB" VLAN="$(VLAN)"
646 @$(MAKE) bin OPENVPN=y USERPPTP=y BBEXTRAS=y USBEXTRAS=y NTFS=y B=E BUILD_DESC="$(VPN)" USB="USB" SNMP=y VLAN="$(VLAN)"
647 endif
649 ## Make the "Mini: no USB, no CIFS, no Zebra" build - targeted for Netgear routers
651 @$(MAKE) bin JFFSv1=y NO_CIFS=y NO_ZEBRA=y SLIM=y B=F BUILD_DESC="Mini" USB="" VLAN="$(VLAN)"
653 ## Make the "Tiny: no JFFS, no USB, no CIFS, no Zebra" build - targeted for cheapskate routers
655 @$(MAKE) bin NO_CIFS=y NO_JFFS=y NO_ZEBRA=y SLIM=y B=FS BUILD_DESC="Tiny" USB="" VLAN="$(VLAN)"
657 ## Make the "No USB with IPv6, no Zebra" build - for 4MB routers
659 @$(MAKE) bin JFFSv1=y NO_CIFS=y NO_ZEBRA=y IPV6SUPP=y B=I BUILD_DESC="MiniIPv6" USB="" VLAN="$(VLAN)"
661 ## Make the "No USB with IPv6, no Zebra, with VPN" build - for 4MB routers
662 ifeq ($(CONFIG_LINUX26),y)
664 @$(MAKE) bin JFFSv1=y NO_CIFS=y NO_XXTP=y SLIM=y NO_SAMBA=y NO_ZEBRA=y IPV6SUPP=y OPENVPN=y USERPPTP=y NO_LIBOPT=y B=I BUILD_DESC="MiniIPv6-VPN" USB="" VLAN="$(VLAN)" SNMP="$(SNMP)"
665 endif
667 ## Make the "normal with Extras and NTFS" build
669 ifeq ($(CONFIG_LINUX26),y)
670 @$(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
671 else
672 @$(MAKE) bin NTFS=y BBEXTRAS=y USBEXTRAS=y B=M BUILD_DESC="Ext" USB="USB" VLAN="$(VLAN)" SNMP=y USERPPTP=y
673 endif
675 ## Roadkill
676 ## Make the "normal (with NTFS support) + VPN + NOCAT" build
678 ifeq ($(CONFIG_LINUX26),y)
679 @$(MAKE) bin OPENVPN=y USERPPTP=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 BUILD_DESC+="-$(NC)"
680 else
681 @$(MAKE) bin OPENVPN=y USERPPTP=y NTFS=y B=NC BUILD_DESC="$(VPN)" USB="USB" VLAN="$(VLAN)" NOCAT=y BUILD_DESC+=" $(NC)"
682 endif
684 ## Toastman
685 ## Make the "Mini: no USB, + NOCAT" build - for 4MB routers
686 ncm:
687 @$(MAKE) bin JFFSv1=y NOCAT=y B=F BUILD_DESC="Mini-NOCAT" USB="" VLAN="$(VLAN)"
689 ## Toastman
690 ## Make the "normal" build + NOCAT
691 ncs:
692 @$(MAKE) bin NOCAT=y B=A BUILD_DESC="Std-NOCAT" USB="USB" SNMP=y VLAN="$(VLAN)"
695 ## Make the "No USB" build
697 ifeq ($(CONFIG_LINUX26),y)
698 @$(MAKE) bin JFFSv1=y $(if $(filter r2, $(MIPS32)),,BCM57=y) B=S BUILD_DESC="Std" USB="" SNMP=y VLAN="$(VLAN)"
699 else
700 @$(MAKE) bin BBEXTRAS=y BCM57=y B=S BUILD_DESC="Std" USB="" VLAN="$(VLAN)"
701 endif
704 ## Make the "No USB with Extras" build (K26 only, for 8MB flash)
705 ifeq ($(CONFIG_LINUX26),y)
707 @$(MAKE) bin B=S USB="" BBEXTRAS=y EBTABLES=y NO_LIBOPT=y $(if $(filter r2, $(MIPS32)),,BCM57=y) IPV6SUPP=y BUILD_DESC="Std" SNMP=y VLAN="$(VLAN)"
708 ## Make the "No USB with OpenVPN and Extras" build (K26 only, for 8MB flash)
710 @$(MAKE) bin B=V 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)"
711 endif
713 ## Make the "VPN with no USB support" build
715 ifeq ($(CONFIG_LINUX26),y)
716 @$(MAKE) bin OPENVPN=y USERPPTP=y NO_JFFS=y B=V BUILD_DESC="$(VPN)" USB="" SNMP=y VLAN="$(VLAN)"
717 else
718 @$(MAKE) bin OPENVPN=y USERPPTP=y BBEXTRAS=y BCM57=y B=V BUILD_DESC="$(VPN)" USB="" SNMP=y VLAN="$(VLAN)"
719 endif
721 ## Make the "Small VPN with no USB support" build
723 ifeq ($(CONFIG_LINUX26),y)
724 @$(MAKE) bin OPENVPN=y USERPPTP=y NO_JFFS=y NO_CIFS=y B=V BUILD_DESC="SmallVPN" USB=""
725 else
726 @$(MAKE) bin OPENVPN=y USERPPTP=y NO_JFFS=y NO_CIFS=y BCM57=y B=VS BUILD_DESC="SmallVPN" USB=""
727 endif
729 ## Make Mips32r2 builds
731 r2a:
732 @$(MAKE) a MIPS32=r2
734 r2b:
735 @$(MAKE) b MIPS32=r2
737 r2c:
738 @$(MAKE) c MIPS32=r2
740 r2d:
741 @$(MAKE) d MIPS32=r2
743 r2e:
744 @$(MAKE) e MIPS32=r2
746 r2f:
747 @$(MAKE) f MIPS32=r2 BELKIN=y
749 r2i:
750 @$(MAKE) i MIPS32=r2
752 r2j:
753 @$(MAKE) j MIPS32=r2
755 r2m:
756 @$(MAKE) m MIPS32=r2
758 r2n:
759 @$(MAKE) n MIPS32=r2
761 r2nc:
762 @$(MAKE) nc MIPS32=r2
764 r2r:
765 @$(MAKE) r MIPS32=r2
767 r2s:
768 @$(MAKE) s MIPS32=r2
770 r2t:
771 @$(MAKE) t MIPS32=r2
773 r2v:
774 @$(MAKE) v MIPS32=r2
776 r2vs:
777 @$(MAKE) vs MIPS32=r2
779 n60a:
780 @$(MAKE) r2a NVRAM_SIZE=60 LINKSYS_E=y
782 n60b:
783 @$(MAKE) r2b NVRAM_SIZE=60 LINKSYS_E=y
785 n60c:
786 @$(MAKE) r2c NVRAM_SIZE=60 LINKSYS_E=y
788 n60e:
789 @$(MAKE) r2e NVRAM_SIZE=60 LINKSYS_E=y
791 n60m:
792 @$(MAKE) r2m NVRAM_SIZE=60 LINKSYS_E=y
794 n60n:
795 @$(MAKE) r2n NVRAM_SIZE=60 LINKSYS_E=y
797 n60nc:
798 @$(MAKE) r2nc NVRAM_SIZE=60 LINKSYS_E=y
800 n60o:
801 @$(MAKE) r2o NVRAM_SIZE=60 LINKSYS_E=y
803 n60r:
804 @$(MAKE) r2r NVRAM_SIZE=60 LINKSYS_E=y
806 n60s:
807 @$(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"
809 n60t:
810 @$(MAKE) r2t NVRAM_SIZE=60 LINKSYS_E=y
812 n60v:
813 @$(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)"
816 setprofile:
817 echo '#ifndef TOMATO_PROFILE' > router/shared/tomato_profile.h
818 echo '#define TOMATO_$(N) 1' >> router/shared/tomato_profile.h
819 echo '#define PROFILE_G 1' >> router/shared/tomato_profile.h
820 echo '#define PROFILE_N 2' >> router/shared/tomato_profile.h
821 echo '#define TOMATO_PROFILE PROFILE_$(N)' >> router/shared/tomato_profile.h
822 echo '#define TOMATO_PROFILE_NAME "$(N)"' >> router/shared/tomato_profile.h
823 echo '#define TOMATO_BUILD_NAME "$(B)"' >> router/shared/tomato_profile.h
824 echo '#define TOMATO_BUILD_DESC "$(DESC)"' >> router/shared/tomato_profile.h
825 echo '#ifndef CONFIG_NVRAM_SIZE' >> router/shared/tomato_profile.h
826 echo '#define CONFIG_NVRAM_SIZE $(NVRAM_SIZE)' >> router/shared/tomato_profile.h
827 echo '#endif' >> router/shared/tomato_profile.h
828 echo '#endif' >> router/shared/tomato_profile.h
830 echo 'TOMATO_$(N) = 1' > tomato_profile.mak
831 echo 'PROFILE_G = 1' >> tomato_profile.mak
832 echo 'PROFILE_N = 2' >> tomato_profile.mak
833 echo 'TOMATO_PROFILE = $$(PROFILE_$(N))' >> tomato_profile.mak
834 echo 'TOMATO_PROFILE_NAME = "$(N)"' >> tomato_profile.mak
835 echo 'TOMATO_BUILD = "$(B)"' >> tomato_profile.mak
836 echo 'TOMATO_BUILD_NAME = "$(B)"' >> tomato_profile.mak
837 echo 'TOMATO_BUILD_DESC = "$(DESC)"' >> tomato_profile.mak
838 echo 'TOMATO_PROFILE_L = $(lowercase_N)' >> tomato_profile.mak
839 echo 'TOMATO_PROFILE_U = $(uppercase_N)' >> tomato_profile.mak
840 echo 'TOMATO_BUILD_USB = "$(USB)"' >> tomato_profile.mak
842 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
844 # Note that changes to variables in tomato_profile.mak don't
845 # get propogated to this invocation of make!
846 @echo ""
847 @echo "Using $(N) profile, $(B) build config."
848 @echo ""
850 @cd $(LINUXDIR) ; \
851 rm -f config_current ; \
852 ln -s config_$(lowercase_B) config_current ; \
853 cp -f config_current .config
855 @cd router/busybox && \
856 rm -f config_current ; \
857 ln -s config_$(lowercase_B) config_current ; \
858 cp config_current .config
860 @cd router ; \
861 rm -f config_current ; \
862 ln -s config_$(lowercase_B) config_current ; \
863 cp config_current .config
865 @$(MAKE) -C router oldconfig
867 help:
868 @echo "a A build (standard)"
869 @echo "b B build (standard minus SSH)"
870 @echo "c C build (standard minus CIFS)"
871 @echo "d D build (standard minus Samba server)"
872 @echo "m M build (standard plus extra utilities and NTFS support)"
873 @echo "nc NC build (standard plus VPN, extra utilities, NTFS support and NOCAT)"
874 @echo "ncm NCS build (no USB support, NOCAT)"
875 @echo "ncs NCS build (std + NOCAT)"
876 @echo "m Ext - (standard plus extra utilities and NTFS support)"
878 ifeq ($(CONFIG_LINUX26),y)
879 @echo "e E build (standard plus VPN, extra utilities and NTFS support)"
880 @echo "i I build (IPv6 with no USB support minus CIFS and RIPv1/2)"
881 else
882 @echo "e E build (standard plus VPN and NTFS support)"
883 endif
884 @echo "s S build (no USB support)"
885 @echo "f F build (no USB support minus CIFS and RIPv1/2)"
886 @echo "v V build (VPN with no USB support)"
888 ifeq ($(CONFIG_LINUX26),y)
889 @echo "r2a MIPS Release 2 A build (standard)"
890 @echo "r2b MIPS Release 2 B build (standard minus SSH)"
891 @echo "r2c MIPS Release 2 V build (standard minus CIFS)"
892 @echo "r2d MIPS Release 2 D build (standard minus Samba server)"
893 @echo "r2e MIPS Release 2 E build (standard plus VPN and extras)"
894 @echo "r2f MIPS Release 2 F build (no USB support minus CIFS and RIPv1/2)"
895 @echo "r2i MIPS Release 2 I build (IPv6 with no USB support minus CIFS and RIPv1/2)"
896 @echo "r2m MIPS Release 2 M build (standard plus extras)"
897 @echo "r2nc MIPS Release 2 NC build (standard plus VPN, extras and NOCAT)"
898 @echo "r2s MIPS Release 2 S build (no USB support)"
899 @echo "r2v MIPS Release 2 V build (VPN with no USB support)"
900 @echo "r2v MIPS Release 2 V build (Small VPN with no USB support)"
901 @echo "n60m Linksys E-series build (60KB NVRAM, standard plus extras)"
902 @echo "n60e Linksys E-series build (60KB NVRAM, standard plus VPN and extras)"
903 @echo "n60nc Linksys E-series build (60KB NVRAM, standard plus extras, plus VPN, plus NOCAT)"
904 @echo "n60s Linksys E-series build (60KB NVRAM, no USB support)"
905 @echo "n60v Linksys E-series build (60KB NVRAM, VPN with no USB support)"
906 endif
907 @echo "..etc.. other build configs"
908 @echo "clean -C router clean"
909 @echo "cleanimage rm -rf image"
910 @echo "cleantools clean btools, mksquashfs"
911 @echo "cleankernel -C Linux distclean (but preserves .config)"
912 @echo "distclean distclean of Linux & busybox (but preserve .configs)"
913 @echo "prepk -C Linux oldconfig dep"
915 .PHONY: all clean distclean cleanimage cleantools cleankernel prepk what setprofile help
916 .PHONY: a b c d m Makefile allversions tomato_profile.mak