Merge branch 'tomato-RT' into Toastman-RT
[tomato.git] / release / src / router / Makefile
blobf526dae1da99c501a0378260ea875f8159f0e517
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
50 # !!TB - updated Broadcom Wireless driver
51 obj-y += et
52 obj-y += libbcmcrypto
53 obj-y += wlconf
55 obj-y += cyassl
56 obj-y += mssl
57 obj-y += mdu
59 #Roadkill
60 obj-$(TCONFIG_NOCAT) += nocat
61 # !!TB
62 obj-$(TCONFIG_USB) += p910nd
64 ifeq ($(CONFIG_LINUX26),y)
65 obj-$(TCONFIG_USB) += sd-idle
66 else
67 obj-$(TCONFIG_USB) += scsi-idle
68 endif
70 obj-y += libusb10
71 #obj-y += libusb
72 obj-y += usbmodeswitch
73 obj-$(TCONFIG_FTP) += vsftpd
75 ifeq ($(CONFIG_LINUX26),y)
76 ifeq ($(TCONFIG_SAMBASRV),y)
77 NEED_EX_NLS = y
78 endif
79 ifeq ($(TCONFIG_USB_EXTRAS),y)
80 NEED_EX_USB = y
81 endif
82 endif
84 ifeq ($(TCONFIG_SAMBASRV),y)
85 ifeq ($(TCONFIG_SAMBA3),y)
86 NEED_SAMBA3 = y
87 else
88 NEED_SAMBA2 = y
89 endif
90 endif
92 ifeq ($(TCONFIG_IPV6),y)
93 export TCONFIG_IPV6 := y
94 else
95 TCONFIG_IPV6 :=
96 endif
98 obj-$(NEED_SAMBA2) += samba
99 obj-$(NEED_SAMBA3) += samba3
100 obj-$(TCONFIG_NTFS) += ntfs-3g
101 obj-$(TCONFIG_EBTABLES) += ebtables
102 obj-$(TCONFIG_IPV6) += radvd
103 obj-$(TCONFIG_IPV6) += dhcpv6
105 obj-$(TCONFIG_MEDIA_SERVER) += zlib
106 obj-$(TCONFIG_MEDIA_SERVER) += sqlite
107 obj-$(TCONFIG_MEDIA_SERVER) += ffmpeg
108 obj-$(TCONFIG_MEDIA_SERVER) += libogg
109 obj-$(TCONFIG_MEDIA_SERVER) += flac
110 obj-$(TCONFIG_MEDIA_SERVER) += jpeg
111 obj-$(TCONFIG_MEDIA_SERVER) += libexif
112 obj-$(TCONFIG_MEDIA_SERVER) += libid3tag
113 obj-$(TCONFIG_MEDIA_SERVER) += libvorbis
114 obj-$(TCONFIG_MEDIA_SERVER) += minidlna
115 MEDIA_SERVER_STATIC=y
117 obj-y += miniupnpd
118 # obj-y += upnp
122 # configurable packages
124 obj-$(TCONFIG_L2TP) += xl2tpd
125 obj-$(TCONFIG_PPTP) += accel-pptp
126 obj-$(TCONFIG_HTTPS) += openssl
127 obj-$(TCONFIG_SSH) += dropbear
128 obj-$(TCONFIG_ZEBRA) += zebra
129 # obj-$(TCONFIG_IPP2P) += ipp2p
130 obj-$(TCONFIG_LZO) += lzo
131 obj-$(TCONFIG_OPENVPN) += openvpn
132 obj-$(TCONFIG_EMF) += emf
133 obj-$(TCONFIG_EMF) += igs
135 obj-$(CONFIG_LINUX26) += hotplug2
136 obj-$(CONFIG_LINUX26) += udevtrigger
138 ifeq ($(TCONFIG_OPENVPN),y)
139 export FULL_OPENSSL := y
140 else
141 ifeq ($(TCONFIG_FTP_SSL),y)
142 export FULL_OPENSSL := y
143 else
144 FULL_OPENSSL :=
145 endif
146 endif
148 obj-clean := $(foreach obj, $(obj-y) $(obj-n) $(obj-), $(obj)-clean)
149 obj-install := $(foreach obj,$(obj-y),$(obj)-install)
154 # Basic rules
157 all: clean-build libc $(obj-y) kernel
160 kernel: $(LINUXDIR)/.config
161 @$(SEP)
163 @if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
164 $(MAKE) -C $(LINUXDIR) zImage CC=$(KERNELCC); \
166 if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
167 $(MAKE) -C $(LINUXDIR) modules CC=$(KERNELCC); \
169 ifeq ($(CONFIG_LINUX26),y)
170 $(MAKE) -C $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed srctree=$(LINUXDIR)
171 endif
174 lzma-loader:
175 $(MAKE) -C $(SRCBASE)/lzma-loader CROSS_COMPILE=$(CROSS_COMPILE) LD=$(LD)
177 lzma-loader-install: lzma-loader
178 @$(SEP)
181 kmod: dummy
182 $(MAKE) -C $(LINUXDIR) modules CC=$(KERNELCC)
184 testfind:
185 cd $(TARGETDIR)/lib/modules/* && find -name "*.o" -exec mv -i {} . \; || true
186 cd $(TARGETDIR)/lib/modules/* && find -type d -delete || true
188 install package: $(obj-install) $(LINUXDIR)/.config
189 @$(SEP)
191 install -d $(TARGETDIR)
194 # kernel modules
195 $(MAKE) -C $(LINUXDIR) modules_install \
196 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" \
197 DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
199 ifneq ($(CONFIG_LINUX26),y)
200 find $(TARGETDIR)/lib/modules -name wl.*o -exec $(STRIP) --strip-unneeded -x {} \;
201 find $(TARGETDIR)/lib/modules -name et.*o -exec $(STRIP) --strip-unneeded -x {} \;
202 find $(TARGETDIR)/lib/modules -name bcm57*.*o -exec $(STRIP) --strip-unneeded -x {} \;
203 find $(TARGETDIR)/lib/modules -name ctf.*o -exec $(STRIP) --strip-unneeded -x {} \;
204 find $(TARGETDIR)/lib/modules -name emf.*o -exec $(STRIP) --strip-unneeded -x {} \;
205 find $(TARGETDIR)/lib/modules -name igs.*o -exec $(STRIP) --strip-unneeded -x {} \;
206 find $(TARGETDIR)/lib/modules -name jffs*.*o -exec $(STRIP) --strip-unneeded -x {} \;
208 find $(TARGETDIR)/lib/modules -name *.*o -exec $(STRIP) --strip-debug -x -R .mdebug.abi32 {} \;
209 endif
211 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv diag/* . && rm -rf diag
213 # nice and clean
214 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et.4702/* . && rm -rf et.4702 || true
215 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et/* . && rm -rf et
216 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv wl/* . && rm -rf wl
217 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv cifs/* . && rm -rf cifs
218 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs2/* . && rm -rf jffs2 || true
219 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs/* . && rm -rf jffs || true
220 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_inflate/* . && rm -rf zlib_inflate || true
221 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_deflate/* . && rm -rf zlib_deflate || true
222 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv lzo/* . && rm -rf lzo || true
223 rm -rf $(TARGETDIR)/lib/modules/*/pcmcia
225 ##!!TB
226 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext2/* . && rm -rf ext2 || true
227 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext3/* . && rm -rf ext3 || true
228 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jbd/* . && rm -rf jbd || true
229 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fat/* . && rm -rf fat || true
230 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jfs/* . && rm -rf jfs || true
231 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv vfat/* . && rm -rf vfat || true
232 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv msdos/* . && rm -rf msdos || true
233 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fuse/* . && rm -rf fuse || true
234 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ntfs/* . && rm -rf ntfs || true
235 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv smbfs/* . && rm -rf smbfs || true
236 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv reiserfs/* . && rm -rf reiserfs || true
237 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfs/* . && rm -rf hfs || true
238 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfsplus/* . && rm -rf hfsplus || true
239 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv lockd/* . && rm -rf lockd || true
240 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfsd/* . && rm -rf nfsd || true
241 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfs/* . && rm -rf nfs || true
242 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv xfs/* . && rm -rf xfs || true
243 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nls/* . && rm -rf nls || true
244 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv exportfs/* . && rm -rf exportfs || true
245 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv sunrpc/* . && rm -rf sunrpc || true
246 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv auth_gss/* . && rm -rf auth_gss || true
247 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv oss/* . && rm -rf oss || true
248 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv seq/* . && rm -rf seq || true
249 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv core/* . && rm -rf core || true
250 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv usb/* . && rm -rf usb || true
251 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv hcd/* . && rm -rf hcd || true
252 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv host/* . && rm -rf host || true
253 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv storage/* . && rm -rf storage || true
254 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv serial/* . && rm -rf serial || true
255 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv core/* . && rm -rf core || true
256 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv class/* . && rm -rf class || true
257 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv misc/* . && rm -rf misc || true
258 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv usbip/* . && rm -rf usbip || true
259 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv core/* . && rm -rf core || true
260 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv card/* . && rm -rf card || true
261 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv host/* . && rm -rf host || true
262 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/hid && mv usbhid/* . && rm -rf usbhid || true
263 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv joystick/* . && rm -rf joystick || true
264 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv keyboard/* . && rm -rf keyboard || true
265 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv misc/* . && rm -rf misc || true
266 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv mouse/* . && rm -rf mouse || true
267 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv uvc/* . && rm -rf uvc || true
268 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv pwc/* . && rm -rf pwc || true
269 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv gl860/* . && rm -rf gl860 || true
270 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv m5602/* . && rm -rf m5602 || true
271 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv stv06xx/* . && rm -rf stv06xx || true
272 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv gspca/* . && rm -rf gspca || true
273 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media && mv video/* . && rm -rf video || true
275 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv bcm57xx/* . && rm -rf bcm57xx || true
276 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv emf/* . && rm -rf emf || true
277 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv igs/* . && rm -rf igs || true
278 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv ctf/* . && rm -rf ctf || true
279 cd $(TARGETDIR)/lib/modules && rm -f */source || true
281 # misc
282 for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
283 (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
284 done
286 ifneq ($(TCONFIG_L7),y)
287 rm -f $(TARGETDIR)/usr/lib/iptables/libipt_layer7.so
288 endif
290 # uClibc
291 install $(LIBDIR)/ld-uClibc.so.0 $(TARGETDIR)/lib/
292 install $(LIBDIR)/libcrypt.so.0 $(TARGETDIR)/lib/
293 install $(LIBDIR)/libpthread.so.0 $(TARGETDIR)/lib/
294 install $(LIBDIR)/libgcc_s.so.1 $(TARGETDIR)/lib/
295 $(STRIP) $(TARGETDIR)/lib/libgcc_s.so.1
296 install $(LIBDIR)/libc.so.0 $(TARGETDIR)/lib/
297 install $(LIBDIR)/libdl.so.0 $(TARGETDIR)/lib/
298 install $(LIBDIR)/libm.so.0 $(TARGETDIR)/lib/
299 install $(LIBDIR)/libnsl.so.0 $(TARGETDIR)/lib/
300 ifeq ($(TCONFIG_SSH),y)
301 install $(LIBDIR)/libutil.so.0 $(TARGETDIR)/lib/
302 endif
303 ifneq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
304 install $(LIBDIR)/libresolv.so.0 $(TARGETDIR)/lib/
305 $(STRIP) $(TARGETDIR)/lib/*.so.0
306 endif
308 @cd $(TARGETDIR) && $(TOP)/others/rootprep.sh
310 @echo ---
312 ifeq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
313 @$(SRCBASE)/btools/libfoo.pl
314 else
315 @$(SRCBASE)/btools/libfoo.pl --noopt
316 endif
317 @chmod 0555 $(TARGETDIR)/lib/*.so*
318 @chmod 0555 $(TARGETDIR)/usr/lib/*.so*
320 # !!TB - moved to run after libfoo.pl - to make sure shared libs include all symbols needed by extras
321 # separated/copied extra stuff
322 @rm -rf $(PLATFORMDIR)/extras
323 @mkdir $(PLATFORMDIR)/extras
324 @mv $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/ip_gre.*o $(PLATFORMDIR)/extras/ || true
326 $(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
327 $(if $(TCONFIG_EBTABLES),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/bridge/netfilter/ebt*.*o $(PLATFORMDIR)/extras/ || true
329 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ifb.*o $(PLATFORMDIR)/extras/ || true
330 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sched/sch_red.*o $(PLATFORMDIR)/extras/ || true
331 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/ntfs.*o $(PLATFORMDIR)/extras/ || true
332 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/smbfs.*o $(PLATFORMDIR)/extras/ || true
333 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/reiserfs.*o $(PLATFORMDIR)/extras/ || true
334 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/hfsplus.*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 busybox/examples/depmod.pl -k $(LINUXDIR)/vmlinux -b $(TARGETDIR)/lib/modules/*/
458 @mv $(TARGETDIR)/lib/modules/*/modules.dep $(TARGETDIR)/lib/modules/
459 @echo ---
461 @rm -f $(TARGETDIR)/lib/modules/*/build
463 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs-lzma
464 @$(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(TARGETDIR) $(PLATFORMDIR)/target.image -all-root -noappend -nopad | tee target.info
466 # Package kernel and filesystem
467 # if grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
468 # cp $(PLATFORMDIR)/target.image $(LINUXDIR)/arch/mips/ramdisk/$${CONFIG_EMBEDDED_RAMDISK_IMAGE} ; \
469 # $(MAKE) -C $(LINUXDIR) zImage ; \
470 # else \
471 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz $(PLATFORMDIR)/ ; \
472 # trx -o $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image ; \
473 # fi
475 # Pad self-booting Linux to a 64 KB boundary
476 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage $(PLATFORMDIR)/
477 # dd conv=sync bs=64k < $(PLATFORMDIR)/zImage > $(PLATFORMDIR)/linux.bin
478 # Append filesystem to self-booting Linux
479 # cat $(PLATFORMDIR)/target.image >> $(PLATFORMDIR)/linux.bin
482 libc: $(LIBDIR)/ld-uClibc.so.0
483 # $(MAKE) -C ../../../tools-src/uClibc all
484 # $(MAKE) -C ../../../tools-src/uClibc install
488 # cleaners
491 clean: clean-build $(obj-clean)
492 rm -rf layer7/squished
493 rm -f .ipv6-y .ipv6-n
494 rm -f .fullssl-y .fullssl-n
495 make -C config clean
497 clean-build: dummy
498 rm -rf $(TARGETDIR)
499 rm -rf $(INSTALLDIR)
500 rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image
501 rm -rf $(PLATFORMDIR)/extras
503 distclean: clean
504 ifneq ($(INSIDE_MAK),1)
505 $(MAKE) -C $(SRCBASE) $@ INSIDE_MAK=1
506 endif
507 # -rm -f $(LIBDIR)/*.so.0 $(LIBDIR)/*.so
510 # configuration
513 CONFIG_IN := config/config.in
515 config/conf config/mconf:
516 @$(MAKE) -C config
518 rconf: config/conf
519 @config/conf $(CONFIG_IN)
521 rmconf: config/mconf
522 @config/mconf $(CONFIG_IN)
524 roldconf: config/conf
525 @config/conf -o $(CONFIG_IN)
526 @$(MAKE) shared-clean rc-clean nvram-clean httpd-clean prebuilt-clean libbcmcrypto-clean dhcpv6-clean
528 kconf:
529 @$(MAKE) -C $(LINUXDIR) config
531 kmconf:
532 @$(MAKE) -C $(LINUXDIR) menuconfig
534 koldconf:
535 @$(MAKE) -C $(LINUXDIR) oldconfig
536 @$(MAKE) -C $(LINUXDIR) include/linux/version.h
538 bboldconf:
539 @$(MAKE) -C busybox oldconfig
541 config conf: rconf kconf
543 menuconfig mconf: rmconf kmconf
545 .ipv6-y .ipv6-n:
546 @rm -f .ipv6-y .ipv6-n
547 @$(MAKE) iptables-clean ebtables-clean pppd-clean zebra-clean dnsmasq-clean iproute2-clean
548 @touch $@
550 .fullssl-y .fullssl-n:
551 @rm -f .fullssl-y .fullssl-n
552 @$(MAKE) openssl-clean vsftpd-clean mssl-clean mdu-clean httpd-clean
553 @touch $@
555 dependconf: .ipv6-$(if $(TCONFIG_IPV6),y,n) .fullssl-$(if $(FULL_OPENSSL),y,n)
557 oldconfig oldconf: koldconf roldconf dependconf bboldconf
561 # overrides and extra dependencies
564 busybox: dummy
565 @$(MAKE) -C busybox EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)"
567 # V=1
569 busybox-install:
570 rm -rf $(INSTALLDIR)/busybox
571 $(MAKE) -C busybox install EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)" CONFIG_PREFIX=$(INSTALLDIR)/busybox
573 busybox-clean:
574 $(MAKE) -C busybox distclean
576 busybox-config:
577 $(MAKE) -C busybox menuconfig
580 httpd: shared nvram mssl
581 @$(SEP)
582 @$(MAKE) -C httpd
584 www-install:
585 @$(MAKE) -C www install INSTALLDIR=$(INSTALLDIR)/www TOMATO_EXPERIMENTAL=$(TOMATO_EXPERIMENTAL)
587 matrixssl:
588 @$(SEP)
589 @$(MAKE) -C matrixssl/src
591 matrixssl-install:
592 @true
594 matrixssl-clean:
595 $(MAKE) -C matrixssl/src clean
597 cyassl/stamp-h1:
598 @cd cyassl && CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
599 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections \
600 -DNO_MD4 -DNO_AES -DNO_ERROR_STRINGS -DNO_HC128 -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED" \
601 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
602 PTHREAD_LIBS="-lpthread" \
603 $(CONFIGURE)
604 @touch cyassl/stamp-h1
606 cyassl: cyassl/stamp-h1
607 @$(SEP)
608 @$(MAKE) -C cyassl
610 cyassl-clean:
611 -@$(MAKE) -C cyassl clean
612 @rm -f cyassl/stamp-h1
614 cyassl-install:
615 @true
617 ifeq ($(FULL_OPENSSL),y)
618 OPENSSL_CIPHERS:=enable-rc5
619 else
620 OPENSSL_CIPHERS:=no-dh no-idea no-rc2 no-rc5 no-aes no-aes192 no-cast no-des no-modes no-tls1 no-tlsext
621 endif
623 openssl/stamp-h1:
624 cd openssl && \
625 ./Configure linux-mipsel --openssldir=/etc --cross-compile-prefix=' ' \
626 -ffunction-sections -fdata-sections -Wl,--gc-sections \
627 shared $(OPENSSL_CIPHERS) \
628 no-sha0 no-smime no-camellia no-krb5 no-rmd160 no-ripemd \
629 no-seed no-capieng no-cms no-gms no-gmp no-rfc3779 \
630 no-ec no-ecdh no-ecdsa no-err no-hw no-jpake no-threads \
631 no-zlib no-engine no-engines no-sse2 no-perlasm \
632 no-dtls1 no-store no-psk no-md2 no-mdc2 no-ts
634 @$(MAKE) -C openssl clean
635 @touch openssl/stamp-h1
637 openssl: openssl/stamp-h1
639 openssl-clean:
640 -@$(MAKE) -C openssl clean
641 @rm -f openssl/stamp-h1
643 openssl-install: openssl
644 install -D openssl/libcrypto.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
645 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
646 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libcrypto.so.1.0.0 libcrypto.so
648 install -D openssl/apps/openssl $(INSTALLDIR)/openssl/usr/sbin/openssl
649 $(STRIP) $(INSTALLDIR)/openssl/usr/sbin/openssl
650 chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/openssl
652 install -D -m 0500 httpd/gencert.sh $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
654 # perl -e 'while (<>) { s/.SECS/time()-(24*60*60)/e; print; }' < httpd/gencert.sh > $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
655 # chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
657 ifeq ($(FULL_OPENSSL),y)
658 install -D openssl/libssl.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
659 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
660 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libssl.so.1.0.0 libssl.so
661 endif
663 mssl: $(if $(FULL_OPENSSL),openssl,cyassl)
665 mdu: shared mssl
667 rc: nvram shared
669 bridge/Makefile:
670 cd bridge && CFLAGS="-Os -g $(EXTRACFLAGS)" \
671 $(CONFIGURE) --prefix="" --with-linux-headers=$(LINUXDIR)/include
673 bridge: bridge/Makefile
674 @$(SEP)
675 @$(MAKE) -C bridge
677 bridge-clean:
678 -@$(MAKE) -C bridge clean
679 @rm -f bridge/Makefile
681 bridge-install:
682 install -D bridge/brctl/brctl $(INSTALLDIR)/bridge/usr/sbin/brctl
683 $(STRIP) $(INSTALLDIR)/bridge/usr/sbin/brctl
685 dnsmasq:
686 @$(SEP)
687 @$(MAKE) -C dnsmasq \
688 COPTS="$(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6) $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
689 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC"
691 dnsmasq-install:
692 install -D dnsmasq/src/dnsmasq $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
693 $(STRIP) $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
695 iptables:
696 @$(SEP)
697 $(MAKE) -C iptables BINDIR=/usr/sbin LIBDIR=/usr/lib KERNEL_DIR=$(LINUXDIR) COPT_FLAGS="-Os $(EXTRACFLAGS) -U CONFIG_NVRAM_SIZE"
699 iptables-install:
700 install -D iptables/iptables $(INSTALLDIR)/iptables/usr/sbin/iptables
701 cd $(INSTALLDIR)/iptables/usr/sbin && \
702 ln -sf iptables iptables-restore
704 install -d $(INSTALLDIR)/iptables/usr/lib/iptables
705 install -D iptables/extensions/*.so $(INSTALLDIR)/iptables/usr/lib/iptables/
707 install -D iptables/libiptc.so $(INSTALLDIR)/iptables/usr/lib/libiptc.so
709 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/iptables
710 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/iptables/*.so
711 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/libiptc.so
713 ifeq ($(TCONFIG_IPV6),y)
714 install iptables/ip6tables $(INSTALLDIR)/iptables/usr/sbin/ip6tables
715 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/ip6tables
716 cd $(INSTALLDIR)/iptables/usr/sbin && \
717 ln -sf ip6tables ip6tables-restore
718 endif
720 iptables-clean:
721 -$(MAKE) -C iptables KERNEL_DIR=$(LINUXDIR) clean
723 ppp:
724 @$(SEP)
725 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
726 # $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp DFLAGS="-DDEBUG -DDEBUGALL"
728 ppp-%:
729 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
731 rp-pppoe/src/stamp-h1: rp-pppoe/src/Makefile.in
732 cd rp-pppoe/src && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
733 $(CONFIGURE) --prefix=/usr --enable-plugin=$(TOP)/pppd \
734 ac_cv_linux_kernel_pppoe=yes rpppoe_cv_pack_bitfields=rev
735 @touch rp-pppoe/src/stamp-h1
737 rp-pppoe: pppd rp-pppoe/src/stamp-h1
738 $(MAKE) -C rp-pppoe/src pppoe-relay rp-pppoe.so
740 rp-pppoe-clean:
741 -$(MAKE) -C rp-pppoe/src clean
742 @rm -f rp-pppoe/src/pppoe-relay
743 @rm -f rp-pppoe/src/stamp-h1
745 rp-pppoe-install: rp-pppoe
746 install -D rp-pppoe/src/rp-pppoe.so $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/rp-pppoe.so
747 $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/*.so
748 # install -D rp-pppoe/src/pppoe-relay $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
749 # $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
752 upnp: nvram shared iptables
754 miniupnpd-config:
755 @cd miniupnpd && ./genconfig.sh
757 miniupnpd: iptables miniupnpd-config
758 @$(SEP)
759 $(MAKE) -C miniupnpd miniupnpd -f Makefile.linux \
760 TARGET_OPENWRT="not really" CC=$(CC) \
761 CFLAGS="-Wall -Os -D_GNU_SOURCE $(EXTRACFLAGS) -I$(TOP)/iptables/include -I$(TOP)/shared" \
762 LDFLAGS="-L$(TOP)/iptables -liptc" LIBS=""
764 miniupnpd-clean:
765 -$(MAKE) -C miniupnpd -f Makefile.linux clean
766 @rm -f miniupnpd/config.h
768 miniupnpd-install:
769 install -D miniupnpd/miniupnpd $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
770 $(STRIP) $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
772 # !!TB
773 shared: busybox
775 vsftpd: $(if $(TCONFIG_FTP_SSL),openssl,)
776 @$(SEP)
777 $(MAKE) -C vsftpd
779 vsftpd-install: vsftpd
780 install -D vsftpd/vsftpd $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
781 $(STRIP) -s $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
783 ntfs-3g/Makefile:
784 cd ntfs-3g && \
785 CC=$(CC) CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
786 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
787 $(CONFIGURE) --enable-shared=no --enable-static=no \
788 --disable-library --disable-ldconfig --disable-mount-helper --with-fuse=internal \
789 --disable-ntfsprogs --disable-crypto --without-uuid \
790 --disable-posix-acls --disable-nfconv --disable-dependency-tracking
792 ntfs-3g: ntfs-3g/Makefile
793 @$(MAKE) -C ntfs-3g
795 ntfs-3g-clean:
796 -@$(MAKE) -C ntfs-3g clean
797 @rm -f ntfs-3g/Makefile
799 ntfs-3g-install: ntfs-3g
800 install -D ntfs-3g/src/ntfs-3g $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
801 $(STRIP) -s $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
802 install -d $(INSTALLDIR)/ntfs-3g/sbin && cd $(INSTALLDIR)/ntfs-3g/sbin && \
803 ln -sf ../bin/ntfs-3g mount.ntfs-3g && \
804 ln -sf ../bin/ntfs-3g mount.ntfs
806 libusb10/Makefile: libusb10/Makefile.in
807 cd libusb10 && CFLAGS="-Os -Wall $(EXTRACFLAGS)" LIBS="-lpthread" \
808 $(CONFIGURE) --prefix=/usr ac_cv_lib_rt_clock_gettime=no
810 libusb10: libusb10/Makefile
811 $(MAKE) -C $@
813 libusb10-install: libusb10
814 install -D libusb10/libusb/.libs/libusb-1.0.so $(INSTALLDIR)/libusb10/usr/lib/libusb-1.0.so
815 $(STRIP) $(INSTALLDIR)/libusb10/usr/lib/*.so
817 libusb10-clean:
818 -@$(MAKE) -C $@ clean
819 @rm -rf libusb10/Makefile
821 libusb/Makefile: libusb/Makefile.in
822 cd libusb && CFLAGS="-Wall -Os $(EXTRACFLAGS)" \
823 $(CONFIGURE) --prefix=/usr \
824 LIBUSB_1_0_CFLAGS="-I$(TOP)/libusb10/libusb" \
825 LIBUSB_1_0_LIBS="-L$(TOP)/libusb10/libusb/.libs -lusb-1.0 -lpthread \
826 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share"
828 libusb: libusb10 libusb/Makefile
829 $(MAKE) -C $@
831 libusb-install: libusb
832 install -D libusb/libusb/.libs/libusb-0.1.so $(INSTALLDIR)/libusb/usr/lib/libusb-0.1.so
833 $(STRIP) $(INSTALLDIR)/libusb/usr/lib/*.so
835 libusb-clean:
836 -@$(MAKE) -C $@ clean
837 @rm -rf libusb/Makefile
839 usbmodeswitch: libusb10
840 $(MAKE) -C $@ CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -DLIBUSB10 \
841 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share -lpthread \
842 -I$(TOP)/libusb10/libusb -L$(TOP)/libusb10/libusb/.libs -lusb-1.0"
844 usbmodeswitchdb-install:
845 @mkdir -p $(TARGETDIR)/rom/etc/usb_modeswitch.d
846 # compress whitespace
847 @for D in $(wildcard $(TOP)/usbmodeswitch/data/usb_modeswitch.d/*); do \
848 F=`basename $$D`; \
849 sed 's/###.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $$D > $(TARGETDIR)/rom/etc/usb_modeswitch.d/$$F; \
850 done
852 usbmodeswitch-install: usbmodeswitch usbmodeswitchdb-install
853 install -D usbmodeswitch/usb_modeswitch $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
854 $(STRIP) -s $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
855 @mkdir -p $(TARGETDIR)/rom/etc
856 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/usbmodeswitch/usb_modeswitch.conf > $(TARGETDIR)/rom/etc/usb_modeswitch.conf
859 radvd/stamp-h1:
860 cd radvd && CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
861 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
862 $(CONFIGURE) --prefix=""
863 @$(MAKE) -C radvd clean
864 @touch radvd/stamp-h1
866 radvd: radvd/stamp-h1
868 radvd-clean:
869 -@$(MAKE) -C radvd distclean
870 @rm -f radvd/stamp-h1
872 radvd-install: radvd
873 install -D radvd/radvd $(INSTALLDIR)/radvd/usr/sbin/radvd
874 $(STRIP) $(INSTALLDIR)/radvd/usr/sbin/radvd
876 dhcpv6/stamp-h1:
877 @cd dhcpv6 && \
878 CFLAGS="-Os -Wall $(EXTRACFLAGS) -D_GNU_SOURCE -ffunction-sections -fdata-sections" \
879 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
880 ac_cv_func_setpgrp_void=yes \
881 $(CONFIGURE) --prefix= --with-localdbdir=/var
882 @$(MAKE) -C dhcpv6 clean
883 @touch dhcpv6/stamp-h1
885 dhcpv6: dhcpv6/stamp-h1
886 @$(SEP)
887 @$(MAKE) -C dhcpv6 dhcp6c
889 dhcpv6-install: dhcpv6
890 install -D dhcpv6/dhcp6c $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
891 $(STRIP) $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
893 dhcpv6-clean:
894 -@$(MAKE) -C dhcpv6 clean
895 @rm -f dhcpv6/Makefile dhcpv6/stamp-h1
898 p910nd:
899 samba:
900 samba3:
902 nvram: shared
904 prebuilt: shared libbcmcrypto
906 vlan:
907 @$(SEP)
908 @$(MAKE) -C vlan CROSS=$(CROSS_COMPILE) # STRIPTOOL=$(STRIP)
910 vlan-install:
911 $(MAKE) -C vlan CROSS=$(CROSS_COMPILE) INSTALLDIR=$(INSTALLDIR) install # STRIPTOOL=$(STRIP)
912 $(STRIP) $(INSTALLDIR)/vlan/usr/sbin/vconfig
915 pptp-client-install:
916 install -D pptp-client/pptp $(INSTALLDIR)/pptp-client/usr/sbin/pptp
917 $(STRIP) $(INSTALLDIR)/pptp-client/usr/sbin/pptp
920 accel-pptp: pppd accel-pptp/Makefile
921 @$(MAKE) -C accel-pptp
923 accel-pptp/Makefile: accel-pptp/Makefile.in $(LINUXDIR)/include/linux/version.h
924 cd accel-pptp && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
925 $(CONFIGURE) --prefix=/usr KDIR=$(LINUXDIR) PPPDIR=$(TOP)/pppd
927 accel-pptp-clean:
928 -@$(MAKE) -C accel-pptp clean
929 @rm -f accel-pptp/Makefile
931 accel-pptp-install: accel-pptp
932 install -D accel-pptp/src/.libs/pptp.so $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
933 $(STRIP) $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
936 pppd/Makefile: pppd/linux/Makefile.top
937 cd pppd && $(CONFIGURE) --prefix=/usr --sysconfdir=/tmp
939 pppd: pppd/Makefile
940 @$(SEP)
941 @$(MAKE) -C pppd MFLAGS='$(if $(TCONFIG_IPV6),HAVE_INET6=y,) EXTRACFLAGS="$(EXTRACFLAGS)"'
943 pppd-clean:
944 -$(MAKE) -C pppd clean
945 @rm -f pppd/Makefile
947 pppd-install: pppd
948 install -D pppd/pppd/pppd $(INSTALLDIR)/pppd/usr/sbin/pppd
949 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/pppd
950 install -D pppd/chat/chat $(INSTALLDIR)/pppd/usr/sbin/chat
951 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/chat
952 ifeq ($(TCONFIG_L2TP),y)
953 install -D pppd/pppd/plugins/pppol2tp/pppol2tp.so $(INSTALLDIR)/pppd/usr/lib/pppd/pppol2tp.so
954 $(STRIP) $(INSTALLDIR)/pppd/usr/lib/pppd/*.so
955 endif
957 # ipupdate-install:
958 # install -D ipupdate/ez-ipupdate $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
959 # $(STRIP) $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
961 zebra/stamp-h1:
962 @cd zebra && rm -f config.cache && \
963 CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
964 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
965 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
966 $(CONFIGURE) --sysconfdir=/etc \
967 --enable-netlink $(if $(TCONFIG_IPV6),--enable-ipv6,--disable-ipv6) --disable-ripngd --disable-ospfd --disable-doc \
968 --disable-ospf6d --disable-bgpd --disable-bgpd-announce
969 @touch zebra/stamp-h1
971 zebra: zebra/stamp-h1
972 @$(MAKE) -C zebra CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD)
974 zebra-clean:
975 -@$(MAKE) -C zebra clean
976 @rm -f zebra/stamp-h1
978 zebra-install: zebra
979 install -D zebra/zebra/zebra $(INSTALLDIR)/zebra/usr/sbin/zebra
980 install -D zebra/ripd/ripd $(INSTALLDIR)/zebra/usr/sbin/ripd
981 install -D zebra/lib/libzebra.so $(INSTALLDIR)/zebra/usr/lib/libzebra.so
982 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/zebra
983 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/ripd
984 $(STRIP) $(INSTALLDIR)/zebra/usr/lib/libzebra.so
987 rp-l2tp-install:
988 install -d $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
989 install rp-l2tp/handlers/*.so $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
990 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp/*.so
991 install -D rp-l2tp/handlers/l2tp-control $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
992 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
993 install -D rp-l2tp/l2tpd $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
994 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
996 xl2tpd: pppd
997 CFLAGS="-g $(EXTRACFLAGS)" $(MAKE) -C $@ PREFIX=/usr xl2tpd
999 xl2tpd-install: xl2tpd
1000 install -D xl2tpd/xl2tpd $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
1001 $(STRIP) $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
1004 bpalogin-install:
1005 install -D bpalogin/bpalogin $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
1006 $(STRIP) $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
1009 # libnet:
1010 # @$(SEP)
1011 # @-mkdir -p libnet/lib
1012 # @$(MAKE) -C libnet CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
1014 # libpcap:
1015 # @$(SEP)
1016 # @$(MAKE) -C libpcap CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
1018 libbcm:
1019 @[ ! -f libbcm/Makefile ] || $(MAKE) -C libbcm
1021 libbcm-install:
1022 install -D libbcm/libbcm.so $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
1023 $(STRIP) $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
1026 iproute2:
1027 @$(SEP)
1028 @$(MAKE) -C $@ KERNEL_INCLUDE=$(LINUXDIR)/include EXTRACFLAGS="$(EXTRACFLAGS) $(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6)"
1030 iproute2-install: iproute2
1031 install -D iproute2/tc/tc $(INSTALLDIR)/iproute2/usr/sbin/tc
1032 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/tc
1033 install -D iproute2/ip/ip $(INSTALLDIR)/iproute2/usr/sbin/ip
1034 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/ip
1037 ntpc: nvram shared
1040 dropbear: dropbear/config.h
1041 @$(SEP)
1042 @$(MAKE) -C dropbear PROGRAMS="dropbear dbclient dropbearkey scp" MULTI=1
1044 dropbear-install:
1045 install -D dropbear/dropbearmulti $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1046 $(STRIP) $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1047 cd $(INSTALLDIR)/dropbear/usr/bin && \
1048 ln -sf dropbearmulti dropbear && \
1049 ln -sf dropbearmulti dropbearconvert && \
1050 ln -sf dropbearmulti dropbearkey && \
1051 ln -sf dropbearmulti dbclient && \
1052 ln -sf dropbearmulti ssh && \
1053 ln -sf dropbearmulti scp
1055 dropbear-clean:
1056 -@$(MAKE) -C dropbear clean
1057 @rm -f dropbear/config.h
1059 dropbear/config.h:
1060 cd dropbear && \
1061 CFLAGS="-Os -Wall $(EXTRACFLAGS) -DARGTYPE=3 -ffunction-sections -fdata-sections" \
1062 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1063 ac_cv_func_logout=no ac_cv_func_logwtmp=no \
1064 $(CONFIGURE) --disable-zlib --enable-syslog --disable-lastlog --disable-utmp \
1065 --disable-utmpx --disable-wtmp --disable-wtmpx --disable-pututline \
1066 --disable-pututxline --disable-loginfunc --disable-pam --enable-openpty --enable-bundled-libtom
1067 @$(MAKE) -C dropbear clean
1069 # Media libraries
1071 sqlite/stamp-h1:
1072 cd sqlite && \
1073 CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1074 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1075 $(CONFIGURE) --prefix=/usr --enable-shared --enable-static \
1076 --disable-readline --disable-dynamic-extensions --enable-threadsafe
1077 touch sqlite/stamp-h1
1079 sqlite: sqlite/stamp-h1
1080 @$(MAKE) -C sqlite all
1082 sqlite-clean:
1083 -@$(MAKE) -C sqlite clean
1084 @rm -f sqlite/stamp-h1
1086 sqlite-install: sqlite
1087 @$(SEP)
1088 ifneq ($(MEDIA_SERVER_STATIC),y)
1089 install -D sqlite/.libs/libsqlite3.so.0 $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1090 $(STRIP) $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1091 endif
1093 FFMPEG_FILTER_CONFIG= $(foreach c, $(2), --$(1)="$(c)")
1095 FFMPEG_DECODERS:=aac ac3 atrac3 flac h264 jpegls mp3 mpeg1video mpeg2video mpeg4 mpeg4aac mpegvideo png wmav1 wmav2
1096 FFMPEG_CONFIGURE_DECODERS:=$(call FFMPEG_FILTER_CONFIG,enable-decoder,$(FFMPEG_DECODERS))
1098 FFMPEG_PARSERS:=aac ac3 h264 mpeg4video mpegaudio mpegvideo
1099 FFMPEG_CONFIGURE_PARSERS:=$(call FFMPEG_FILTER_CONFIG,enable-parser,$(FFMPEG_PARSERS))
1101 FFMPEG_PROTOCOLS:=file
1102 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FFMPEG_FILTER_CONFIG,enable-protocol,$(FFMPEG_PROTOCOLS))
1104 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
1105 FFMPEG_CONFIGURE_DEMUXERS:=$(call FFMPEG_FILTER_CONFIG,disable-demuxer,$(FFMPEG_DISABLED_DEMUXERS))
1107 ffmpeg/stamp-h1: zlib
1108 cd ffmpeg && symver_asm_label=no symver_gnu_asm=no symver=no CC=$(CC) \
1109 ./configure --enable-cross-compile --arch=mips --target_os=linux \
1110 --cross-prefix=$(CROSS_COMPILE) --enable-shared --enable-gpl --disable-doc \
1111 --enable-pthreads --enable-small --disable-encoders --disable-filters \
1112 --disable-muxers --disable-devices --disable-ffmpeg --disable-ffplay \
1113 --disable-ffserver --disable-ffprobe --disable-avdevice --disable-swscale \
1114 --disable-hwaccels --disable-network --disable-bsfs --disable-mpegaudio-hp \
1115 --enable-demuxers $(FFMPEG_CONFIGURE_DEMUXERS) \
1116 --disable-decoders $(FFMPEG_CONFIGURE_DECODERS) \
1117 --disable-parsers $(FFMPEG_CONFIGURE_PARSERS) \
1118 --disable-protocols $(FFMPEG_CONFIGURE_PROTOCOLS) \
1119 --extra-cflags="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections -fPIC -I$(TOP)/zlib" \
1120 --extra-ldflags="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1121 --extra-libs="-L$(TOP)/zlib -lz" \
1122 --enable-zlib --disable-debug --prefix=''
1123 touch ffmpeg/stamp-h1
1125 ffmpeg: ffmpeg/stamp-h1 zlib
1126 @$(MAKE) -C ffmpeg all
1128 ffmpeg-clean:
1129 -@$(MAKE) -C ffmpeg clean
1130 @rm -f ffmpeg/stamp-h1 ffmpeg/config.h ffmpeg/config.mak
1132 ffmpeg-install: ffmpeg
1133 @$(SEP)
1134 ifneq ($(MEDIA_SERVER_STATIC),y)
1135 install -D ffmpeg/libavformat/libavformat.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1136 install -D ffmpeg/libavcodec/libavcodec.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1137 install -D ffmpeg/libavutil/libavutil.so.50 $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1138 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1139 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1140 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1141 endif
1143 libogg/stamp-h1:
1144 cd libogg && \
1145 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1146 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1147 $(CONFIGURE) --enable-shared --enable-static --prefix=''
1148 touch libogg/stamp-h1
1150 libogg: libogg/stamp-h1
1151 @$(MAKE) -C libogg all
1153 libogg-clean:
1154 -@$(MAKE) -C libogg clean
1155 @rm -f libogg/stamp-h1
1157 libogg-install: libogg
1158 @$(SEP)
1159 ifneq ($(MEDIA_SERVER_STATIC),y)
1160 install -D libogg/src/.libs/libogg.so.0 $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1161 $(STRIP) $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1162 endif
1164 flac/stamp-h1: libogg
1165 cd flac && \
1166 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1167 CPPFLAGS="-I$(TOP)/libogg/include -I$(LINUXDIR)/include" \
1168 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1169 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-rpath \
1170 --disable-doxygen-docs --disable-xmms-plugin --disable-cpplibs \
1171 --without-libiconv-prefix --disable-altivec --disable-3dnow --disable-sse
1172 touch flac/stamp-h1
1174 flac: flac/stamp-h1 libogg
1175 @$(MAKE) -C flac/src/libFLAC all
1177 flac-clean:
1178 -@$(MAKE) -C flac clean
1179 @rm -f flac/stamp-h1
1181 flac-install: flac
1182 @$(SEP)
1183 ifneq ($(MEDIA_SERVER_STATIC),y)
1184 install -D flac/src/libFLAC/.libs/libFLAC.so.8 $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1185 $(STRIP) $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1186 endif
1188 jpeg/stamp-h1:
1189 cd jpeg && \
1190 CFLAGS="-Os $(EXTRACFLAGS) -fPIC" CC=$(CC) AR2="touch" $(CONFIGURE) --enable-shared --enable-static --prefix=''
1191 touch jpeg/stamp-h1
1193 jpeg: jpeg/stamp-h1
1194 @$(MAKE) -C jpeg LIBTOOL="" O=o A=a CC=$(CC) AR2="touch" libjpeg.a libjpeg.so
1196 jpeg-clean:
1197 -@$(MAKE) -C jpeg clean
1198 @rm -f jpeg/stamp-h1 jpeg/Makefile
1200 jpeg-install: jpeg
1201 @$(SEP)
1202 ifneq ($(MEDIA_SERVER_STATIC),y)
1203 install -D jpeg/libjpeg.so $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1204 $(STRIP) $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1205 endif
1207 libexif/stamp-h1:
1208 cd libexif && CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1209 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1210 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1211 --disable-docs --disable-rpath --disable-nls --without-libiconv-prefix --without-libintl-prefix
1212 touch libexif/stamp-h1
1214 libexif: libexif/stamp-h1
1215 @$(MAKE) -C libexif all
1217 libexif-clean:
1218 -@$(MAKE) -C libexif clean
1219 @rm -f libexif/stamp-h1
1221 libexif-install: libexif
1222 @$(SEP)
1223 ifneq ($(MEDIA_SERVER_STATIC),y)
1224 install -D libexif/libexif/.libs/libexif.so.12 $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1225 $(STRIP) $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1226 endif
1228 zlib/stamp-h1:
1229 cd zlib && \
1230 CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1231 ./configure --shared --prefix=''
1232 touch zlib/stamp-h1
1234 zlib: zlib/stamp-h1
1235 @$(MAKE) -C zlib CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) all
1237 zlib-clean:
1238 -@$(MAKE) -C zlib clean
1239 @rm -f zlib/stamp-h1 zlib/Makefile zlib/zconf.h zlib/zlib.pc
1241 zlib-install: zlib
1242 @$(SEP)
1243 ifneq ($(MEDIA_SERVER_STATIC),y)
1244 install -d $(INSTALLDIR)/zlib/usr/lib
1245 install -D zlib/libz.so.1 $(INSTALLDIR)/zlib/usr/lib/
1246 $(STRIP) $(INSTALLDIR)/zlib/usr/lib/libz.so.1
1247 endif
1249 libid3tag/stamp-h1: zlib
1250 cd libid3tag && \
1251 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" CPPFLAGS="-I$(TOP)/zlib" \
1252 LDFLAGS="-L$(TOP)/zlib -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1253 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1254 --disable-debugging --disable-profiling
1255 touch libid3tag/stamp-h1
1257 libid3tag: libid3tag/stamp-h1 zlib
1258 @$(MAKE) -C libid3tag all
1260 libid3tag-clean:
1261 -@$(MAKE) -C libid3tag clean
1262 @rm -f libid3tag/stamp-h1
1264 libid3tag-install: libid3tag
1265 @$(SEP)
1266 ifneq ($(MEDIA_SERVER_STATIC),y)
1267 install -D libid3tag/.libs/libid3tag.so.0 $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1268 $(STRIP) $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1269 endif
1271 libvorbis/stamp-h1: libogg
1272 cd libvorbis && \
1273 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1274 CPPFLAGS="-I$(TOP)/libogg/include" \
1275 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1276 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-oggtest \
1277 --with-ogg-includes="$(TOP)/libogg/include" \
1278 --with-ogg-libraries="$(TOP)/libogg/src/.libs"
1279 touch libvorbis/stamp-h1
1281 libvorbis: libvorbis/stamp-h1
1282 @$(MAKE) -C libvorbis/lib all
1284 libvorbis-clean:
1285 -@$(MAKE) -C libvorbis clean
1286 @rm -f libvorbis/stamp-h1
1288 libvorbis-install: libvorbis
1289 @$(SEP)
1290 ifneq ($(MEDIA_SERVER_STATIC),y)
1291 install -D libvorbis/lib/.libs/libvorbis.so.0 $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1292 $(STRIP) $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1293 endif
1295 minidlna: zlib sqlite ffmpeg libogg flac jpeg libexif libid3tag libvorbis
1296 @$(SEP)
1297 @$(MAKE) -C minidlna CC=$(CC) $(if $(MEDIA_SERVER_STATIC),STATIC=1,) minidlna
1300 igmpproxy/src/Makefile: igmpproxy/src/Makefile.in
1301 cd igmpproxy && CFLAGS="-O2 -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1302 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1303 $(CONFIGURE) --prefix=/usr
1305 igmpproxy: igmpproxy/src/Makefile
1306 @$(SEP)
1307 @$(MAKE) -C igmpproxy/src
1309 igmpproxy-install: igmpproxy
1310 install -D igmpproxy/src/igmpproxy $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1311 $(STRIP) $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1313 igmpproxy-clean:
1314 -$(MAKE) -C igmpproxy/src clean
1315 @rm -f igmpproxy/src/Makefile
1317 udev:
1318 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)" \
1319 PROGRAMS=udevtrigger
1321 udev-install: udev
1322 install -d $(INSTALLDIR)
1323 install -d $(TARGETDIR)
1324 $(MAKE) -C udev DESTDIR=$(INSTALLDIR) prefix=/udev install-udevtrigger
1326 hotplug2:
1327 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1329 hotplug2-install: hotplug2
1330 $(MAKE) -C hotplug2 install PREFIX=$(INSTALLDIR)/hotplug2 SUBDIRS=""
1331 $(MAKE) -C hotplug2/examples install PREFIX=$(INSTALLDIR)/hotplug2/rom KERNELVER=$(LINUX_KERNEL)
1333 emf:
1334 $(MAKE) -C $(SRCBASE)/emf/emfconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1336 emf-install: emf
1337 $(MAKE) -C $(SRCBASE)/emf/emfconf INSTALLDIR=$(INSTALLDIR) install
1339 igs:
1340 $(MAKE) -C $(SRCBASE)/emf/igsconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1342 igs-install: igs
1343 $(MAKE) -C $(SRCBASE)/emf/igsconf INSTALLDIR=$(INSTALLDIR) install
1346 ebtables: dummy
1347 $(MAKE) -C ebtables CC=$(CC) LD=$(LD) \
1348 CFLAGS="-Os $(EXTRACFLAGS) -DEBT_MIN_ALIGN=4 -Wall -Wunused" \
1349 LOCKFILE="/var/lock/ebtables" LOCKDIR="/var/lock" \
1350 BINDIR="/usr/sbin" LIBDIR="/usr/lib/ebtables" KERNEL_INCLUDES=$(LINUXDIR)/include $(if $(TCONFIG_IPV6),DO_IPV6=1,)
1352 ebtables-install: ebtables
1353 install -D ebtables/ebtables $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1355 @mkdir -p $(TARGETDIR)/rom/etc
1356 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/ebtables/ethertypes > $(TARGETDIR)/rom/etc/ethertypes
1357 chmod 0644 $(TARGETDIR)/rom/etc/ethertypes
1359 install -d $(INSTALLDIR)/ebtables/usr/lib
1360 install -d $(INSTALLDIR)/ebtables/usr/lib/ebtables
1361 install -D ebtables/*.so $(INSTALLDIR)/ebtables/usr/lib/
1362 install -D ebtables/extensions/*.so $(INSTALLDIR)/ebtables/usr/lib/ebtables/
1364 $(STRIP) $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1365 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/ebtables/*.so
1366 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/libebt*.so
1368 ebtables-clean:
1369 make -C ebtables clean
1371 #Roadkill
1372 glib:
1373 @$(SEP)
1374 @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 \
1375 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 \
1376 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 \
1377 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 \
1378 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
1379 @$(MAKE) -C glib
1381 glib-clean:
1382 $(MAKE) -C glib clean
1384 glib-install:
1385 @$(MAKE) -C glib DESTDIR=$(INSTALLDIR)/glib install
1387 #Roadkill
1388 nocat: glib glib-install
1389 @$(SEP)
1390 @cd nocat && \
1391 NC_CONF_PATH="/" \
1392 $(CONFIGURE) --with-firewall=iptables --with-glib-prefix="$(INSTALLDIR)/glib/usr" --localstatedir=/var --sysconfdir=/etc
1393 @$(MAKE) -C nocat
1395 echo *** cleaning up glib staging after compile
1396 rm -rfv $(INSTALLDIR)/glib/usr
1397 echo *** integrate glib to nocat installdir
1398 install -d $(INSTALLDIR)/nocat/usr/lib
1399 install -D glib/.libs/libglib-1.2.so.0.0.10 $(INSTALLDIR)/nocat/usr/lib/libglib-1.2.so.0.0.10
1400 cd $(INSTALLDIR)/nocat/usr/lib && ln -s libglib-1.2.so.0.0.10 libglib-1.2.so.0
1401 $(STRIP) $(INSTALLDIR)/nocat/usr/lib/libglib-1.2.so.0.0.10
1403 nocat-clean:
1404 $(MAKE) -C nocat clean
1406 nocat-install:
1407 install -D nocat/src/splashd $(INSTALLDIR)/nocat/usr/sbin/splashd
1408 $(STRIP) $(INSTALLDIR)/nocat/usr/sbin/splashd
1409 mkdir -p $(INSTALLDIR)/nocat/usr/libexec/nocat
1410 install -D nocat/libexec/iptables/* $(INSTALLDIR)/nocat/usr/libexec/nocat
1412 lzo/stamp-h1:
1413 cd lzo && \
1414 CFLAGS="-Os -Wall -fPIC $(EXTRACFLAGS)" $(CONFIGURE) --enable-shared --enable-static
1415 touch lzo/stamp-h1
1417 lzo: lzo/stamp-h1
1419 lzo-clean:
1420 -$(MAKE) -C lzo clean
1421 @rm -f lzo/stamp-h1
1423 lzo-install: lzo
1424 install -D lzo/src/.libs/liblzo2.so $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1425 $(STRIP) $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1426 cd $(INSTALLDIR)/lzo/usr/lib && ln -sf liblzo2.so.2 liblzo2.so
1429 openvpn: openvpn/.conf openssl lzo
1431 openvpn/.conf:
1432 cd openvpn && CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1433 LDFLAGS="-L$(TOP)/openssl -L$(TOP)/lzo/src/.libs -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1434 $(CONFIGURE) --prefix= \
1435 --with-lzo-headers="$(TOP)/lzo/include" \
1436 --with-ssl-headers="$(TOP)/openssl/include/" \
1437 --with-iproute-path="/usr/sbin/ip" \
1438 --disable-debug --disable-plugins --enable-management --enable-small \
1439 --disable-selinux --disable-socks --enable-password-save
1440 touch openvpn/.conf
1442 openvpn-clean:
1443 -$(MAKE) -C openvpn clean
1444 @rm -f openvpn/.conf
1446 openvpn-install: openvpn
1447 install -D openvpn/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1448 $(STRIP) -s $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1449 chmod 0500 $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1452 sd-idle/stamp-h1:
1453 cd sd-idle \
1454 CFLAGS="-Os -Wall --host=mipsel-linux --target=mipsel-linux $(EXTRACFLAGS)" \
1455 $(MAKE) -C sd-idle
1456 chmod 0755 sd-idle/sd-idle
1457 touch sd-idle/stamp-h1
1459 sd-idle-clean:
1460 -$(MAKE) -C sd-idle clean
1461 @rm -f sd-idle/stamp-h1
1463 sd-idle-install: sd-idle/stamp-h1
1464 install -d $(INSTALLDIR)/sd-idle/usr/bin
1465 install -D sd-idle/sd-idle $(INSTALLDIR)/sd-idle/usr/bin/sd-idle
1466 $(STRIP) -s $(INSTALLDIR)/sd-idle/usr/bin/sd-idle
1468 snmp/stamp-h1:
1469 cd snmp && \
1470 CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1471 $(CONFIGURE) --prefix=/usr --with-endianness=little --enable-mini-agent --disable-debugging \
1472 --disable-privacy --without-opaque-special-types --with-persistent-directory=/tmp/snmp-persist \
1473 --with-default-snmp-version=3 --with-sys-contact=root --with-sys-location=Unknown --with-logfile=/dev/null \
1474 --with-out-transports=UDPIPv6,TCPIPv6,AAL5PVC,IPX,TCP,Unix --enable-shared=no --enable-static --with-gnu-ld \
1475 --enable-internal-md5 --with-copy-persistent-files=no --without-openssl -sysconfdir=/tmp \
1476 --with-mib-modules=mibII,host,mibII/ip,mibII/tcp,mibII/udp,mibII/icmp,mibII/var_route,mibII/kernel_linux,qos,ucd_snmp \
1477 --with-out-mib-modules=snmpv3mibs,agent_mips,agentx,notification,utilities,target --disable-ipv6 --with-defaults \
1478 --without-efence --without-rsaref --without-kmem-usage --without-rpm --without-dmalloc
1479 touch snmp/stamp-h1
1481 snmp: snmp/stamp-h1
1482 @$(SEP)
1483 $(MAKE) -C snmp
1485 snmp-clean:
1486 -$(MAKE) -C snmp clean
1487 @rm -f snmp/stamp-h1
1489 snmp-install: snmp
1490 install -D snmp/agent/snmpd $(INSTALLDIR)/snmp/usr/sbin/snmpd
1491 $(STRIP) $(INSTALLDIR)/snmp/usr/sbin/snmpd
1494 # Generic rules
1498 @[ ! -d $* ] || ( $(SEP); $(MAKE) -C $* )
1501 %-clean:
1502 @-[ ! -d $* ] || $(MAKE) -C $* clean
1504 %-distclean:
1505 @-[ ! -d $* ] || $(MAKE) -C $* distclean
1507 %-install: %
1508 @[ ! -d $* ] || $(MAKE) -C $* install INSTALLDIR=$(INSTALLDIR)/$*
1510 %-build:
1511 $(MAKE) $*-clean $*
1513 $(obj-y) $(obj-n) $(obj-clean) $(obj-install): dummy
1515 .PHONY: all clean distclean mrproper install package
1516 .PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
1517 .PHONY: dummy libnet libpcap