Don't stop on error during make clean
[tomato.git] / release / src / router / Makefile
blob8440633f26a92394387cd22bbb5bf1e58039b099
2 # Broadcom Linux Router Makefile
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.
14 include common.mak
16 #TOMATO_EXPERIMENTAL=0
21 SEP=echo "\033[41;1m $@ \033[0m"
24 # standard packages
26 obj-y += lzma-loader
27 obj-y += nvram
28 obj-y += shared
29 obj-y += prebuilt
30 obj-y += igmpproxy
31 obj-y += iptables
32 obj-y += rc
33 obj-y += iproute2
34 obj-y += rom
35 obj-y += others
36 obj-y += busybox
37 obj-y += httpd
38 obj-y += www
39 obj-y += bridge
40 obj-y += dnsmasq
41 obj-y += etc
42 # obj-y += vlan # use Busybox vconfig
43 obj-y += pppd
44 obj-y += rp-pppoe
45 obj-y += utils
46 obj-y += ntpc
47 obj-y += rstats
48 obj-$(TCONFIG_SNMP) += snmp
49 obj-y += cstats
50 obj-y += udpxy
52 # !!TB - updated Broadcom Wireless driver
53 obj-y += et
54 obj-y += libbcmcrypto
55 obj-y += wlconf
57 obj-y += cyassl
58 obj-y += mssl
59 obj-y += mdu
61 #Roadkill
62 obj-$(TCONFIG_NOCAT) += nocat
63 # !!TB
64 obj-$(TCONFIG_USB) += p910nd
66 ifeq ($(CONFIG_LINUX26),y)
67 obj-$(TCONFIG_USB) += sd-idle
68 else
69 obj-$(TCONFIG_USB) += scsi-idle
70 endif
72 obj-y += libusb10
73 #obj-y += libusb
74 obj-y += usbmodeswitch
75 obj-$(TCONFIG_FTP) += vsftpd
77 ifeq ($(CONFIG_LINUX26),y)
78 ifeq ($(TCONFIG_SAMBASRV),y)
79 NEED_EX_NLS = y
80 endif
81 ifeq ($(TCONFIG_USB_EXTRAS),y)
82 NEED_EX_USB = y
83 endif
84 endif
86 ifeq ($(TCONFIG_SAMBASRV),y)
87 ifeq ($(TCONFIG_SAMBA3),y)
88 NEED_SAMBA3 = y
89 else
90 NEED_SAMBA2 = y
91 endif
92 endif
94 ifeq ($(TCONFIG_IPV6),y)
95 export TCONFIG_IPV6 := y
96 else
97 TCONFIG_IPV6 :=
98 endif
100 obj-$(NEED_SAMBA2) += samba
101 obj-$(NEED_SAMBA3) += samba3
102 obj-$(TCONFIG_NTFS) += ntfs-3g
103 obj-$(TCONFIG_EBTABLES) += ebtables
104 obj-$(TCONFIG_IPV6) += radvd
105 obj-$(TCONFIG_IPV6) += dhcpv6
107 obj-$(TCONFIG_MEDIA_SERVER) += zlib
108 obj-$(TCONFIG_MEDIA_SERVER) += sqlite
109 obj-$(TCONFIG_MEDIA_SERVER) += ffmpeg
110 obj-$(TCONFIG_MEDIA_SERVER) += libogg
111 obj-$(TCONFIG_MEDIA_SERVER) += flac
112 obj-$(TCONFIG_MEDIA_SERVER) += jpeg
113 obj-$(TCONFIG_MEDIA_SERVER) += libexif
114 obj-$(TCONFIG_MEDIA_SERVER) += libid3tag
115 obj-$(TCONFIG_MEDIA_SERVER) += libvorbis
116 obj-$(TCONFIG_MEDIA_SERVER) += minidlna
117 MEDIA_SERVER_STATIC=y
119 obj-y += miniupnpd
120 # obj-y += upnp
122 # configurable packages
124 obj-$(TCONFIG_L2TP) += xl2tpd
125 obj-$(TCONFIG_PPTP) += accel-pptp
126 obj-$(TCONFIG_PPTPD) += pptpd
127 obj-$(TCONFIG_HTTPS) += openssl
128 obj-$(TCONFIG_SSH) += dropbear
129 obj-$(TCONFIG_ZEBRA) += zebra
130 # obj-$(TCONFIG_IPP2P) += ipp2p
131 obj-$(TCONFIG_LZO) += lzo
132 obj-$(TCONFIG_OPENVPN) += openvpn
133 obj-$(TCONFIG_EMF) += emf
134 obj-$(TCONFIG_EMF) += igs
136 obj-$(CONFIG_LINUX26) += hotplug2
137 obj-$(CONFIG_LINUX26) += udevtrigger
139 ifeq ($(TCONFIG_OPENVPN),y)
140 export FULL_OPENSSL := y
141 else
142 ifeq ($(TCONFIG_FTP_SSL),y)
143 export FULL_OPENSSL := y
144 else
145 FULL_OPENSSL :=
146 endif
147 endif
149 obj-y += wanuptime
151 obj-clean := $(foreach obj, $(obj-y) $(obj-n) $(obj-), $(obj)-clean)
152 obj-install := $(foreach obj,$(obj-y),$(obj)-install)
155 # Basic rules
158 all: clean-build libc $(obj-y) kernel
161 kernel: $(LINUXDIR)/.config
162 @$(SEP)
164 @if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
165 $(MAKE) -C $(LINUXDIR) zImage CC=$(KERNELCC); \
167 if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
168 $(MAKE) -C $(LINUXDIR) modules CC=$(KERNELCC); \
170 ifeq ($(CONFIG_LINUX26),y)
171 $(MAKE) -C $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed srctree=$(LINUXDIR)
172 endif
175 lzma-loader:
176 $(MAKE) -C $(SRCBASE)/lzma-loader CROSS_COMPILE=$(CROSS_COMPILE) LD=$(LD)
178 lzma-loader-install: lzma-loader
179 @$(SEP)
182 kmod: dummy
183 $(MAKE) -C $(LINUXDIR) modules CC=$(KERNELCC)
185 testfind:
186 cd $(TARGETDIR)/lib/modules/* && find -name "*.o" -exec mv -i {} . \; || true
187 cd $(TARGETDIR)/lib/modules/* && find -type d -delete || true
189 install package: $(obj-install) $(LINUXDIR)/.config
190 @$(SEP)
192 install -d $(TARGETDIR)
195 # kernel modules
196 $(MAKE) -C $(LINUXDIR) modules_install \
197 INSTALL_MOD_STRIP="--strip-debug -x -R .comment -R .note -R .pdr -R .mdebug.abi32 -R .note.gnu.build-id -R .gnu.attributes -R .reginfo" \
198 DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
200 ifneq ($(CONFIG_LINUX26),y)
201 find $(TARGETDIR)/lib/modules -name wl.*o -exec $(STRIP) --strip-unneeded -x {} \;
202 find $(TARGETDIR)/lib/modules -name et.*o -exec $(STRIP) --strip-unneeded -x {} \;
203 find $(TARGETDIR)/lib/modules -name bcm57*.*o -exec $(STRIP) --strip-unneeded -x {} \;
204 find $(TARGETDIR)/lib/modules -name ctf.*o -exec $(STRIP) --strip-unneeded -x {} \;
205 find $(TARGETDIR)/lib/modules -name emf.*o -exec $(STRIP) --strip-unneeded -x {} \;
206 find $(TARGETDIR)/lib/modules -name igs.*o -exec $(STRIP) --strip-unneeded -x {} \;
207 find $(TARGETDIR)/lib/modules -name jffs*.*o -exec $(STRIP) --strip-unneeded -x {} \;
209 find $(TARGETDIR)/lib/modules -name *.*o -exec $(STRIP) --strip-debug -x -R .mdebug.abi32 {} \;
210 endif
212 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv diag/* . && rm -rf diag
214 # nice and clean
215 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et.4702/* . && rm -rf et.4702 || true
216 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et/* . && rm -rf et
217 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv wl/* . && rm -rf wl
218 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv cifs/* . && rm -rf cifs
219 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs2/* . && rm -rf jffs2 || true
220 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs/* . && rm -rf jffs || true
221 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_inflate/* . && rm -rf zlib_inflate || true
222 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_deflate/* . && rm -rf zlib_deflate || true
223 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv lzo/* . && rm -rf lzo || true
224 rm -rf $(TARGETDIR)/lib/modules/*/pcmcia
226 ##!!TB
227 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext2/* . && rm -rf ext2 || true
228 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext3/* . && rm -rf ext3 || true
229 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jbd/* . && rm -rf jbd || true
230 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fat/* . && rm -rf fat || true
231 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jfs/* . && rm -rf jfs || true
232 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv vfat/* . && rm -rf vfat || true
233 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv msdos/* . && rm -rf msdos || true
234 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fuse/* . && rm -rf fuse || true
235 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ntfs/* . && rm -rf ntfs || true
236 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv smbfs/* . && rm -rf smbfs || true
237 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv reiserfs/* . && rm -rf reiserfs || true
238 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfs/* . && rm -rf hfs || true
239 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfsplus/* . && rm -rf hfsplus || true
240 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv lockd/* . && rm -rf lockd || true
241 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfsd/* . && rm -rf nfsd || true
242 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfs/* . && rm -rf nfs || true
243 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv xfs/* . && rm -rf xfs || true
244 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nls/* . && rm -rf nls || true
245 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv exportfs/* . && rm -rf exportfs || true
246 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv sunrpc/* . && rm -rf sunrpc || true
247 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv auth_gss/* . && rm -rf auth_gss || true
248 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv oss/* . && rm -rf oss || true
249 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv seq/* . && rm -rf seq || true
250 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv core/* . && rm -rf core || true
251 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv usb/* . && rm -rf usb || true
252 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv hcd/* . && rm -rf hcd || true
253 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv host/* . && rm -rf host || true
254 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv storage/* . && rm -rf storage || true
255 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv serial/* . && rm -rf serial || true
256 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv core/* . && rm -rf core || true
257 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv class/* . && rm -rf class || true
258 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv misc/* . && rm -rf misc || true
259 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv usbip/* . && rm -rf usbip || true
260 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv core/* . && rm -rf core || true
261 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv card/* . && rm -rf card || true
262 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv host/* . && rm -rf host || true
263 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/hid && mv usbhid/* . && rm -rf usbhid || true
264 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv joystick/* . && rm -rf joystick || true
265 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv keyboard/* . && rm -rf keyboard || true
266 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv misc/* . && rm -rf misc || true
267 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv mouse/* . && rm -rf mouse || true
268 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv uvc/* . && rm -rf uvc || true
269 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv pwc/* . && rm -rf pwc || true
270 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv gl860/* . && rm -rf gl860 || true
271 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv m5602/* . && rm -rf m5602 || true
272 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv stv06xx/* . && rm -rf stv06xx || true
273 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv gspca/* . && rm -rf gspca || true
274 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media && mv video/* . && rm -rf video || true
276 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv bcm57xx/* . && rm -rf bcm57xx || true
277 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv emf/* . && rm -rf emf || true
278 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv igs/* . && rm -rf igs || true
279 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv ctf/* . && rm -rf ctf || true
280 cd $(TARGETDIR)/lib/modules && rm -f */source || true
282 # misc
283 for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
284 (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
285 done
287 ifneq ($(TCONFIG_L7),y)
288 rm -f $(TARGETDIR)/usr/lib/iptables/libipt_layer7.so
289 endif
291 # uClibc
292 install $(LIBDIR)/ld-uClibc.so.0 $(TARGETDIR)/lib/
293 install $(LIBDIR)/libcrypt.so.0 $(TARGETDIR)/lib/
294 install $(LIBDIR)/libpthread.so.0 $(TARGETDIR)/lib/
295 install $(LIBDIR)/libgcc_s.so.1 $(TARGETDIR)/lib/
296 $(STRIP) $(TARGETDIR)/lib/libgcc_s.so.1
297 install $(LIBDIR)/libc.so.0 $(TARGETDIR)/lib/
298 install $(LIBDIR)/libdl.so.0 $(TARGETDIR)/lib/
299 install $(LIBDIR)/libm.so.0 $(TARGETDIR)/lib/
300 install $(LIBDIR)/libnsl.so.0 $(TARGETDIR)/lib/
301 ifeq ($(TCONFIG_SSH),y)
302 install $(LIBDIR)/libutil.so.0 $(TARGETDIR)/lib/
303 endif
304 ifneq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
305 install $(LIBDIR)/libresolv.so.0 $(TARGETDIR)/lib/
306 $(STRIP) $(TARGETDIR)/lib/*.so.0
307 endif
309 @cd $(TARGETDIR) && $(TOP)/others/rootprep.sh
311 @echo ---
313 ifeq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
314 @$(SRCBASE)/btools/libfoo.pl
315 else
316 @$(SRCBASE)/btools/libfoo.pl --noopt
317 endif
318 @chmod 0555 $(TARGETDIR)/lib/*.so*
319 @chmod 0555 $(TARGETDIR)/usr/lib/*.so*
321 # !!TB - moved to run after libfoo.pl - to make sure shared libs include all symbols needed by extras
322 # separated/copied extra stuff
323 @rm -rf $(PLATFORMDIR)/extras
324 @mkdir $(PLATFORMDIR)/extras
325 @mv $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/ip_gre.*o $(PLATFORMDIR)/extras/ || true
327 $(if $(TCONFIG_OPENVPN),@cp -f,$(if $(TCONFIG_USB_EXTRAS),@cp -f,$(if $(TCONFIG_IPV6),@cp -f,@mv))) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/tun.*o $(PLATFORMDIR)/extras/ || true
328 $(if $(TCONFIG_EBTABLES),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/bridge/netfilter/ebt*.*o $(PLATFORMDIR)/extras/ || true
330 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ifb.*o $(PLATFORMDIR)/extras/ || true
331 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sched/sch_red.*o $(PLATFORMDIR)/extras/ || true
332 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/ntfs.*o $(PLATFORMDIR)/extras/ || true
333 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/smbfs.*o $(PLATFORMDIR)/extras/ || true
334 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/reiserfs.*o $(PLATFORMDIR)/extras/ || true
335 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/jfs.*o $(PLATFORMDIR)/extras/ || true
336 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/nfs.*o $(PLATFORMDIR)/extras/ || true
337 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/nfsd.*o $(PLATFORMDIR)/extras/ || true
338 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/lockd.*o $(PLATFORMDIR)/extras/ || true
339 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/exportfs.*o $(PLATFORMDIR)/extras/ || true
340 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sunrpc.*o $(PLATFORMDIR)/extras/ || true
341 @mv $(TARGETDIR)/lib/modules/*/kernel/net/auth_rpcgss.*o $(PLATFORMDIR)/extras/ || true
342 @mv $(TARGETDIR)/lib/modules/*/kernel/net/rpcsec_gss_krb5.*o $(PLATFORMDIR)/extras/ || true
343 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/xfs.*o $(PLATFORMDIR)/extras/ || true
344 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi/sr_mod.*o $(PLATFORMDIR)/extras/ || true
345 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/scanner.*o $(PLATFORMDIR)/extras/ || true
347 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbserial.*o $(PLATFORMDIR)/extras/ || true
348 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/option.*o $(PLATFORMDIR)/extras/ || true
349 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/sierra.*o $(PLATFORMDIR)/extras/ || true
350 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/*acm.*o $(PLATFORMDIR)/extras/ || true
351 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ftdi_sio.*o $(PLATFORMDIR)/extras/ || true
352 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/pl2303.*o $(PLATFORMDIR)/extras/ || true
353 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc/*.*o $(PLATFORMDIR)/extras/ || true
354 $(if $(NEED_EX_USB),@ls,@rm -rf) $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc || true
356 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbip*.*o $(PLATFORMDIR)/extras/ || true
357 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbkbd.*o $(PLATFORMDIR)/extras/ || true
358 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbmouse.*o $(PLATFORMDIR)/extras/ || true
359 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/hid*.*o $(PLATFORMDIR)/extras/ || true
360 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ipw.*o $(PLATFORMDIR)/extras/ || true
361 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/audio.*o $(PLATFORMDIR)/extras/ || true
362 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ov51*.*o $(PLATFORMDIR)/extras/ || true
363 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/pwc*.*o $(PLATFORMDIR)/extras/ || true
364 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/emi*.*o $(PLATFORMDIR)/extras/ || true
365 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/mii.*o $(PLATFORMDIR)/extras/ || true
366 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/cdc_ether.*o $(PLATFORMDIR)/extras/ || true
367 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/cdc_subset.*o $(PLATFORMDIR)/extras/ || true
368 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/usbnet.*o $(PLATFORMDIR)/extras/ || true
369 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/rndis_host.*o $(PLATFORMDIR)/extras/ || true
370 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb || true
371 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/media/* $(PLATFORMDIR)/extras/ || true
372 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/media || true
373 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/sound/* $(PLATFORMDIR)/extras/ || true
374 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/sound || true
375 @mv $(TARGETDIR)/lib/modules/*/kernel/sound/* $(PLATFORMDIR)/extras/ || true
376 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/sound || true
377 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/input/* $(PLATFORMDIR)/extras/ || true
378 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/input || true
379 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/hid/* $(PLATFORMDIR)/extras/ || true
380 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/hid || true
381 @cp -f $(TARGETDIR)/lib/modules/*/kernel/drivers/net/bcm57*.*o $(PLATFORMDIR)/extras/ || true
382 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ctf*.*o $(PLATFORMDIR)/extras/ || true
383 $(if $(TCONFIG_PPTP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pptp.*o $(PLATFORMDIR)/extras/ || true
384 $(if $(TCONFIG_L2TP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pppol2tp.*o $(PLATFORMDIR)/extras/ || true
385 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ppp_deflate.*o $(PLATFORMDIR)/extras/ || true
386 @mv $(TARGETDIR)/lib/modules/*/kernel/crypto/* $(PLATFORMDIR)/extras/ || true
387 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/crypto || true
389 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_cp9*.*o $(PLATFORMDIR)/extras/ || true
390 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_cp1251.*o $(PLATFORMDIR)/extras/ || true
391 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_euc-jp.*o $(PLATFORMDIR)/extras/ || true
392 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_sjis.*o $(PLATFORMDIR)/extras/ || true
393 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_gb2312.*o $(PLATFORMDIR)/extras/ || true
394 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_euc-kr.*o $(PLATFORMDIR)/extras/ || true
395 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_big5.*o $(PLATFORMDIR)/extras/ || true
397 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_*.*o $(PLATFORMDIR)/extras/ || true
398 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/*.*o $(PLATFORMDIR)/extras/ || true
399 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi/*.*o $(PLATFORMDIR)/extras/ || true
400 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/leds/*.*o $(PLATFORMDIR)/extras/ || true
401 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/ext2.*o $(PLATFORMDIR)/extras/ || true
402 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/ext3.*o $(PLATFORMDIR)/extras/ || true
403 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jbd.*o $(PLATFORMDIR)/extras/ || true
404 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/mbcache.*o $(PLATFORMDIR)/extras/ || true
405 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fat.*o $(PLATFORMDIR)/extras/ || true
406 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/vfat.*o $(PLATFORMDIR)/extras/ || true
407 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/msdos.*o $(PLATFORMDIR)/extras/ || true
408 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fuse.*o $(PLATFORMDIR)/extras/ || true
409 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfs.*o $(PLATFORMDIR)/extras/ || true
410 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfsplus.*o $(PLATFORMDIR)/extras/ || true
412 ifneq ($(TCONFIG_USB),y)
413 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/usb || true
414 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi || true
415 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/leds || true
416 endif
418 $(if $(TCONFIG_USB_EXTRAS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/connector/cn.*o $(PLATFORMDIR)/extras/ || true
419 $(if $(TCONFIG_USB_EXTRAS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/block/loop.*o $(PLATFORMDIR)/extras/ || true
420 ifneq ($(TCONFIG_USB_EXTRAS),y)
421 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/connector || true
422 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/block || true
423 endif
424 $(if $(TCONFIG_CIFS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/cifs.*o $(PLATFORMDIR)/extras/ || true
425 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@mv,@cp -f),@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jffs2.*o $(PLATFORMDIR)/extras/ || true
426 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@mv,@cp -f),@mv) $(TARGETDIR)/lib/modules/*/kernel/lib/zlib_*.*o $(PLATFORMDIR)/extras/ || true
427 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@cp -f,@mv),@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jffs.*o $(PLATFORMDIR)/extras/ || true
428 [ ! -f $(TARGETDIR)/lib/modules/*/kernel/lib/* ] && rm -rf $(TARGETDIR)/lib/modules/*/kernel/lib || true
429 $(if $(TCONFIG_L7),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/netfilter/ipt_layer7.*o $(PLATFORMDIR)/extras/ || true
430 $(if $(TCONFIG_L7),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/netfilter/xt_layer7.*o $(PLATFORMDIR)/extras/ || true
432 @mkdir -p $(PLATFORMDIR)/extras/apps
433 @mkdir -p $(PLATFORMDIR)/extras/lib
435 @mv $(TARGETDIR)/usr/sbin/ttcp $(PLATFORMDIR)/extras/apps/ || true
436 @mv $(TARGETDIR)/usr/sbin/mii-tool $(PLATFORMDIR)/extras/apps/ || true
437 @mv $(TARGETDIR)/usr/sbin/robocfg $(PLATFORMDIR)/extras/apps/ || true
439 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/lib/libusb* $(PLATFORMDIR)/extras/lib/ || true
440 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/sbin/usb_modeswitch $(PLATFORMDIR)/extras/apps/ || true
441 @cp usbmodeswitch/usb_modeswitch.conf $(PLATFORMDIR)/extras/apps/usb_modeswitch.conf || true
442 @cp usbmodeswitch/usb_modeswitch.setup $(PLATFORMDIR)/extras/apps/usb_modeswitch.setup || true
443 @mkdir -p $(PLATFORMDIR)/extras/apps/usb_modeswitch.d
444 @cp -f usbmodeswitch/data/usb_modeswitch.d/* $(PLATFORMDIR)/extras/apps/usb_modeswitch.d || true
445 ifneq ($(NEED_EX_USB),y)
446 @rm -rf $(TARGETDIR)/rom/etc/usb_modeswitch.d || true
447 @rm -f $(TARGETDIR)/rom/etc/usb_modeswitch.conf || true
448 endif
449 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/sbin/chat $(PLATFORMDIR)/extras/apps/ || true
451 @mkdir -p $(TARGETDIR)/rom/etc/l7-protocols
452 ifeq ($(TCONFIG_L7PAT),y)
453 @cd layer7 && ./squish.sh
454 cp layer7/squished/*.pat $(TARGETDIR)/rom/etc/l7-protocols
455 endif
457 ifeq ($(TCONFIG_USERPPTP),y)
458 @mkdir -p $(TARGETDIR)/rom/etc/vpn
459 cp rc/vpn/* $(TARGETDIR)/rom/etc/vpn
460 chmod +x $(TARGETDIR)/rom/etc/vpn/*
461 endif
463 busybox/examples/depmod.pl -k $(LINUXDIR)/vmlinux -b $(TARGETDIR)/lib/modules/*/
464 @mv $(TARGETDIR)/lib/modules/*/modules.dep $(TARGETDIR)/lib/modules/
465 @echo ---
467 @rm -f $(TARGETDIR)/lib/modules/*/build
469 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs-lzma
470 @$(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(TARGETDIR) $(PLATFORMDIR)/target.image -all-root -noappend -nopad | tee target.info
472 # Package kernel and filesystem
473 # if grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
474 # cp $(PLATFORMDIR)/target.image $(LINUXDIR)/arch/mips/ramdisk/$${CONFIG_EMBEDDED_RAMDISK_IMAGE} ; \
475 # $(MAKE) -C $(LINUXDIR) zImage ; \
476 # else \
477 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz $(PLATFORMDIR)/ ; \
478 # trx -o $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image ; \
479 # fi
481 # Pad self-booting Linux to a 64 KB boundary
482 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage $(PLATFORMDIR)/
483 # dd conv=sync bs=64k < $(PLATFORMDIR)/zImage > $(PLATFORMDIR)/linux.bin
484 # Append filesystem to self-booting Linux
485 # cat $(PLATFORMDIR)/target.image >> $(PLATFORMDIR)/linux.bin
488 libc: $(LIBDIR)/ld-uClibc.so.0
489 # $(MAKE) -C ../../../tools-src/uClibc all
490 # $(MAKE) -C ../../../tools-src/uClibc install
494 # cleaners
497 clean: clean-build $(obj-clean)
498 rm -rf layer7/squished
499 rm -f .ipv6-y .ipv6-n
500 rm -f .fullssl-y .fullssl-n
501 make -C config clean
503 clean-build: dummy
504 rm -rf $(TARGETDIR)
505 rm -rf $(INSTALLDIR)
506 rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image
507 rm -rf $(PLATFORMDIR)/extras
509 distclean: clean
510 ifneq ($(INSIDE_MAK),1)
511 $(MAKE) -C $(SRCBASE) $@ INSIDE_MAK=1
512 endif
513 # -rm -f $(LIBDIR)/*.so.0 $(LIBDIR)/*.so
516 # configuration
519 CONFIG_IN := config/config.in
521 config/conf config/mconf:
522 @$(MAKE) -C config
524 rconf: config/conf
525 @config/conf $(CONFIG_IN)
527 rmconf: config/mconf
528 @config/mconf $(CONFIG_IN)
530 roldconf: config/conf
531 @config/conf -o $(CONFIG_IN)
532 @$(MAKE) shared-clean rc-clean nvram-clean httpd-clean prebuilt-clean libbcmcrypto-clean dhcpv6-clean
534 kconf:
535 @$(MAKE) -C $(LINUXDIR) config
537 kmconf:
538 @$(MAKE) -C $(LINUXDIR) menuconfig
540 koldconf:
541 @$(MAKE) -C $(LINUXDIR) oldconfig
542 @$(MAKE) -C $(LINUXDIR) include/linux/version.h
544 bboldconf:
545 @$(MAKE) -C busybox oldconfig
547 config conf: rconf kconf
549 menuconfig mconf: rmconf kmconf
551 .ipv6-y .ipv6-n:
552 @rm -f .ipv6-y .ipv6-n
553 @$(MAKE) iptables-clean ebtables-clean pppd-clean zebra-clean dnsmasq-clean iproute2-clean
554 @touch $@
556 .fullssl-y .fullssl-n:
557 @rm -f .fullssl-y .fullssl-n
558 @$(MAKE) openssl-clean vsftpd-clean mssl-clean mdu-clean httpd-clean
559 @touch $@
561 dependconf: .ipv6-$(if $(TCONFIG_IPV6),y,n) .fullssl-$(if $(FULL_OPENSSL),y,n)
563 oldconfig oldconf: koldconf roldconf dependconf bboldconf
567 # overrides and extra dependencies
570 busybox: dummy
571 @$(MAKE) -C busybox EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)"
573 # V=1
575 busybox-install:
576 rm -rf $(INSTALLDIR)/busybox
577 $(MAKE) -C busybox install EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)" CONFIG_PREFIX=$(INSTALLDIR)/busybox
579 busybox-clean:
580 -@$(MAKE) -C busybox distclean
582 busybox-config:
583 $(MAKE) -C busybox menuconfig
586 httpd: shared nvram mssl
587 @$(SEP)
588 @$(MAKE) -C httpd
590 www-install:
591 @$(MAKE) -C www install INSTALLDIR=$(INSTALLDIR)/www TOMATO_EXPERIMENTAL=$(TOMATO_EXPERIMENTAL)
593 matrixssl:
594 @$(SEP)
595 @$(MAKE) -C matrixssl/src
597 matrixssl-install:
598 @true
600 matrixssl-clean:
601 -@$(MAKE) -C matrixssl/src clean
603 cyassl/stamp-h1:
604 @cd cyassl && CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
605 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections \
606 -DNO_MD4 -DNO_AES -DNO_ERROR_STRINGS -DNO_HC128 -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED" \
607 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
608 PTHREAD_LIBS="-lpthread" \
609 $(CONFIGURE)
610 @touch cyassl/stamp-h1
612 cyassl: cyassl/stamp-h1
613 @$(SEP)
614 @$(MAKE) -C cyassl
616 cyassl-clean:
617 -@$(MAKE) -C cyassl clean
618 @rm -f cyassl/stamp-h1
620 cyassl-install:
621 @true
623 ifeq ($(FULL_OPENSSL),y)
624 OPENSSL_CIPHERS:=enable-rc5
625 else
626 OPENSSL_CIPHERS:=no-dh no-idea no-rc2 no-rc5 no-aes no-aes192 no-cast no-des no-modes
627 # no-tls1 no-tlsext
628 # openssl 1.0.1 doesn't build when using "no-tlsext" or "no-tls1"
629 endif
631 openssl/stamp-h1:
632 cd openssl && \
633 ./Configure linux-mipsel --openssldir=/etc --cross-compile-prefix=' ' \
634 -ffunction-sections -fdata-sections -Wl,--gc-sections \
635 shared $(OPENSSL_CIPHERS) \
636 no-sha0 no-smime no-camellia no-krb5 no-rmd160 no-ripemd \
637 no-seed no-capieng no-cms no-gms no-gmp no-rfc3779 \
638 no-ec no-ecdh no-ecdsa no-err no-hw no-jpake no-threads \
639 no-zlib no-engine no-engines no-sse2 no-perlasm \
640 no-dtls1 no-store no-psk no-md2 no-mdc2 no-ts
642 @$(MAKE) -C openssl clean
643 @touch openssl/stamp-h1
645 openssl: openssl/stamp-h1
647 openssl-clean:
648 -@$(MAKE) -C openssl clean
649 @rm -f openssl/stamp-h1
651 openssl-install: openssl
652 install -D openssl/libcrypto.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
653 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
654 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libcrypto.so.1.0.0 libcrypto.so
656 install -D openssl/apps/openssl $(INSTALLDIR)/openssl/usr/sbin/openssl
657 $(STRIP) $(INSTALLDIR)/openssl/usr/sbin/openssl
658 chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/openssl
660 install -D -m 0500 httpd/gencert.sh $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
662 # perl -e 'while (<>) { s/.SECS/time()-(24*60*60)/e; print; }' < httpd/gencert.sh > $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
663 # chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
665 ifeq ($(FULL_OPENSSL),y)
666 install -D openssl/libssl.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
667 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
668 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libssl.so.1.0.0 libssl.so
669 endif
671 mssl: $(if $(FULL_OPENSSL),openssl,cyassl)
673 mdu: shared mssl
675 rc: nvram shared
677 bridge/Makefile:
678 cd bridge && CFLAGS="-Os -g $(EXTRACFLAGS)" \
679 $(CONFIGURE) --prefix="" --with-linux-headers=$(LINUXDIR)/include
681 bridge: bridge/Makefile
682 @$(SEP)
683 @$(MAKE) -C bridge
685 bridge-clean:
686 -@$(MAKE) -C bridge clean
687 @rm -f bridge/Makefile
689 bridge-install:
690 install -D bridge/brctl/brctl $(INSTALLDIR)/bridge/usr/sbin/brctl
691 $(STRIP) $(INSTALLDIR)/bridge/usr/sbin/brctl
693 dnsmasq:
694 @$(SEP)
695 @$(MAKE) -C dnsmasq \
696 COPTS="$(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6) $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
697 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC"
699 dnsmasq-install:
700 install -D dnsmasq/src/dnsmasq $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
701 $(STRIP) $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
703 iptables:
704 @$(SEP)
705 $(MAKE) -C iptables BINDIR=/usr/sbin LIBDIR=/usr/lib KERNEL_DIR=$(LINUXDIR) COPT_FLAGS="-Os $(EXTRACFLAGS) -U CONFIG_NVRAM_SIZE"
707 iptables-install:
708 install -D iptables/iptables $(INSTALLDIR)/iptables/usr/sbin/iptables
709 cd $(INSTALLDIR)/iptables/usr/sbin && \
710 ln -sf iptables iptables-restore
712 install -d $(INSTALLDIR)/iptables/usr/lib/iptables
713 install -D iptables/extensions/*.so $(INSTALLDIR)/iptables/usr/lib/iptables/
715 install -D iptables/libiptc.so $(INSTALLDIR)/iptables/usr/lib/libiptc.so
717 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/iptables
718 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/iptables/*.so
719 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/libiptc.so
721 ifeq ($(TCONFIG_IPV6),y)
722 install iptables/ip6tables $(INSTALLDIR)/iptables/usr/sbin/ip6tables
723 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/ip6tables
724 cd $(INSTALLDIR)/iptables/usr/sbin && \
725 ln -sf ip6tables ip6tables-restore
726 endif
728 iptables-clean:
729 -@$(MAKE) -C iptables KERNEL_DIR=$(LINUXDIR) clean
731 ppp:
732 @$(SEP)
733 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
734 # $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp DFLAGS="-DDEBUG -DDEBUGALL"
736 ppp-%:
737 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
739 rp-pppoe/src/stamp-h1: rp-pppoe/src/Makefile.in
740 cd rp-pppoe/src && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
741 $(CONFIGURE) --prefix=/usr --enable-plugin=$(TOP)/pppd \
742 ac_cv_linux_kernel_pppoe=yes rpppoe_cv_pack_bitfields=rev
743 @touch rp-pppoe/src/stamp-h1
745 rp-pppoe: pppd rp-pppoe/src/stamp-h1
746 $(MAKE) -C rp-pppoe/src pppoe-relay rp-pppoe.so
748 rp-pppoe-clean:
749 -@$(MAKE) -C rp-pppoe/src clean
750 @rm -f rp-pppoe/src/pppoe-relay
751 @rm -f rp-pppoe/src/stamp-h1
753 rp-pppoe-install: rp-pppoe
754 install -D rp-pppoe/src/rp-pppoe.so $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/rp-pppoe.so
755 $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/*.so
756 # install -D rp-pppoe/src/pppoe-relay $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
757 # $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
760 upnp: nvram shared iptables
762 miniupnpd-config:
763 @cd miniupnpd && ./genconfig.sh
765 miniupnpd: iptables miniupnpd-config
766 @$(SEP)
767 $(MAKE) -C miniupnpd miniupnpd -f Makefile.linux \
768 TARGET_OPENWRT="not really" CC=$(CC) \
769 CFLAGS="-Wall -Os -D_GNU_SOURCE $(EXTRACFLAGS) -I$(TOP)/iptables/include -I$(TOP)/shared" \
770 LDFLAGS="-L$(TOP)/iptables -liptc" LIBS=""
772 miniupnpd-clean:
773 -@$(MAKE) -C miniupnpd -f Makefile.linux clean
774 @rm -f miniupnpd/config.h
776 miniupnpd-install:
777 install -D miniupnpd/miniupnpd $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
778 $(STRIP) $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
780 # !!TB
781 shared: busybox
783 vsftpd: $(if $(TCONFIG_FTP_SSL),openssl,)
784 @$(SEP)
785 $(MAKE) -C vsftpd
787 vsftpd-install: vsftpd
788 install -D vsftpd/vsftpd $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
789 $(STRIP) -s $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
791 ntfs-3g/Makefile:
792 cd ntfs-3g && \
793 CC=$(CC) CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
794 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
795 $(CONFIGURE) --enable-shared=no --enable-static=no \
796 --disable-library --disable-ldconfig --disable-mount-helper --with-fuse=internal \
797 --disable-posix-acls --disable-nfconv --disable-dependency-tracking
799 ntfs-3g: ntfs-3g/Makefile
800 @$(MAKE) -C ntfs-3g
802 ntfs-3g-clean:
803 -@$(MAKE) -C ntfs-3g clean
804 @rm -f ntfs-3g/Makefile
806 ntfs-3g-install: ntfs-3g
807 install -D ntfs-3g/src/ntfs-3g $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
808 $(STRIP) -s $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
809 install -d $(INSTALLDIR)/ntfs-3g/sbin && cd $(INSTALLDIR)/ntfs-3g/sbin && \
810 ln -sf ../bin/ntfs-3g mount.ntfs-3g && \
811 ln -sf ../bin/ntfs-3g mount.ntfs
813 libusb10/Makefile: libusb10/Makefile.in
814 cd libusb10 && CFLAGS="-Os -Wall $(EXTRACFLAGS)" LIBS="-lpthread" \
815 $(CONFIGURE) --prefix=/usr ac_cv_lib_rt_clock_gettime=no
817 libusb10: libusb10/Makefile
818 $(MAKE) -C $@
820 libusb10-install: libusb10
821 install -D libusb10/libusb/.libs/libusb-1.0.so $(INSTALLDIR)/libusb10/usr/lib/libusb-1.0.so
822 $(STRIP) $(INSTALLDIR)/libusb10/usr/lib/*.so
824 libusb10-clean:
825 -@$(MAKE) -C $@ clean
826 @rm -rf libusb10/Makefile
828 libusb/Makefile: libusb/Makefile.in
829 cd libusb && CFLAGS="-Wall -Os $(EXTRACFLAGS)" \
830 $(CONFIGURE) --prefix=/usr \
831 LIBUSB_1_0_CFLAGS="-I$(TOP)/libusb10/libusb" \
832 LIBUSB_1_0_LIBS="-L$(TOP)/libusb10/libusb/.libs -lusb-1.0 -lpthread \
833 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share"
835 libusb: libusb10 libusb/Makefile
836 $(MAKE) -C $@
838 libusb-install: libusb
839 install -D libusb/libusb/.libs/libusb-0.1.so $(INSTALLDIR)/libusb/usr/lib/libusb-0.1.so
840 $(STRIP) $(INSTALLDIR)/libusb/usr/lib/*.so
842 libusb-clean:
843 -@$(MAKE) -C $@ clean
844 @rm -rf libusb/Makefile
846 usbmodeswitch: libusb10
847 $(MAKE) -C $@ CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -DLIBUSB10 \
848 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share -lpthread \
849 -I$(TOP)/libusb10/libusb -L$(TOP)/libusb10/libusb/.libs -lusb-1.0"
851 usbmodeswitchdb-install:
852 @mkdir -p $(TARGETDIR)/rom/etc/usb_modeswitch.d
853 # compress whitespace
854 @for D in $(wildcard $(TOP)/usbmodeswitch/data/usb_modeswitch.d/*); do \
855 F=`basename $$D`; \
856 sed 's/###.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $$D > $(TARGETDIR)/rom/etc/usb_modeswitch.d/$$F; \
857 done
859 usbmodeswitch-install: usbmodeswitch usbmodeswitchdb-install
860 install -D usbmodeswitch/usb_modeswitch $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
861 $(STRIP) -s $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
862 @mkdir -p $(TARGETDIR)/rom/etc
863 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/usbmodeswitch/usb_modeswitch.conf > $(TARGETDIR)/rom/etc/usb_modeswitch.conf
866 radvd/stamp-h1:
867 cd radvd && CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
868 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
869 $(CONFIGURE) --prefix=""
870 @$(MAKE) -C radvd clean
871 @touch radvd/stamp-h1
873 radvd: radvd/stamp-h1
875 radvd-clean:
876 -@$(MAKE) -C radvd distclean
877 @rm -f radvd/stamp-h1
879 radvd-install: radvd
880 install -D radvd/radvd $(INSTALLDIR)/radvd/usr/sbin/radvd
881 $(STRIP) $(INSTALLDIR)/radvd/usr/sbin/radvd
883 dhcpv6/stamp-h1:
884 @cd dhcpv6 && \
885 CFLAGS="-Os -Wall $(EXTRACFLAGS) -D_GNU_SOURCE -ffunction-sections -fdata-sections" \
886 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
887 ac_cv_func_setpgrp_void=yes \
888 $(CONFIGURE) --prefix= --with-localdbdir=/var
889 @$(MAKE) -C dhcpv6 clean
890 @touch dhcpv6/stamp-h1
892 dhcpv6: dhcpv6/stamp-h1
893 @$(SEP)
894 @$(MAKE) -C dhcpv6 dhcp6c
896 dhcpv6-install: dhcpv6
897 install -D dhcpv6/dhcp6c $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
898 $(STRIP) $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
900 dhcpv6-clean:
901 -@$(MAKE) -C dhcpv6 clean
902 @rm -f dhcpv6/Makefile dhcpv6/stamp-h1
905 p910nd:
906 samba:
907 samba3:
909 nvram: shared
911 prebuilt: shared libbcmcrypto
913 vlan:
914 @$(SEP)
915 @$(MAKE) -C vlan CROSS=$(CROSS_COMPILE) # STRIPTOOL=$(STRIP)
917 vlan-install:
918 $(MAKE) -C vlan CROSS=$(CROSS_COMPILE) INSTALLDIR=$(INSTALLDIR) install # STRIPTOOL=$(STRIP)
919 $(STRIP) $(INSTALLDIR)/vlan/usr/sbin/vconfig
922 pptp-client-install:
923 install -D pptp-client/pptp $(INSTALLDIR)/pptp-client/usr/sbin/pptp
924 $(STRIP) $(INSTALLDIR)/pptp-client/usr/sbin/pptp
927 accel-pptp: pppd accel-pptp/Makefile
928 @$(MAKE) -C accel-pptp
930 accel-pptp/Makefile: accel-pptp/Makefile.in $(LINUXDIR)/include/linux/version.h
931 cd accel-pptp && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
932 $(CONFIGURE) --prefix=/usr KDIR=$(LINUXDIR) PPPDIR=$(TOP)/pppd
934 accel-pptp-clean:
935 -@$(MAKE) -C accel-pptp clean
936 @rm -f accel-pptp/Makefile
938 accel-pptp-install: accel-pptp
939 install -D accel-pptp/src/.libs/pptp.so $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
940 $(STRIP) $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
943 pptpd/stamp-h1:
944 cd $(TOP)/pptpd && $(CONFIGURE) --prefix=$(INSTALLDIR)/pptpd --enable-bcrelay CC=mipsel-uclibc-gcc STRIP=mipsel-uclibc-strip AR=mipsel-uclibc-ar LD=mipsel-uclibc-ld NM=mipsel-uclibc-nm RANLIB=mipsel-uclibc-ranlib
945 touch pptpd/stamp-h1
947 pptpd: pptpd/stamp-h1
949 pptpd-install: pptpd
950 @echo pptpd
951 @install -D pptpd/pptpd $(INSTALLDIR)/pptpd/usr/sbin/pptpd
952 @install -D pptpd/bcrelay $(INSTALLDIR)/pptpd/usr/sbin/bcrelay
953 @install -D pptpd/pptpctrl $(INSTALLDIR)/pptpd/usr/sbin/pptpctrl
954 @$(STRIP) $(INSTALLDIR)/pptpd/usr/sbin/pptpd
955 @$(STRIP) $(INSTALLDIR)/pptpd/usr/sbin/bcrelay
956 @$(STRIP) $(INSTALLDIR)/pptpd/usr/sbin/pptpctrl
958 pptpd-clean:
959 -@$(MAKE) -C pptpd clean
960 rm -rf pptpd/.deps pptpd/stamp-h1
963 pppd/Makefile: pppd/linux/Makefile.top
964 cd pppd && $(CONFIGURE) --prefix=/usr --sysconfdir=/tmp
966 pppd: pppd/Makefile
967 @$(SEP)
968 @$(MAKE) -C pppd MFLAGS='$(if $(TCONFIG_IPV6),HAVE_INET6=y,) EXTRACFLAGS="$(EXTRACFLAGS)"'
970 pppd-clean:
971 -@$(MAKE) -C pppd clean
972 @rm -f pppd/Makefile
974 pppd-install: pppd
975 install -D pppd/pppd/pppd $(INSTALLDIR)/pppd/usr/sbin/pppd
976 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/pppd
977 install -D pppd/chat/chat $(INSTALLDIR)/pppd/usr/sbin/chat
978 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/chat
979 ifeq ($(TCONFIG_L2TP),y)
980 install -D pppd/pppd/plugins/pppol2tp/pppol2tp.so $(INSTALLDIR)/pppd/usr/lib/pppd/pppol2tp.so
981 $(STRIP) $(INSTALLDIR)/pppd/usr/lib/pppd/*.so
982 endif
984 # ipupdate-install:
985 # install -D ipupdate/ez-ipupdate $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
986 # $(STRIP) $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
988 zebra/stamp-h1:
989 @cd zebra && rm -f config.cache && \
990 CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
991 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
992 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
993 $(CONFIGURE) --sysconfdir=/etc \
994 --enable-netlink $(if $(TCONFIG_IPV6),--enable-ipv6,--disable-ipv6) --disable-ripngd --disable-ospfd --disable-doc \
995 --disable-ospf6d --disable-bgpd --disable-bgpd-announce
996 @touch zebra/stamp-h1
998 zebra: zebra/stamp-h1
999 @$(MAKE) -C zebra CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD)
1001 zebra-clean:
1002 -@$(MAKE) -C zebra clean
1003 @rm -f zebra/stamp-h1
1005 zebra-install: zebra
1006 install -D zebra/zebra/zebra $(INSTALLDIR)/zebra/usr/sbin/zebra
1007 install -D zebra/ripd/ripd $(INSTALLDIR)/zebra/usr/sbin/ripd
1008 install -D zebra/lib/libzebra.so $(INSTALLDIR)/zebra/usr/lib/libzebra.so
1009 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/zebra
1010 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/ripd
1011 $(STRIP) $(INSTALLDIR)/zebra/usr/lib/libzebra.so
1014 rp-l2tp-install:
1015 install -d $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
1016 install rp-l2tp/handlers/*.so $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
1017 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp/*.so
1018 install -D rp-l2tp/handlers/l2tp-control $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
1019 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
1020 install -D rp-l2tp/l2tpd $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
1021 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
1023 xl2tpd: pppd
1024 CFLAGS="-g $(EXTRACFLAGS)" $(MAKE) -C $@ PREFIX=/usr xl2tpd
1026 xl2tpd-install: xl2tpd
1027 install -D xl2tpd/xl2tpd $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
1028 $(STRIP) $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
1031 bpalogin-install:
1032 install -D bpalogin/bpalogin $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
1033 $(STRIP) $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
1036 # libnet:
1037 # @$(SEP)
1038 # @-mkdir -p libnet/lib
1039 # @$(MAKE) -C libnet CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
1041 # libpcap:
1042 # @$(SEP)
1043 # @$(MAKE) -C libpcap CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
1045 libbcm:
1046 @[ ! -f libbcm/Makefile ] || $(MAKE) -C libbcm
1048 libbcm-install:
1049 install -D libbcm/libbcm.so $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
1050 $(STRIP) $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
1053 iproute2:
1054 @$(SEP)
1055 @$(MAKE) -C $@ KERNEL_INCLUDE=$(LINUXDIR)/include EXTRACFLAGS="$(EXTRACFLAGS) $(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6)"
1057 iproute2-install: iproute2
1058 install -D iproute2/tc/tc $(INSTALLDIR)/iproute2/usr/sbin/tc
1059 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/tc
1060 install -D iproute2/ip/ip $(INSTALLDIR)/iproute2/usr/sbin/ip
1061 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/ip
1064 ntpc: nvram shared
1067 dropbear: dropbear/config.h
1068 @$(SEP)
1069 @$(MAKE) -C dropbear PROGRAMS="dropbear dbclient dropbearkey scp" MULTI=1
1071 dropbear-install:
1072 install -D dropbear/dropbearmulti $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1073 $(STRIP) $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1074 cd $(INSTALLDIR)/dropbear/usr/bin && \
1075 ln -sf dropbearmulti dropbear && \
1076 ln -sf dropbearmulti dropbearconvert && \
1077 ln -sf dropbearmulti dropbearkey && \
1078 ln -sf dropbearmulti dbclient && \
1079 ln -sf dropbearmulti ssh && \
1080 ln -sf dropbearmulti scp
1082 dropbear-clean:
1083 -@$(MAKE) -C dropbear clean
1084 @rm -f dropbear/config.h
1086 dropbear/config.h:
1087 cd dropbear && \
1088 CFLAGS="-Os -Wall $(EXTRACFLAGS) -DARGTYPE=3 -ffunction-sections -fdata-sections" \
1089 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1090 ac_cv_func_logout=no ac_cv_func_logwtmp=no \
1091 $(CONFIGURE) --disable-zlib --enable-syslog --disable-lastlog --disable-utmp \
1092 --disable-utmpx --disable-wtmp --disable-wtmpx --disable-pututline \
1093 --disable-pututxline --disable-loginfunc --disable-pam --enable-openpty --enable-bundled-libtom
1094 @$(MAKE) -C dropbear clean
1096 # Media libraries
1098 sqlite/stamp-h1:
1099 cd sqlite && \
1100 CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1101 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1102 $(CONFIGURE) --prefix=/usr --enable-shared --enable-static \
1103 --disable-readline --disable-dynamic-extensions --enable-threadsafe
1104 touch sqlite/stamp-h1
1106 sqlite: sqlite/stamp-h1
1107 @$(MAKE) -C sqlite all
1109 sqlite-clean:
1110 -@$(MAKE) -C sqlite clean
1111 @rm -f sqlite/stamp-h1
1113 sqlite-install: sqlite
1114 @$(SEP)
1115 ifneq ($(MEDIA_SERVER_STATIC),y)
1116 install -D sqlite/.libs/libsqlite3.so.0 $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1117 $(STRIP) $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1118 endif
1120 FFMPEG_FILTER_CONFIG= $(foreach c, $(2), --$(1)="$(c)")
1122 FFMPEG_DECODERS:=aac ac3 atrac3 flac h264 jpegls mp3 mpeg1video mpeg2video mpeg4 mpeg4aac mpegvideo png wmav1 wmav2
1123 FFMPEG_CONFIGURE_DECODERS:=$(call FFMPEG_FILTER_CONFIG,enable-decoder,$(FFMPEG_DECODERS))
1125 FFMPEG_PARSERS:=aac ac3 h264 mpeg4video mpegaudio mpegvideo
1126 FFMPEG_CONFIGURE_PARSERS:=$(call FFMPEG_FILTER_CONFIG,enable-parser,$(FFMPEG_PARSERS))
1128 FFMPEG_PROTOCOLS:=file
1129 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FFMPEG_FILTER_CONFIG,enable-protocol,$(FFMPEG_PROTOCOLS))
1131 FFMPEG_DISABLED_DEMUXERS:=amr apc ape ass bethsoftvid bfi c93 daud dnxhd dsicin dxa ffm gsm gxf idcin iff image2 image2pipe ingenient ipmovie lmlm4 mm mmf msnwc_tcp mtv mxf nsv nut oma pva rawvideo rl2 roq rpl segafilm shorten siff smacker sol str thp tiertexseq tta txd vmd voc wc3 wsaud wsvqa xa yuv4mpegpipe
1132 FFMPEG_CONFIGURE_DEMUXERS:=$(call FFMPEG_FILTER_CONFIG,disable-demuxer,$(FFMPEG_DISABLED_DEMUXERS))
1134 ffmpeg/stamp-h1: zlib
1135 cd ffmpeg && symver_asm_label=no symver_gnu_asm=no symver=no CC=$(CC) \
1136 ./configure --enable-cross-compile --arch=mips --target_os=linux \
1137 --cross-prefix=$(CROSS_COMPILE) --enable-shared --enable-gpl --disable-doc \
1138 --enable-pthreads --enable-small --disable-encoders --disable-filters \
1139 --disable-muxers --disable-devices --disable-ffmpeg --disable-ffplay \
1140 --disable-ffserver --disable-ffprobe --disable-avdevice --disable-swscale \
1141 --disable-hwaccels --disable-network --disable-bsfs --disable-mpegaudio-hp \
1142 --enable-demuxers $(FFMPEG_CONFIGURE_DEMUXERS) \
1143 --disable-decoders $(FFMPEG_CONFIGURE_DECODERS) \
1144 --disable-parsers $(FFMPEG_CONFIGURE_PARSERS) \
1145 --disable-protocols $(FFMPEG_CONFIGURE_PROTOCOLS) \
1146 --extra-cflags="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections -fPIC -I$(TOP)/zlib" \
1147 --extra-ldflags="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1148 --extra-libs="-L$(TOP)/zlib -lz" \
1149 --enable-zlib --disable-debug --prefix=''
1150 touch ffmpeg/stamp-h1
1152 ffmpeg: ffmpeg/stamp-h1 zlib
1153 @$(MAKE) -C ffmpeg all
1155 ffmpeg-clean:
1156 -@$(MAKE) -C ffmpeg clean
1157 @rm -f ffmpeg/stamp-h1 ffmpeg/config.h ffmpeg/config.mak
1159 ffmpeg-install: ffmpeg
1160 @$(SEP)
1161 ifneq ($(MEDIA_SERVER_STATIC),y)
1162 install -D ffmpeg/libavformat/libavformat.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1163 install -D ffmpeg/libavcodec/libavcodec.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1164 install -D ffmpeg/libavutil/libavutil.so.50 $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1165 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1166 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1167 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1168 endif
1170 libogg/stamp-h1:
1171 cd libogg && \
1172 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1173 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1174 $(CONFIGURE) --enable-shared --enable-static --prefix=''
1175 touch libogg/stamp-h1
1177 libogg: libogg/stamp-h1
1178 @$(MAKE) -C libogg all
1180 libogg-clean:
1181 -@$(MAKE) -C libogg clean
1182 @rm -f libogg/stamp-h1
1184 libogg-install: libogg
1185 @$(SEP)
1186 ifneq ($(MEDIA_SERVER_STATIC),y)
1187 install -D libogg/src/.libs/libogg.so.0 $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1188 $(STRIP) $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1189 endif
1191 flac/stamp-h1: libogg
1192 cd flac && \
1193 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1194 CPPFLAGS="-I$(TOP)/libogg/include -I$(LINUXDIR)/include" \
1195 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1196 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-rpath \
1197 --disable-doxygen-docs --disable-xmms-plugin --disable-cpplibs \
1198 --without-libiconv-prefix --disable-altivec --disable-3dnow --disable-sse
1199 touch flac/stamp-h1
1201 flac: flac/stamp-h1 libogg
1202 @$(MAKE) -C flac/src/libFLAC all
1204 flac-clean:
1205 -@$(MAKE) -C flac clean
1206 @rm -f flac/stamp-h1
1208 flac-install: flac
1209 @$(SEP)
1210 ifneq ($(MEDIA_SERVER_STATIC),y)
1211 install -D flac/src/libFLAC/.libs/libFLAC.so.8 $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1212 $(STRIP) $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1213 endif
1215 jpeg/stamp-h1:
1216 cd jpeg && \
1217 CFLAGS="-Os $(EXTRACFLAGS) -fPIC" CC=$(CC) AR2="touch" $(CONFIGURE) --enable-shared --enable-static --prefix=''
1218 touch jpeg/stamp-h1
1220 jpeg: jpeg/stamp-h1
1221 @$(MAKE) -C jpeg LIBTOOL="" O=o A=a CC=$(CC) AR2="touch" libjpeg.a libjpeg.so
1223 jpeg-clean:
1224 -@$(MAKE) -C jpeg clean
1225 @rm -f jpeg/stamp-h1 jpeg/Makefile
1227 jpeg-install: jpeg
1228 @$(SEP)
1229 ifneq ($(MEDIA_SERVER_STATIC),y)
1230 install -D jpeg/libjpeg.so $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1231 $(STRIP) $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1232 endif
1234 libexif/stamp-h1:
1235 cd libexif && CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1236 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1237 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1238 --disable-docs --disable-rpath --disable-nls --without-libiconv-prefix --without-libintl-prefix
1239 touch libexif/stamp-h1
1241 libexif: libexif/stamp-h1
1242 @$(MAKE) -C libexif all
1244 libexif-clean:
1245 -@$(MAKE) -C libexif clean
1246 @rm -f libexif/stamp-h1
1248 libexif-install: libexif
1249 @$(SEP)
1250 ifneq ($(MEDIA_SERVER_STATIC),y)
1251 install -D libexif/libexif/.libs/libexif.so.12 $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1252 $(STRIP) $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1253 endif
1255 zlib/stamp-h1:
1256 cd zlib && \
1257 CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1258 ./configure --shared --prefix=''
1259 touch zlib/stamp-h1
1261 zlib: zlib/stamp-h1
1262 @$(MAKE) -C zlib CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) all
1264 zlib-clean:
1265 -@$(MAKE) -C zlib clean
1266 @rm -f zlib/stamp-h1 zlib/Makefile zlib/zconf.h zlib/zlib.pc
1268 zlib-install: zlib
1269 @$(SEP)
1270 ifneq ($(MEDIA_SERVER_STATIC),y)
1271 install -d $(INSTALLDIR)/zlib/usr/lib
1272 install -D zlib/libz.so.1 $(INSTALLDIR)/zlib/usr/lib/
1273 $(STRIP) $(INSTALLDIR)/zlib/usr/lib/libz.so.1
1274 endif
1276 libid3tag/stamp-h1: zlib
1277 cd libid3tag && \
1278 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" CPPFLAGS="-I$(TOP)/zlib" \
1279 LDFLAGS="-L$(TOP)/zlib -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1280 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1281 --disable-debugging --disable-profiling
1282 touch libid3tag/stamp-h1
1284 libid3tag: libid3tag/stamp-h1 zlib
1285 @$(MAKE) -C libid3tag all
1287 libid3tag-clean:
1288 -@$(MAKE) -C libid3tag clean
1289 @rm -f libid3tag/stamp-h1
1291 libid3tag-install: libid3tag
1292 @$(SEP)
1293 ifneq ($(MEDIA_SERVER_STATIC),y)
1294 install -D libid3tag/.libs/libid3tag.so.0 $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1295 $(STRIP) $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1296 endif
1298 libvorbis/stamp-h1: libogg
1299 cd libvorbis && \
1300 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1301 CPPFLAGS="-I$(TOP)/libogg/include" \
1302 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1303 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-oggtest \
1304 --with-ogg-includes="$(TOP)/libogg/include" \
1305 --with-ogg-libraries="$(TOP)/libogg/src/.libs"
1306 touch libvorbis/stamp-h1
1308 libvorbis: libvorbis/stamp-h1
1309 @$(MAKE) -C libvorbis/lib all
1311 libvorbis-clean:
1312 -@$(MAKE) -C libvorbis clean
1313 @rm -f libvorbis/stamp-h1
1315 libvorbis-install: libvorbis
1316 @$(SEP)
1317 ifneq ($(MEDIA_SERVER_STATIC),y)
1318 install -D libvorbis/lib/.libs/libvorbis.so.0 $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1319 $(STRIP) $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1320 endif
1322 minidlna: zlib sqlite ffmpeg libogg flac jpeg libexif libid3tag libvorbis
1323 @$(SEP)
1324 @$(MAKE) -C minidlna CC=$(CC) $(if $(MEDIA_SERVER_STATIC),STATIC=1,) minidlna
1327 igmpproxy/src/Makefile: igmpproxy/src/Makefile.in
1328 cd igmpproxy && CFLAGS="-O2 -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1329 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1330 $(CONFIGURE) --prefix=/usr
1332 igmpproxy: igmpproxy/src/Makefile
1333 @$(SEP)
1334 @$(MAKE) -C igmpproxy/src
1336 igmpproxy-install: igmpproxy
1337 install -D igmpproxy/src/igmpproxy $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1338 $(STRIP) $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1340 igmpproxy-clean:
1341 -@$(MAKE) -C igmpproxy/src clean
1342 @rm -f igmpproxy/src/Makefile
1344 udev:
1345 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)" \
1346 PROGRAMS=udevtrigger
1348 udev-install: udev
1349 install -d $(INSTALLDIR)
1350 install -d $(TARGETDIR)
1351 $(MAKE) -C udev DESTDIR=$(INSTALLDIR) prefix=/udev install-udevtrigger
1353 hotplug2:
1354 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1356 hotplug2-install: hotplug2
1357 $(MAKE) -C hotplug2 install PREFIX=$(INSTALLDIR)/hotplug2 SUBDIRS=""
1358 $(MAKE) -C hotplug2/examples install PREFIX=$(INSTALLDIR)/hotplug2/rom KERNELVER=$(LINUX_KERNEL)
1360 emf:
1361 $(MAKE) -C $(SRCBASE)/emf/emfconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1363 emf-install: emf
1364 $(MAKE) -C $(SRCBASE)/emf/emfconf INSTALLDIR=$(INSTALLDIR) install
1366 igs:
1367 $(MAKE) -C $(SRCBASE)/emf/igsconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1369 igs-install: igs
1370 $(MAKE) -C $(SRCBASE)/emf/igsconf INSTALLDIR=$(INSTALLDIR) install
1372 wanuptime: nvram shared
1373 @$(SEP)
1374 @$(MAKE) -C wanuptime
1376 wanuptime-clean:
1377 -@$(MAKE) -C wanuptime clean
1379 wanuptime-install:
1380 install -D wanuptime/wanuptime $(INSTALLDIR)/wanuptime/usr/sbin/wanuptime
1381 $(STRIP) $(INSTALLDIR)/wanuptime/usr/sbin/wanuptime
1383 ebtables: dummy
1384 $(MAKE) -C ebtables CC=$(CC) LD=$(LD) \
1385 CFLAGS="-Os $(EXTRACFLAGS) -DEBT_MIN_ALIGN=4 -Wall -Wunused" \
1386 LOCKFILE="/var/lock/ebtables" LOCKDIR="/var/lock" \
1387 BINDIR="/usr/sbin" LIBDIR="/usr/lib/ebtables" KERNEL_INCLUDES=$(LINUXDIR)/include $(if $(TCONFIG_IPV6),DO_IPV6=1,)
1389 ebtables-install: ebtables
1390 install -D ebtables/ebtables $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1392 @mkdir -p $(TARGETDIR)/rom/etc
1393 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/ebtables/ethertypes > $(TARGETDIR)/rom/etc/ethertypes
1394 chmod 0644 $(TARGETDIR)/rom/etc/ethertypes
1396 install -d $(INSTALLDIR)/ebtables/usr/lib
1397 install -d $(INSTALLDIR)/ebtables/usr/lib/ebtables
1398 install -D ebtables/*.so $(INSTALLDIR)/ebtables/usr/lib/
1399 install -D ebtables/extensions/*.so $(INSTALLDIR)/ebtables/usr/lib/ebtables/
1401 $(STRIP) $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1402 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/ebtables/*.so
1403 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/libebt*.so
1405 ebtables-clean:
1406 -@$(MAKE) -C ebtables clean
1408 #Roadkill
1409 glib/stamp-h1:
1410 @$(SEP)
1411 @cd glib && $(CONFIGURE) --prefix=/usr glib_cv_prog_cc_ansi_proto=no glib_cv_has__inline=yes glib_cv_has__inline__=yes glib_cv_hasinline=yes \
1412 glib_cv_sane_realloc=yes glib_cv_va_copy=no glib_cv___va_copy=yes glib_cv_va_val_copy=yes glib_cv_rtldglobal_broken=no \
1413 glib_cv_uscore=no glib_cv_func_pthread_mutex_trylock_posix=yes glib_cv_func_pthread_cond_timedwait_posix=yes glib_cv_sizeof_gmutex=24 \
1414 glib_cv_byte_contents_gmutex="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" glib_cv_sys_pthread_getspecific_posix=yes \
1415 glib_cv_sys_pthread_mutex_trylock_posix=yes glib_cv_sys_pthread_cond_timedwait_posix=yes ac_cv_func_getpwuid_r=yes ac_cv_func_getpwuid_r_posix=yes
1416 @$(MAKE) -C glib
1417 touch glib/stamp-h1
1419 glib: glib/stamp-h1
1421 glib-clean:
1422 -@$(MAKE) -C glib clean
1423 rm -f glib/stamp-h1
1425 glib-install: glib
1426 @$(MAKE) -C glib DESTDIR=$(INSTALLDIR)/glib install
1428 #Roadkill
1429 nocat/stamp-h1: glib-install
1430 @$(SEP)
1431 @cd nocat && \
1432 NC_CONF_PATH="/" \
1433 $(CONFIGURE) --with-firewall=iptables --with-glib-prefix="$(INSTALLDIR)/glib/usr" --localstatedir=/var --sysconfdir=/etc
1434 @$(MAKE) -C nocat
1436 echo *** integrate glib to nocat installdir
1437 install -d $(INSTALLDIR)/nocat/usr/lib
1438 install -D glib/.libs/libglib-1.2.so.0.0.10 $(INSTALLDIR)/nocat/usr/lib/libglib-1.2.so.0.0.10
1439 cd $(INSTALLDIR)/nocat/usr/lib && ln -s libglib-1.2.so.0.0.10 libglib-1.2.so.0
1440 $(STRIP) $(INSTALLDIR)/nocat/usr/lib/libglib-1.2.so.0.0.10
1441 touch nocat/stamp-h1
1443 nocat: nocat/stamp-h1
1445 nocat-clean:
1446 -@$(MAKE) -C nocat clean
1447 rm -f nocat/stamp-h1
1449 nocat-install:
1450 install -D nocat/src/splashd $(INSTALLDIR)/nocat/usr/sbin/splashd
1451 $(STRIP) $(INSTALLDIR)/nocat/usr/sbin/splashd
1452 mkdir -p $(INSTALLDIR)/nocat/usr/libexec/nocat
1453 install -D nocat/libexec/iptables/* $(INSTALLDIR)/nocat/usr/libexec/nocat
1455 lzo/stamp-h1:
1456 cd lzo && \
1457 CFLAGS="-Os -Wall -fPIC $(EXTRACFLAGS)" $(CONFIGURE) --enable-shared --enable-static
1458 touch lzo/stamp-h1
1460 lzo: lzo/stamp-h1
1462 lzo-clean:
1463 -@$(MAKE) -C lzo clean
1464 @rm -f lzo/stamp-h1
1466 lzo-install: lzo
1467 install -D lzo/src/.libs/liblzo2.so $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1468 $(STRIP) $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1469 cd $(INSTALLDIR)/lzo/usr/lib && ln -sf liblzo2.so.2 liblzo2.so
1472 openvpn: openvpn/.conf openssl lzo
1474 openvpn/.conf:
1475 cd openvpn && CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1476 LDFLAGS="-L$(TOP)/openssl -L$(TOP)/lzo/src/.libs -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1477 $(CONFIGURE) --prefix= \
1478 --with-lzo-headers="$(TOP)/lzo/include" \
1479 --with-ssl-headers="$(TOP)/openssl/include/" \
1480 --with-iproute-path="/usr/sbin/ip" \
1481 --disable-debug --disable-plugins --enable-management --enable-small \
1482 --disable-selinux --disable-socks --enable-password-save
1483 touch openvpn/.conf
1485 openvpn-clean:
1486 -@$(MAKE) -C openvpn clean
1487 @rm -f openvpn/.conf
1489 openvpn-install: openvpn
1490 install -D openvpn/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1491 $(STRIP) -s $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1492 chmod 0500 $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1494 sd-idle/stamp-h1:
1495 cd sd-idle \
1496 CFLAGS="-Os -Wall --host=mipsel-linux --target=mipsel-linux $(EXTRACFLAGS)" \
1497 $(MAKE) -C sd-idle
1498 chmod 0755 sd-idle/sd-idle
1499 touch sd-idle/stamp-h1
1501 sd-idle-clean:
1502 -@$(MAKE) -C sd-idle clean
1503 @rm -f sd-idle/stamp-h1
1505 sd-idle-install: sd-idle/stamp-h1
1506 install -d $(INSTALLDIR)/sd-idle/usr/bin
1507 install -D sd-idle/sd-idle $(INSTALLDIR)/sd-idle/usr/bin/sd-idle
1508 $(STRIP) -s $(INSTALLDIR)/sd-idle/usr/bin/sd-idle
1510 snmp/stamp-h1:
1511 cd snmp && \
1512 CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1513 $(CONFIGURE) --prefix=/usr --with-endianness=little --enable-mini-agent --disable-debugging \
1514 --disable-privacy --without-opaque-special-types --with-persistent-directory=/tmp/snmp-persist \
1515 --with-default-snmp-version=3 --with-sys-contact=root --with-sys-location=Unknown --with-logfile=/dev/null \
1516 --with-out-transports=UDPIPv6,TCPIPv6,AAL5PVC,IPX,TCP,Unix --enable-shared=no --enable-static --with-gnu-ld \
1517 --enable-internal-md5 --with-copy-persistent-files=no --without-openssl -sysconfdir=/tmp \
1518 --with-mib-modules=mibII,host,mibII/ip,mibII/tcp,mibII/udp,mibII/icmp,mibII/var_route,mibII/kernel_linux,qos,ucd_snmp \
1519 --with-out-mib-modules=snmpv3mibs,agent_mips,agentx,notification,utilities,target --disable-ipv6 --with-defaults \
1520 --without-efence --without-rsaref --without-kmem-usage --without-rpm --without-dmalloc
1521 touch snmp/stamp-h1
1523 snmp: snmp/stamp-h1
1524 @$(SEP)
1525 $(MAKE) -C snmp
1527 snmp-clean:
1528 -@$(MAKE) -C snmp clean
1529 @rm -f snmp/stamp-h1
1531 snmp-install: snmp
1532 install -D snmp/agent/snmpd $(INSTALLDIR)/snmp/usr/sbin/snmpd
1533 $(STRIP) $(INSTALLDIR)/snmp/usr/sbin/snmpd
1536 # Generic rules
1540 @[ ! -d $* ] || ( $(SEP); $(MAKE) -C $* )
1543 %-clean:
1544 @-[ ! -d $* ] || $(MAKE) -C $* clean
1546 %-distclean:
1547 @-[ ! -d $* ] || $(MAKE) -C $* distclean
1549 %-install: %
1550 @[ ! -d $* ] || $(MAKE) -C $* install INSTALLDIR=$(INSTALLDIR)/$*
1552 %-build:
1553 $(MAKE) $*-clean $*
1555 $(obj-y) $(obj-n) $(obj-clean) $(obj-install): dummy
1557 .PHONY: all clean distclean mrproper install package
1558 .PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
1559 .PHONY: dummy libnet libpcap