few CFLAGS and CPPFLAGS added
[tomato.git] / release / src / router / Makefile
blobada05fed5519e59e1c08b3ee1f09b2f4982ffa6d
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
49 # !!TB - updated Broadcom Wireless driver
50 obj-y += et
51 obj-y += libbcmcrypto
52 obj-y += wlconf
54 obj-y += cyassl
55 obj-y += mssl
56 obj-y += mdu
58 # !!TB
59 obj-$(TCONFIG_USB) += p910nd
60 obj-$(TCONFIG_USB) += scsi-idle
61 obj-y += libusb10
62 #obj-y += libusb
63 obj-y += usbmodeswitch
64 obj-$(TCONFIG_FTP) += vsftpd
66 ifeq ($(CONFIG_LINUX26),y)
67 ifeq ($(TCONFIG_SAMBASRV),y)
68 NEED_EX_NLS = y
69 endif
70 ifeq ($(TCONFIG_USB_EXTRAS),y)
71 NEED_EX_USB = y
72 endif
73 endif
75 ifeq ($(TCONFIG_SAMBASRV),y)
76 ifeq ($(TCONFIG_SAMBA3),y)
77 NEED_SAMBA3 = y
78 else
79 NEED_SAMBA2 = y
80 endif
81 endif
83 ifeq ($(TCONFIG_IPV6),y)
84 export TCONFIG_IPV6 := y
85 else
86 TCONFIG_IPV6 :=
87 endif
89 obj-$(NEED_SAMBA2) += samba
90 obj-$(NEED_SAMBA3) += samba3
91 obj-$(TCONFIG_NTFS) += ntfs-3g
92 obj-$(TCONFIG_EBTABLES) += ebtables
93 obj-$(TCONFIG_IPV6) += radvd
94 obj-$(TCONFIG_IPV6) += dhcpv6
96 obj-$(TCONFIG_MEDIA_SERVER) += zlib
97 obj-$(TCONFIG_MEDIA_SERVER) += sqlite
98 obj-$(TCONFIG_MEDIA_SERVER) += ffmpeg
99 obj-$(TCONFIG_MEDIA_SERVER) += libogg
100 obj-$(TCONFIG_MEDIA_SERVER) += flac
101 obj-$(TCONFIG_MEDIA_SERVER) += jpeg
102 obj-$(TCONFIG_MEDIA_SERVER) += libexif
103 obj-$(TCONFIG_MEDIA_SERVER) += libid3tag
104 obj-$(TCONFIG_MEDIA_SERVER) += libvorbis
105 obj-$(TCONFIG_MEDIA_SERVER) += minidlna
106 MEDIA_SERVER_STATIC=y
108 obj-y += miniupnpd
109 # obj-y += upnp
113 # configurable packages
115 obj-$(TCONFIG_L2TP) += xl2tpd
116 obj-$(TCONFIG_PPTP) += accel-pptp
117 obj-$(TCONFIG_HTTPS) += openssl
118 obj-$(TCONFIG_SSH) += dropbear
119 obj-$(TCONFIG_ZEBRA) += zebra
120 # obj-$(TCONFIG_IPP2P) += ipp2p
121 obj-$(TCONFIG_LZO) += lzo
122 obj-$(TCONFIG_OPENVPN) += openvpn
123 obj-$(TCONFIG_EMF) += emf
124 obj-$(TCONFIG_EMF) += igs
126 obj-$(TCONFIG_BT) += openssl
127 obj-$(TCONFIG_BT) += libevent
128 obj-$(TCONFIG_BT) += libcurl
129 obj-$(TCONFIG_BT) += transmission
130 obj-$(TCONFIG_BT) += zlib
132 obj-$(CONFIG_LINUX26) += hotplug2
133 obj-$(CONFIG_LINUX26) += udev
135 ifeq ($(TCONFIG_OPENVPN),y)
136 export FULL_OPENSSL := y
137 else
138 ifeq ($(TCONFIG_FTP_SSL),y)
139 export FULL_OPENSSL := y
140 else
141 ifeq ($(TCONFIG_BT),y)
142 export FULL_OPENSSL := y
143 else
144 FULL_OPENSSL :=
145 endif
146 endif
147 endif
149 obj-clean := $(foreach obj, $(obj-y) $(obj-n) $(obj-), $(obj)-clean)
150 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 DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
198 find $(TARGETDIR)/lib/modules -name wl.*o -exec $(STRIP) --strip-unneeded {} \;
199 find $(TARGETDIR)/lib/modules -name et.*o -exec $(STRIP) --strip-unneeded {} \;
200 find $(TARGETDIR)/lib/modules -name bcm57*.*o -exec $(STRIP) --strip-unneeded {} \;
201 find $(TARGETDIR)/lib/modules -name ctf.*o -exec $(STRIP) --strip-unneeded {} \;
202 find $(TARGETDIR)/lib/modules -name emf.*o -exec $(STRIP) --strip-unneeded {} \;
203 find $(TARGETDIR)/lib/modules -name igs.*o -exec $(STRIP) --strip-unneeded {} \;
204 find $(TARGETDIR)/lib/modules -name jffs*.*o -exec $(STRIP) --strip-unneeded {} \;
206 find $(TARGETDIR)/lib/modules -name *.*o -exec $(STRIP) --strip-debug {} \;
208 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv diag/* . && rm -rf diag
210 # nice and clean
211 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et.4702/* . && rm -rf et.4702 || true
212 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et/* . && rm -rf et
213 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv wl/* . && rm -rf wl
214 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv cifs/* . && rm -rf cifs
215 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs2/* . && rm -rf jffs2 || true
216 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs/* . && rm -rf jffs || true
217 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_inflate/* . && rm -rf zlib_inflate || true
218 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_deflate/* . && rm -rf zlib_deflate || true
219 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv lzo/* . && rm -rf lzo || true
220 rm -rf $(TARGETDIR)/lib/modules/*/pcmcia
222 ##!!TB
223 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext2/* . && rm -rf ext2 || true
224 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext3/* . && rm -rf ext3 || true
225 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jbd/* . && rm -rf jbd || true
226 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fat/* . && rm -rf fat || true
227 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv vfat/* . && rm -rf vfat || true
228 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv msdos/* . && rm -rf msdos || true
229 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fuse/* . && rm -rf fuse || true
230 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ntfs/* . && rm -rf ntfs || true
231 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv smbfs/* . && rm -rf smbfs || true
232 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv reiserfs/* . && rm -rf reiserfs || true
233 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfsplus/* . && rm -rf hfsplus || true
234 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv lockd/* . && rm -rf lockd || true
235 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfsd/* . && rm -rf nfsd || true
236 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfs/* . && rm -rf nfs || true
237 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv xfs/* . && rm -rf xfs || true
238 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nls/* . && rm -rf nls || true
239 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv exportfs/* . && rm -rf exportfs || true
240 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv sunrpc/* . && rm -rf sunrpc || true
241 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv auth_gss/* . && rm -rf auth_gss || true
242 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv oss/* . && rm -rf oss || true
243 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv seq/* . && rm -rf seq || true
244 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv core/* . && rm -rf core || true
245 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv usb/* . && rm -rf usb || true
246 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv hcd/* . && rm -rf hcd || true
247 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv host/* . && rm -rf host || true
248 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv storage/* . && rm -rf storage || true
249 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv serial/* . && rm -rf serial || true
250 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv core/* . && rm -rf core || true
251 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv class/* . && rm -rf class || true
252 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv misc/* . && rm -rf misc || true
253 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv usbip/* . && rm -rf usbip || true
254 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/hid && mv usbhid/* . && rm -rf usbhid || true
255 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv joystick/* . && rm -rf joystick || true
256 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv keyboard/* . && rm -rf keyboard || true
257 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv misc/* . && rm -rf misc || true
258 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv mouse/* . && rm -rf mouse || true
259 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv uvc/* . && rm -rf uvc || true
260 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media && mv video/* . && rm -rf video || true
262 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv bcm57xx/* . && rm -rf bcm57xx || true
263 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv emf/* . && rm -rf emf || true
264 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv igs/* . && rm -rf igs || true
265 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv ctf/* . && rm -rf ctf || true
266 cd $(TARGETDIR)/lib/modules && rm -f */source || true
268 # misc
269 for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
270 (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
271 done
273 ifneq ($(TCONFIG_L7),y)
274 rm -f $(TARGETDIR)/usr/lib/iptables/libipt_layer7.so
275 endif
277 # uClibc
278 install $(LIBDIR)/ld-uClibc.so.0 $(TARGETDIR)/lib/
279 install $(LIBDIR)/libcrypt.so.0 $(TARGETDIR)/lib/
280 install $(LIBDIR)/libpthread.so.0 $(TARGETDIR)/lib/
281 install $(LIBDIR)/libgcc_s.so.1 $(TARGETDIR)/lib/
282 $(STRIP) $(TARGETDIR)/lib/libgcc_s.so.1
283 install $(LIBDIR)/libc.so.0 $(TARGETDIR)/lib/
284 install $(LIBDIR)/libdl.so.0 $(TARGETDIR)/lib/
285 install $(LIBDIR)/libm.so.0 $(TARGETDIR)/lib/
286 install $(LIBDIR)/libnsl.so.0 $(TARGETDIR)/lib/
287 ifeq ($(TCONFIG_SSH),y)
288 install $(LIBDIR)/libutil.so.0 $(TARGETDIR)/lib/
289 endif
290 ifneq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
291 install $(LIBDIR)/libresolv.so.0 $(TARGETDIR)/lib/
292 $(STRIP) $(TARGETDIR)/lib/*.so.0
293 endif
295 @cd $(TARGETDIR) && $(TOP)/others/rootprep.sh
297 @echo ---
299 ifeq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
300 @$(SRCBASE)/btools/libfoo.pl
301 else
302 @$(SRCBASE)/btools/libfoo.pl --noopt
303 endif
304 @chmod 0555 $(TARGETDIR)/lib/*.so*
305 @chmod 0555 $(TARGETDIR)/usr/lib/*.so*
307 # !!TB - moved to run after libfoo.pl - to make sure shared libs include all symbols needed by extras
308 # separated/copied extra stuff
309 @rm -rf $(PLATFORMDIR)/extras
310 @mkdir $(PLATFORMDIR)/extras
311 @mv $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/ip_gre.*o $(PLATFORMDIR)/extras/ || true
313 $(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
314 $(if $(TCONFIG_EBTABLES),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/bridge/netfilter/ebt*.*o $(PLATFORMDIR)/extras/ || true
316 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ifb.*o $(PLATFORMDIR)/extras/ || true
317 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sched/sch_red.*o $(PLATFORMDIR)/extras/ || true
318 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/ntfs.*o $(PLATFORMDIR)/extras/ || true
319 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/smbfs.*o $(PLATFORMDIR)/extras/ || true
320 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/reiserfs.*o $(PLATFORMDIR)/extras/ || true
321 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/hfsplus.*o $(PLATFORMDIR)/extras/ || true
322 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/nfs.*o $(PLATFORMDIR)/extras/ || true
323 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/nfsd.*o $(PLATFORMDIR)/extras/ || true
324 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/lockd.*o $(PLATFORMDIR)/extras/ || true
325 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/exportfs.*o $(PLATFORMDIR)/extras/ || true
326 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sunrpc.*o $(PLATFORMDIR)/extras/ || true
327 @mv $(TARGETDIR)/lib/modules/*/kernel/net/auth_rpcgss.*o $(PLATFORMDIR)/extras/ || true
328 @mv $(TARGETDIR)/lib/modules/*/kernel/net/rpcsec_gss_krb5.*o $(PLATFORMDIR)/extras/ || true
329 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/xfs.*o $(PLATFORMDIR)/extras/ || true
330 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi/sr_mod.*o $(PLATFORMDIR)/extras/ || true
331 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/scanner.*o $(PLATFORMDIR)/extras/ || true
333 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbserial.*o $(PLATFORMDIR)/extras/ || true
334 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/option.*o $(PLATFORMDIR)/extras/ || true
335 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/sierra.*o $(PLATFORMDIR)/extras/ || true
336 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/*acm.*o $(PLATFORMDIR)/extras/ || true
337 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ftdi_sio.*o $(PLATFORMDIR)/extras/ || true
338 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/pl2303.*o $(PLATFORMDIR)/extras/ || true
340 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbip*.*o $(PLATFORMDIR)/extras/ || true
341 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbkbd.*o $(PLATFORMDIR)/extras/ || true
342 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbmouse.*o $(PLATFORMDIR)/extras/ || true
343 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/hid*.*o $(PLATFORMDIR)/extras/ || true
344 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ipw.*o $(PLATFORMDIR)/extras/ || true
345 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/audio.*o $(PLATFORMDIR)/extras/ || true
346 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ov51*.*o $(PLATFORMDIR)/extras/ || true
347 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/pwc*.*o $(PLATFORMDIR)/extras/ || true
348 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/emi*.*o $(PLATFORMDIR)/extras/ || true
349 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/mii.*o $(PLATFORMDIR)/extras/ || true
350 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/cdc_ether.*o $(PLATFORMDIR)/extras/ || true
351 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/cdc_subset.*o $(PLATFORMDIR)/extras/ || true
352 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/usbnet.*o $(PLATFORMDIR)/extras/ || true
353 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/rndis_host.*o $(PLATFORMDIR)/extras/ || true
354 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb || true
355 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/media/* $(PLATFORMDIR)/extras/ || true
356 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/media || true
357 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/sound/* $(PLATFORMDIR)/extras/ || true
358 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/sound || true
359 @mv $(TARGETDIR)/lib/modules/*/kernel/sound/* $(PLATFORMDIR)/extras/ || true
360 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/sound || true
361 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/input/* $(PLATFORMDIR)/extras/ || true
362 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/input || true
363 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/hid/* $(PLATFORMDIR)/extras/ || true
364 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/hid || true
365 @cp -f $(TARGETDIR)/lib/modules/*/kernel/drivers/net/bcm57*.*o $(PLATFORMDIR)/extras/ || true
366 $(if $(TCONFIG_PPTP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pptp.*o $(PLATFORMDIR)/extras/ || true
367 $(if $(TCONFIG_L2TP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pppol2tp.*o $(PLATFORMDIR)/extras/ || true
368 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ppp_deflate.*o $(PLATFORMDIR)/extras/ || true
369 @mv $(TARGETDIR)/lib/modules/*/kernel/crypto/* $(PLATFORMDIR)/extras/ || true
370 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/crypto || true
372 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_cp9*.*o $(PLATFORMDIR)/extras/ || true
373 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_cp1251.*o $(PLATFORMDIR)/extras/ || true
374 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_euc-jp.*o $(PLATFORMDIR)/extras/ || true
375 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_sjis.*o $(PLATFORMDIR)/extras/ || true
376 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_gb2312.*o $(PLATFORMDIR)/extras/ || true
377 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_euc-kr.*o $(PLATFORMDIR)/extras/ || true
378 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_big5.*o $(PLATFORMDIR)/extras/ || true
380 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_*.*o $(PLATFORMDIR)/extras/ || true
381 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/*.*o $(PLATFORMDIR)/extras/ || true
382 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi/*.*o $(PLATFORMDIR)/extras/ || true
383 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/leds/*.*o $(PLATFORMDIR)/extras/ || true
384 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/ext2.*o $(PLATFORMDIR)/extras/ || true
385 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/ext3.*o $(PLATFORMDIR)/extras/ || true
386 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jbd.*o $(PLATFORMDIR)/extras/ || true
387 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/mbcache.*o $(PLATFORMDIR)/extras/ || true
388 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fat.*o $(PLATFORMDIR)/extras/ || true
389 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/vfat.*o $(PLATFORMDIR)/extras/ || true
390 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/msdos.*o $(PLATFORMDIR)/extras/ || true
391 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fuse.*o $(PLATFORMDIR)/extras/ || true
392 ifneq ($(TCONFIG_USB),y)
393 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/usb || true
394 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi || true
395 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/leds || true
396 endif
398 $(if $(TCONFIG_USB_EXTRAS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/connector/cn.*o $(PLATFORMDIR)/extras/ || true
399 $(if $(TCONFIG_USB_EXTRAS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/block/loop.*o $(PLATFORMDIR)/extras/ || true
400 ifneq ($(TCONFIG_USB_EXTRAS),y)
401 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/connector || true
402 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/block || true
403 endif
404 $(if $(TCONFIG_CIFS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/cifs.*o $(PLATFORMDIR)/extras/ || true
405 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@mv,@cp -f),@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jffs2.*o $(PLATFORMDIR)/extras/ || true
406 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@mv,@cp -f),@mv) $(TARGETDIR)/lib/modules/*/kernel/lib/zlib_*.*o $(PLATFORMDIR)/extras/ || true
407 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@cp -f,@mv),@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jffs.*o $(PLATFORMDIR)/extras/ || true
408 [ ! -f $(TARGETDIR)/lib/modules/*/kernel/lib/* ] && rm -rf $(TARGETDIR)/lib/modules/*/kernel/lib || true
409 $(if $(TCONFIG_L7),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/netfilter/ipt_layer7.*o $(PLATFORMDIR)/extras/ || true
410 $(if $(TCONFIG_L7),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/netfilter/xt_layer7.*o $(PLATFORMDIR)/extras/ || true
412 @mkdir -p $(PLATFORMDIR)/extras/apps
413 @mkdir -p $(PLATFORMDIR)/extras/lib
415 @mv $(TARGETDIR)/usr/sbin/ttcp $(PLATFORMDIR)/extras/apps/ || true
416 @mv $(TARGETDIR)/usr/sbin/mii-tool $(PLATFORMDIR)/extras/apps/ || true
417 @mv $(TARGETDIR)/usr/sbin/robocfg $(PLATFORMDIR)/extras/apps/ || true
419 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/lib/libusb* $(PLATFORMDIR)/extras/lib/ || true
420 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/sbin/usb_modeswitch $(PLATFORMDIR)/extras/apps/ || true
421 @cp usbmodeswitch/usb_modeswitch.conf $(PLATFORMDIR)/extras/apps/usb_modeswitch.conf || true
422 @cp usbmodeswitch/usb_modeswitch.setup $(PLATFORMDIR)/extras/apps/usb_modeswitch.setup || true
423 @mkdir -p $(PLATFORMDIR)/extras/apps/usb_modeswitch.d
424 @cp -f usbmodeswitch/data/usb_modeswitch.d/* $(PLATFORMDIR)/extras/apps/usb_modeswitch.d || true
425 ifneq ($(NEED_EX_USB),y)
426 @rm -rf $(TARGETDIR)/rom/etc/usb_modeswitch.d || true
427 @rm -f $(TARGETDIR)/rom/etc/usb_modeswitch.conf || true
428 endif
429 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/sbin/chat $(PLATFORMDIR)/extras/apps/ || true
431 @mkdir -p $(TARGETDIR)/rom/etc/l7-protocols
432 ifeq ($(TCONFIG_L7PAT),y)
433 @cd layer7 && ./squish.sh
434 cp layer7/squished/*.pat $(TARGETDIR)/rom/etc/l7-protocols
435 endif
437 busybox/examples/depmod.pl -k $(LINUXDIR)/vmlinux -b $(TARGETDIR)/lib/modules/*/
438 @mv $(TARGETDIR)/lib/modules/*/modules.dep $(TARGETDIR)/lib/modules/
439 @echo ---
441 @rm -f $(TARGETDIR)/lib/modules/*/build
443 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs-lzma
444 @$(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(TARGETDIR) $(PLATFORMDIR)/target.image -all-root -noappend -nopad | tee target.info
446 # Package kernel and filesystem
447 # if grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
448 # cp $(PLATFORMDIR)/target.image $(LINUXDIR)/arch/mips/ramdisk/$${CONFIG_EMBEDDED_RAMDISK_IMAGE} ; \
449 # $(MAKE) -C $(LINUXDIR) zImage ; \
450 # else \
451 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz $(PLATFORMDIR)/ ; \
452 # trx -o $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image ; \
453 # fi
455 # Pad self-booting Linux to a 64 KB boundary
456 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage $(PLATFORMDIR)/
457 # dd conv=sync bs=64k < $(PLATFORMDIR)/zImage > $(PLATFORMDIR)/linux.bin
458 # Append filesystem to self-booting Linux
459 # cat $(PLATFORMDIR)/target.image >> $(PLATFORMDIR)/linux.bin
462 libc: $(LIBDIR)/ld-uClibc.so.0
463 # $(MAKE) -C ../../../tools-src/uClibc all
464 # $(MAKE) -C ../../../tools-src/uClibc install
468 # cleaners
471 clean: clean-build $(obj-clean)
472 rm -rf layer7/squished
473 rm -f .ipv6-y .ipv6-n
474 rm -f .fullssl-y .fullssl-n
475 make -C config clean
477 clean-build: dummy
478 rm -rf $(TARGETDIR)
479 rm -rf $(INSTALLDIR)
480 rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image
481 rm -rf $(PLATFORMDIR)/extras
483 distclean: clean
484 ifneq ($(INSIDE_MAK),1)
485 $(MAKE) -C $(SRCBASE) $@ INSIDE_MAK=1
486 endif
487 # -rm -f $(LIBDIR)/*.so.0 $(LIBDIR)/*.so
490 # configuration
493 CONFIG_IN := config/config.in
495 config/conf config/mconf:
496 @$(MAKE) -C config
498 rconf: config/conf
499 @config/conf $(CONFIG_IN)
501 rmconf: config/mconf
502 @config/mconf $(CONFIG_IN)
504 roldconf: config/conf
505 @config/conf -o $(CONFIG_IN)
506 @$(MAKE) shared-clean rc-clean nvram-clean httpd-clean prebuilt-clean libbcmcrypto-clean dhcpv6-clean
508 kconf:
509 @$(MAKE) -C $(LINUXDIR) config
511 kmconf:
512 @$(MAKE) -C $(LINUXDIR) menuconfig
514 koldconf:
515 @$(MAKE) -C $(LINUXDIR) oldconfig
516 @$(MAKE) -C $(LINUXDIR) include/linux/version.h
518 bboldconf:
519 @$(MAKE) -C busybox oldconfig
521 config conf: rconf kconf
523 menuconfig mconf: rmconf kmconf
525 .ipv6-y .ipv6-n:
526 @rm -f .ipv6-y .ipv6-n
527 @$(MAKE) iptables-clean ebtables-clean pppd-clean zebra-clean dnsmasq-clean iproute2-clean
528 @touch $@
530 .fullssl-y .fullssl-n:
531 @rm -f .fullssl-y .fullssl-n
532 @$(MAKE) openssl-clean vsftpd-clean mssl-clean mdu-clean httpd-clean
533 @touch $@
535 dependconf: .ipv6-$(if $(TCONFIG_IPV6),y,n) .fullssl-$(if $(FULL_OPENSSL),y,n)
537 oldconfig oldconf: koldconf roldconf dependconf bboldconf
541 # overrides and extra dependencies
544 busybox: dummy
545 @$(MAKE) -C busybox EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)"
547 # V=1
549 busybox-install:
550 rm -rf $(INSTALLDIR)/busybox
551 $(MAKE) -C busybox install EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)" CONFIG_PREFIX=$(INSTALLDIR)/busybox
553 busybox-clean:
554 $(MAKE) -C busybox distclean
556 busybox-config:
557 $(MAKE) -C busybox menuconfig
560 httpd: shared nvram mssl
561 @$(SEP)
562 @$(MAKE) -C httpd
564 www-install:
565 @$(MAKE) -C www install INSTALLDIR=$(INSTALLDIR)/www TOMATO_EXPERIMENTAL=$(TOMATO_EXPERIMENTAL)
567 matrixssl:
568 @$(SEP)
569 @$(MAKE) -C matrixssl/src
571 matrixssl-install:
572 @true
574 matrixssl-clean:
575 $(MAKE) -C matrixssl/src clean
577 cyassl/stamp-h1:
578 @cd cyassl && CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
579 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections \
580 -DNO_MD4 -DNO_AES -DNO_ERROR_STRINGS -DNO_HC128 -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED" \
581 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
582 PTHREAD_CFLAGS="-lpthread" PTHREAD_LIBS="-lpthread" \
583 $(CONFIGURE) --with-libz=no
584 @touch cyassl/stamp-h1
586 cyassl: cyassl/stamp-h1
587 @$(SEP)
588 @$(MAKE) -C cyassl
590 cyassl-clean:
591 -@$(MAKE) -C cyassl clean
592 @rm -f cyassl/stamp-h1
594 cyassl-install:
595 @true
597 ifeq ($(FULL_OPENSSL),y)
598 OPENSSL_CIPHERS:=enable-rc5
599 else
600 OPENSSL_CIPHERS:=no-dh no-idea no-rc2 no-rc5 no-aes no-aes192 no-cast no-des no-modes no-tls1 no-tlsext
601 endif
603 openssl/stamp-h1:
604 cd openssl && \
605 ./Configure linux-mipsel --openssldir=/etc --cross-compile-prefix=' ' \
606 -ffunction-sections -fdata-sections -Wl,--gc-sections \
607 shared $(OPENSSL_CIPHERS) \
608 no-sha0 no-smime no-camellia no-krb5 no-rmd160 no-ripemd \
609 no-seed no-capieng no-cms no-gms no-gmp no-rfc3779 \
610 no-ec no-ecdh no-ecdsa no-err no-hw no-jpake no-threads \
611 no-zlib no-engine no-engines no-sse2 no-perlasm \
612 no-dtls1 no-store no-psk no-md2 no-mdc2 no-ts
614 @$(MAKE) -C openssl clean
615 @touch openssl/stamp-h1
617 openssl: openssl/stamp-h1
619 openssl-clean:
620 -@$(MAKE) -C openssl clean
621 @rm -f openssl/stamp-h1
623 openssl-install: openssl
624 install -D openssl/libcrypto.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
625 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
626 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libcrypto.so.1.0.0 libcrypto.so
628 install -D openssl/apps/openssl $(INSTALLDIR)/openssl/usr/sbin/openssl
629 $(STRIP) $(INSTALLDIR)/openssl/usr/sbin/openssl
630 chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/openssl
632 install -D -m 0500 httpd/gencert.sh $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
634 # perl -e 'while (<>) { s/.SECS/time()-(24*60*60)/e; print; }' < httpd/gencert.sh > $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
635 # chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
637 ifeq ($(FULL_OPENSSL),y)
638 install -D openssl/libssl.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
639 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
640 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libssl.so.1.0.0 libssl.so
641 endif
643 mssl: $(if $(FULL_OPENSSL),openssl,cyassl)
645 mdu: shared mssl
647 rc: nvram shared
649 bridge/Makefile:
650 cd bridge && CFLAGS="-Os -g $(EXTRACFLAGS)" \
651 $(CONFIGURE) --prefix="" --with-linux-headers=$(LINUXDIR)/include
653 bridge: bridge/Makefile
654 @$(SEP)
655 @$(MAKE) -C bridge
657 bridge-clean:
658 -@$(MAKE) -C bridge clean
659 @rm -f bridge/Makefile
661 bridge-install:
662 install -D bridge/brctl/brctl $(INSTALLDIR)/bridge/usr/sbin/brctl
663 $(STRIP) $(INSTALLDIR)/bridge/usr/sbin/brctl
665 dnsmasq:
666 @$(SEP)
667 @$(MAKE) -C dnsmasq \
668 COPTS="$(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6) $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
669 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC"
671 dnsmasq-install:
672 install -D dnsmasq/src/dnsmasq $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
673 $(STRIP) $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
675 iptables:
676 @$(SEP)
677 $(MAKE) -C iptables BINDIR=/usr/sbin LIBDIR=/usr/lib KERNEL_DIR=$(LINUXDIR) COPT_FLAGS="-Os $(EXTRACFLAGS)"
679 iptables-install:
680 install -D iptables/iptables $(INSTALLDIR)/iptables/usr/sbin/iptables
681 cd $(INSTALLDIR)/iptables/usr/sbin && \
682 ln -sf iptables iptables-restore
684 install -d $(INSTALLDIR)/iptables/usr/lib/iptables
685 install -D iptables/extensions/*.so $(INSTALLDIR)/iptables/usr/lib/iptables/
687 install -D iptables/libiptc.so $(INSTALLDIR)/iptables/usr/lib/libiptc.so
689 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/iptables
690 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/iptables/*.so
691 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/libiptc.so
693 ifeq ($(TCONFIG_IPV6),y)
694 install iptables/ip6tables $(INSTALLDIR)/iptables/usr/sbin/ip6tables
695 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/ip6tables
696 cd $(INSTALLDIR)/iptables/usr/sbin && \
697 ln -sf ip6tables ip6tables-restore
698 endif
700 iptables-clean:
701 -$(MAKE) -C iptables KERNEL_DIR=$(LINUXDIR) clean
703 ppp:
704 @$(SEP)
705 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
706 # $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp DFLAGS="-DDEBUG -DDEBUGALL"
708 ppp-%:
709 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
711 rp-pppoe/src/stamp-h1: rp-pppoe/src/Makefile.in
712 cd rp-pppoe/src && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
713 $(CONFIGURE) --prefix=/usr --enable-plugin=$(TOP)/pppd \
714 ac_cv_linux_kernel_pppoe=yes rpppoe_cv_pack_bitfields=rev
715 @touch rp-pppoe/src/stamp-h1
717 rp-pppoe: pppd rp-pppoe/src/stamp-h1
718 $(MAKE) -C rp-pppoe/src pppoe-relay rp-pppoe.so
720 rp-pppoe-clean:
721 -$(MAKE) -C rp-pppoe/src clean
722 @rm -f rp-pppoe/src/pppoe-relay
723 @rm -f rp-pppoe/src/stamp-h1
725 rp-pppoe-install: rp-pppoe
726 install -D rp-pppoe/src/rp-pppoe.so $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/rp-pppoe.so
727 $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/*.so
728 # install -D rp-pppoe/src/pppoe-relay $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
729 # $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
732 upnp: nvram shared iptables
734 miniupnpd: iptables
735 @$(SEP)
736 $(MAKE) -C miniupnpd -f Makefile.tomato
738 miniupnpd-clean:
739 -$(MAKE) -C miniupnpd -f Makefile.tomato clean
741 miniupnpd-install:
742 install -D miniupnpd/miniupnpd $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
743 $(STRIP) $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
745 # !!TB
746 shared: busybox
748 vsftpd: $(if $(TCONFIG_FTP_SSL),openssl,)
749 @$(SEP)
750 $(MAKE) -C vsftpd
752 vsftpd-install: vsftpd
753 install -D vsftpd/vsftpd $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
754 $(STRIP) -s $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
756 ntfs-3g/Makefile:
757 cd ntfs-3g && \
758 CC=$(CC) CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
759 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
760 $(CONFIGURE) --enable-shared=no --enable-static=no \
761 --disable-library --disable-ldconfig --disable-mount-helper --with-fuse=internal \
762 --disable-posix-acls --disable-nfconv --disable-dependency-tracking
764 ntfs-3g: ntfs-3g/Makefile
765 @$(MAKE) -C ntfs-3g
767 ntfs-3g-clean:
768 -@$(MAKE) -C ntfs-3g clean
769 @rm -f ntfs-3g/Makefile
771 ntfs-3g-install: ntfs-3g
772 install -D ntfs-3g/src/ntfs-3g $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
773 $(STRIP) -s $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
774 install -d $(INSTALLDIR)/ntfs-3g/sbin && cd $(INSTALLDIR)/ntfs-3g/sbin && \
775 ln -sf ../bin/ntfs-3g mount.ntfs-3g && \
776 ln -sf ../bin/ntfs-3g mount.ntfs
778 libusb10/Makefile: libusb10/Makefile.in
779 cd libusb10 && CFLAGS="-Os -Wall $(EXTRACFLAGS)" LIBS="-lpthread" \
780 $(CONFIGURE) --prefix=/usr ac_cv_lib_rt_clock_gettime=no
782 libusb10: libusb10/Makefile
783 $(MAKE) -C $@
785 libusb10-install: libusb10
786 install -D libusb10/libusb/.libs/libusb-1.0.so $(INSTALLDIR)/libusb10/usr/lib/libusb-1.0.so
787 $(STRIP) $(INSTALLDIR)/libusb10/usr/lib/*.so
789 libusb10-clean:
790 -@$(MAKE) -C $@ clean
791 @rm -rf libusb10/Makefile
793 libusb/Makefile: libusb/Makefile.in
794 cd libusb && CFLAGS="-Wall -Os $(EXTRACFLAGS)" \
795 $(CONFIGURE) --prefix=/usr \
796 LIBUSB_1_0_CFLAGS="-I$(TOP)/libusb10/libusb" \
797 LIBUSB_1_0_LIBS="-L$(TOP)/libusb10/libusb/.libs -lusb-1.0 -lpthread \
798 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share"
800 libusb: libusb10 libusb/Makefile
801 $(MAKE) -C $@
803 libusb-install: libusb
804 install -D libusb/libusb/.libs/libusb-0.1.so $(INSTALLDIR)/libusb/usr/lib/libusb-0.1.so
805 $(STRIP) $(INSTALLDIR)/libusb/usr/lib/*.so
807 libusb-clean:
808 -@$(MAKE) -C $@ clean
809 @rm -rf libusb/Makefile
811 usbmodeswitch: libusb10
812 $(MAKE) -C $@ CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -DLIBUSB10 \
813 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share -lpthread \
814 -I$(TOP)/libusb10/libusb -L$(TOP)/libusb10/libusb/.libs -lusb-1.0"
816 usbmodeswitchdb-install:
817 @mkdir -p $(TARGETDIR)/rom/etc/usb_modeswitch.d
818 # compress whitespace
819 @for D in $(wildcard $(TOP)/usbmodeswitch/data/usb_modeswitch.d/*); do \
820 F=`basename $$D`; \
821 sed 's/###.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $$D > $(TARGETDIR)/rom/etc/usb_modeswitch.d/$$F; \
822 done
824 usbmodeswitch-install: usbmodeswitch usbmodeswitchdb-install
825 install -D usbmodeswitch/usb_modeswitch $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
826 $(STRIP) -s $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
827 @mkdir -p $(TARGETDIR)/rom/etc
828 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/usbmodeswitch/usb_modeswitch.conf > $(TARGETDIR)/rom/etc/usb_modeswitch.conf
831 radvd/stamp-h1: radvd/Makefile.in
832 cd radvd && CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
833 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
834 $(CONFIGURE) --prefix=""
835 @touch radvd/stamp-h1
837 radvd: radvd/stamp-h1
839 radvd-clean:
840 -@$(MAKE) -C radvd distclean
841 @rm -f radvd/stamp-h1
843 radvd-install:
844 install -D radvd/radvd $(INSTALLDIR)/radvd/usr/sbin/radvd
845 $(STRIP) $(INSTALLDIR)/radvd/usr/sbin/radvd
847 dhcpv6/stamp-h1:
848 @cd dhcpv6 && \
849 CFLAGS="-Os -Wall $(EXTRACFLAGS) -D_GNU_SOURCE -ffunction-sections -fdata-sections" \
850 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
851 ac_cv_func_setpgrp_void=yes \
852 $(CONFIGURE) --prefix= --with-localdbdir=/var
853 @$(MAKE) -C dhcpv6 clean
854 @touch dhcpv6/stamp-h1
856 dhcpv6: dhcpv6/stamp-h1
857 @$(SEP)
858 @$(MAKE) -C dhcpv6 dhcp6c
860 dhcpv6-install: dhcpv6
861 install -D dhcpv6/dhcp6c $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
862 $(STRIP) $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
864 dhcpv6-clean:
865 -@$(MAKE) -C dhcpv6 clean
866 @rm -f dhcpv6/Makefile dhcpv6/stamp-h1
869 p910nd:
870 samba:
871 samba3:
873 nvram: shared
875 prebuilt: shared
877 vlan:
878 @$(SEP)
879 @$(MAKE) -C vlan CROSS=$(CROSS_COMPILE) # STRIPTOOL=$(STRIP)
881 vlan-install:
882 $(MAKE) -C vlan CROSS=$(CROSS_COMPILE) INSTALLDIR=$(INSTALLDIR) install # STRIPTOOL=$(STRIP)
883 $(STRIP) $(INSTALLDIR)/vlan/usr/sbin/vconfig
886 pptp-client-install:
887 install -D pptp-client/pptp $(INSTALLDIR)/pptp-client/usr/sbin/pptp
888 $(STRIP) $(INSTALLDIR)/pptp-client/usr/sbin/pptp
891 accel-pptp: pppd accel-pptp/Makefile
892 @$(MAKE) -C accel-pptp
894 accel-pptp/Makefile: accel-pptp/Makefile.in $(LINUXDIR)/include/linux/version.h
895 cd accel-pptp && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
896 $(CONFIGURE) --prefix=/usr KDIR=$(LINUXDIR) PPPDIR=$(TOP)/pppd
898 accel-pptp-clean:
899 -@$(MAKE) -C accel-pptp clean
900 @rm -f accel-pptp/Makefile
902 accel-pptp-install: accel-pptp
903 install -D accel-pptp/src/.libs/pptp.so $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
904 $(STRIP) $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
907 pppd/Makefile: pppd/linux/Makefile.top
908 cd pppd && $(CONFIGURE) --prefix=/usr --sysconfdir=/tmp
910 pppd: pppd/Makefile
911 @$(SEP)
912 @$(MAKE) -C pppd MFLAGS='$(if $(TCONFIG_IPV6),HAVE_INET6=y,) EXTRACFLAGS="$(EXTRACFLAGS)"'
914 pppd-clean:
915 -$(MAKE) -C pppd clean
916 @rm -f pppd/Makefile
918 pppd-install: pppd
919 install -D pppd/pppd/pppd $(INSTALLDIR)/pppd/usr/sbin/pppd
920 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/pppd
921 install -D pppd/chat/chat $(INSTALLDIR)/pppd/usr/sbin/chat
922 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/chat
923 ifeq ($(TCONFIG_L2TP),y)
924 install -D pppd/pppd/plugins/pppol2tp/pppol2tp.so $(INSTALLDIR)/pppd/usr/lib/pppd/pppol2tp.so
925 $(STRIP) $(INSTALLDIR)/pppd/usr/lib/pppd/*.so
926 endif
928 # ipupdate-install:
929 # install -D ipupdate/ez-ipupdate $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
930 # $(STRIP) $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
932 zebra/stamp-h1:
933 @cd zebra && rm -f config.cache && \
934 CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
935 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
936 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
937 $(CONFIGURE) --sysconfdir=/etc \
938 --enable-netlink $(if $(TCONFIG_IPV6),--enable-ipv6,--disable-ipv6) --disable-ripngd --disable-ospfd --disable-doc \
939 --disable-ospf6d --disable-bgpd --disable-bgpd-announce
940 @touch zebra/stamp-h1
942 zebra: zebra/stamp-h1
943 @$(MAKE) -C zebra CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD)
945 zebra-clean:
946 -@$(MAKE) -C zebra clean
947 @rm -f zebra/stamp-h1
949 zebra-install: zebra
950 install -D zebra/zebra/zebra $(INSTALLDIR)/zebra/usr/sbin/zebra
951 install -D zebra/ripd/ripd $(INSTALLDIR)/zebra/usr/sbin/ripd
952 install -D zebra/lib/libzebra.so $(INSTALLDIR)/zebra/usr/lib/libzebra.so
953 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/zebra
954 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/ripd
955 $(STRIP) $(INSTALLDIR)/zebra/usr/lib/libzebra.so
958 rp-l2tp-install:
959 install -d $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
960 install rp-l2tp/handlers/*.so $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
961 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp/*.so
962 install -D rp-l2tp/handlers/l2tp-control $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
963 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
964 install -D rp-l2tp/l2tpd $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
965 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
967 xl2tpd: pppd
968 CFLAGS="-g $(EXTRACFLAGS)" $(MAKE) -C $@ PREFIX=/usr xl2tpd
970 xl2tpd-install: xl2tpd
971 install -D xl2tpd/xl2tpd $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
972 $(STRIP) $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
975 bpalogin-install:
976 install -D bpalogin/bpalogin $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
977 $(STRIP) $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
980 # libnet:
981 # @$(SEP)
982 # @-mkdir -p libnet/lib
983 # @$(MAKE) -C libnet CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
985 # libpcap:
986 # @$(SEP)
987 # @$(MAKE) -C libpcap CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
989 libbcm:
990 @[ ! -f libbcm/Makefile ] || $(MAKE) -C libbcm
992 libbcm-install:
993 install -D libbcm/libbcm.so $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
994 $(STRIP) $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
997 iproute2:
998 @$(SEP)
999 @$(MAKE) -C $@ KERNEL_INCLUDE=$(LINUXDIR)/include EXTRACFLAGS="$(EXTRACFLAGS) $(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6)"
1001 iproute2-install: iproute2
1002 install -D iproute2/tc/tc $(INSTALLDIR)/iproute2/usr/sbin/tc
1003 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/tc
1004 install -D iproute2/ip/ip $(INSTALLDIR)/iproute2/usr/sbin/ip
1005 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/ip
1008 ntpc: nvram shared
1011 dropbear: dropbear/config.h
1012 @$(SEP)
1013 @$(MAKE) -C dropbear PROGRAMS="dropbear dbclient dropbearkey scp" MULTI=1
1015 dropbear-install:
1016 install -D dropbear/dropbearmulti $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1017 $(STRIP) $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1018 cd $(INSTALLDIR)/dropbear/usr/bin && \
1019 ln -sf dropbearmulti dropbear && \
1020 ln -sf dropbearmulti dropbearconvert && \
1021 ln -sf dropbearmulti dropbearkey && \
1022 ln -sf dropbearmulti dbclient && \
1023 ln -sf dropbearmulti ssh && \
1024 ln -sf dropbearmulti scp
1026 dropbear-clean:
1027 -@$(MAKE) -C dropbear clean
1028 @rm -f dropbear/config.h
1030 dropbear/config.h:
1031 cd dropbear && \
1032 CFLAGS="-Os -Wall $(EXTRACFLAGS) -DARGTYPE=3 -ffunction-sections -fdata-sections" \
1033 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1034 ac_cv_func_logout=no ac_cv_func_logwtmp=no \
1035 $(CONFIGURE) --disable-zlib --enable-syslog --disable-lastlog --disable-utmp \
1036 --disable-utmpx --disable-wtmp --disable-wtmpx --disable-pututline \
1037 --disable-pututxline --disable-loginfunc --disable-pam --enable-openpty
1038 @$(MAKE) -C dropbear clean
1040 # Media libraries
1042 sqlite/stamp-h1:
1043 cd sqlite && \
1044 CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1045 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1046 $(CONFIGURE) --prefix=/usr --enable-shared --enable-static \
1047 --disable-readline --disable-dynamic-extensions --enable-threadsafe
1048 touch sqlite/stamp-h1
1050 sqlite: sqlite/stamp-h1
1051 @$(MAKE) -C sqlite all
1053 sqlite-clean:
1054 -@$(MAKE) -C sqlite clean
1055 @rm -f sqlite/stamp-h1
1057 sqlite-install: sqlite
1058 @$(SEP)
1059 ifneq ($(MEDIA_SERVER_STATIC),y)
1060 install -D sqlite/.libs/libsqlite3.so.0 $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1061 $(STRIP) $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1062 endif
1064 FFMPEG_FILTER_CONFIG= $(foreach c, $(2), --$(1)="$(c)")
1066 FFMPEG_DECODERS:=aac ac3 atrac3 h264 jpegls mp3 mpeg1video mpeg2video mpeg4 mpeg4aac mpegvideo png wmav1 wmav2
1067 FFMPEG_CONFIGURE_DECODERS:=$(call FFMPEG_FILTER_CONFIG,enable-decoder,$(FFMPEG_DECODERS))
1069 FFMPEG_PARSERS:=aac ac3 h264 mpeg4video mpegaudio mpegvideo
1070 FFMPEG_CONFIGURE_PARSERS:=$(call FFMPEG_FILTER_CONFIG,enable-parser,$(FFMPEG_PARSERS))
1072 FFMPEG_PROTOCOLS:=file
1073 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FFMPEG_FILTER_CONFIG,enable-protocol,$(FFMPEG_PROTOCOLS))
1075 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
1076 FFMPEG_CONFIGURE_DEMUXERS:=$(call FFMPEG_FILTER_CONFIG,disable-demuxer,$(FFMPEG_DISABLED_DEMUXERS))
1078 ffmpeg/stamp-h1: zlib
1079 cd ffmpeg && symver_asm_label=no symver_gnu_asm=no symver=no CC=$(CC) \
1080 ./configure --enable-cross-compile --arch=mips --target_os=linux \
1081 --cross-prefix=$(CROSS_COMPILE) --enable-shared --enable-gpl --disable-doc \
1082 --enable-pthreads --enable-small --disable-encoders --disable-filters \
1083 --disable-muxers --disable-devices --disable-ffmpeg --disable-ffplay \
1084 --disable-ffserver --disable-ffprobe --disable-avdevice --disable-swscale \
1085 --disable-hwaccels --disable-network --disable-bsfs --disable-mpegaudio-hp \
1086 --enable-demuxers $(FFMPEG_CONFIGURE_DEMUXERS) \
1087 --disable-decoders $(FFMPEG_CONFIGURE_DECODERS) \
1088 --disable-parsers $(FFMPEG_CONFIGURE_PARSERS) \
1089 --disable-protocols $(FFMPEG_CONFIGURE_PROTOCOLS) \
1090 --extra-cflags="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections -fPIC -I$(TOP)/zlib" \
1091 --extra-ldflags="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1092 --extra-libs="-L$(TOP)/zlib -lz" \
1093 --enable-zlib --disable-debug --prefix=''
1094 touch ffmpeg/stamp-h1
1096 ffmpeg: ffmpeg/stamp-h1 zlib
1097 @$(MAKE) -C ffmpeg all
1099 ffmpeg-clean:
1100 -@$(MAKE) -C ffmpeg clean
1101 @rm -f ffmpeg/stamp-h1 ffmpeg/config.h ffmpeg/config.mak
1103 ffmpeg-install: ffmpeg
1104 @$(SEP)
1105 ifneq ($(MEDIA_SERVER_STATIC),y)
1106 install -D ffmpeg/libavformat/libavformat.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1107 install -D ffmpeg/libavcodec/libavcodec.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1108 install -D ffmpeg/libavutil/libavutil.so.50 $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1109 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1110 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1111 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1112 endif
1114 libogg/stamp-h1:
1115 cd libogg && \
1116 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1117 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1118 $(CONFIGURE) --enable-shared --enable-static --prefix=''
1119 touch libogg/stamp-h1
1121 libogg: libogg/stamp-h1
1122 @$(MAKE) -C libogg all
1124 libogg-clean:
1125 -@$(MAKE) -C libogg clean
1126 @rm -f libogg/stamp-h1
1128 libogg-install: libogg
1129 @$(SEP)
1130 ifneq ($(MEDIA_SERVER_STATIC),y)
1131 install -D libogg/src/.libs/libogg.so.0 $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1132 $(STRIP) $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1133 endif
1135 flac/stamp-h1: libogg
1136 cd flac && \
1137 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1138 CPPFLAGS="-I$(TOP)/libogg/include" \
1139 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1140 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-rpath \
1141 --disable-doxygen-docs --disable-xmms-plugin --disable-cpplibs \
1142 --without-libiconv-prefix --disable-altivec --disable-3dnow --disable-sse
1143 touch flac/stamp-h1
1145 flac: flac/stamp-h1 libogg
1146 @$(MAKE) -C flac/src/libFLAC all
1148 flac-clean:
1149 -@$(MAKE) -C flac clean
1150 @rm -f flac/stamp-h1
1152 flac-install: flac
1153 @$(SEP)
1154 ifneq ($(MEDIA_SERVER_STATIC),y)
1155 install -D flac/src/libFLAC/.libs/libFLAC.so.8 $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1156 $(STRIP) $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1157 endif
1159 jpeg/stamp-h1:
1160 cd jpeg && \
1161 CFLAGS="-Os $(EXTRACFLAGS) -fPIC" CC=$(CC) AR2="touch" $(CONFIGURE) --enable-shared --enable-static --prefix=''
1162 touch jpeg/stamp-h1
1164 jpeg: jpeg/stamp-h1
1165 @$(MAKE) -C jpeg LIBTOOL="" O=o A=a CC=$(CC) AR2="touch" libjpeg.a libjpeg.so
1167 jpeg-clean:
1168 -@$(MAKE) -C jpeg clean
1169 @rm -f jpeg/stamp-h1 jpeg/Makefile
1171 jpeg-install: jpeg
1172 @$(SEP)
1173 ifneq ($(MEDIA_SERVER_STATIC),y)
1174 install -D jpeg/libjpeg.so $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1175 $(STRIP) $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1176 endif
1178 libexif/stamp-h1:
1179 cd libexif && CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1180 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1181 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1182 --disable-docs --disable-rpath --disable-nls --without-libiconv-prefix --without-libintl-prefix
1183 touch libexif/stamp-h1
1185 libexif: libexif/stamp-h1
1186 @$(MAKE) -C libexif all
1188 libexif-clean:
1189 -@$(MAKE) -C libexif clean
1190 @rm -f libexif/stamp-h1
1192 libexif-install: libexif
1193 @$(SEP)
1194 ifneq ($(MEDIA_SERVER_STATIC),y)
1195 install -D libexif/libexif/.libs/libexif.so.12 $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1196 $(STRIP) $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1197 endif
1199 zlib/stamp-h1:
1200 cd zlib && \
1201 CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1202 ./configure --shared --prefix=''
1203 touch zlib/stamp-h1
1205 zlib: zlib/stamp-h1
1206 @$(MAKE) -C zlib CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) all
1208 zlib-clean:
1209 -@$(MAKE) -C zlib clean
1210 @rm -f zlib/stamp-h1 zlib/Makefile zlib/zconf.h zlib/zlib.pc
1212 zlib-install: zlib
1213 @$(SEP)
1214 ifneq ($(MEDIA_SERVER_STATIC),y)
1215 install -d $(INSTALLDIR)/zlib/usr/lib
1216 install -D zlib/libz.so.1 $(INSTALLDIR)/zlib/usr/lib/
1217 $(STRIP) $(INSTALLDIR)/zlib/usr/lib/libz.so.1
1218 endif
1219 ifeq ($(TCONFIG_BT),y)
1220 install -d $(INSTALLDIR)/zlib/usr/lib
1221 install -D zlib/libz.so.1 $(INSTALLDIR)/zlib/usr/lib/
1222 $(STRIP) $(INSTALLDIR)/zlib/usr/lib/libz.so.1
1223 endif
1225 libid3tag/stamp-h1: zlib
1226 cd libid3tag && \
1227 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" CPPFLAGS="-I$(TOP)/zlib" \
1228 LDFLAGS="-L$(TOP)/zlib -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1229 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1230 --disable-debugging --disable-profiling
1231 touch libid3tag/stamp-h1
1233 libid3tag: libid3tag/stamp-h1 zlib
1234 @$(MAKE) -C libid3tag all
1236 libid3tag-clean:
1237 -@$(MAKE) -C libid3tag clean
1238 @rm -f libid3tag/stamp-h1
1240 libid3tag-install: libid3tag
1241 @$(SEP)
1242 ifneq ($(MEDIA_SERVER_STATIC),y)
1243 install -D libid3tag/.libs/libid3tag.so.0 $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1244 $(STRIP) $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1245 endif
1247 libvorbis/stamp-h1: libogg
1248 cd libvorbis && \
1249 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1250 CPPFLAGS="-I$(TOP)/libogg/include" \
1251 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1252 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-oggtest \
1253 --with-ogg-includes="$(TOP)/libogg/include" \
1254 --with-ogg-libraries="$(TOP)/libogg/src/.libs"
1255 touch libvorbis/stamp-h1
1257 libvorbis: libvorbis/stamp-h1
1258 @$(MAKE) -C libvorbis/lib all
1260 libvorbis-clean:
1261 -@$(MAKE) -C libvorbis clean
1262 @rm -f libvorbis/stamp-h1
1264 libvorbis-install: libvorbis
1265 @$(SEP)
1266 ifneq ($(MEDIA_SERVER_STATIC),y)
1267 install -D libvorbis/lib/.libs/libvorbis.so.0 $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1268 $(STRIP) $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1269 endif
1271 minidlna: zlib sqlite ffmpeg libogg flac jpeg libexif libid3tag libvorbis
1272 @$(SEP)
1273 @$(MAKE) -C minidlna CC=$(CC) $(if $(MEDIA_SERVER_STATIC),STATIC=1,) minidlna
1276 igmpproxy/src/Makefile: igmpproxy/src/Makefile.in
1277 cd igmpproxy && CFLAGS="-O2 -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1278 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1279 $(CONFIGURE) --prefix=/usr
1281 igmpproxy: igmpproxy/src/Makefile
1282 @$(SEP)
1283 @$(MAKE) -C igmpproxy/src
1285 igmpproxy-install: igmpproxy
1286 install -D igmpproxy/src/igmpproxy $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1287 $(STRIP) $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1289 igmpproxy-clean:
1290 -$(MAKE) -C igmpproxy/src clean
1291 @rm -f igmpproxy/src/Makefile
1293 udev:
1294 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)" \
1295 PROGRAMS=udevtrigger
1297 udev-install: udev
1298 install -d $(INSTALLDIR)
1299 install -d $(TARGETDIR)
1300 $(MAKE) -C udev DESTDIR=$(INSTALLDIR) prefix=/udev install-udevtrigger
1302 hotplug2:
1303 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1305 hotplug2-install: hotplug2
1306 $(MAKE) -C hotplug2 install PREFIX=$(INSTALLDIR)/hotplug2 SUBDIRS=""
1307 $(MAKE) -C hotplug2/examples install PREFIX=$(INSTALLDIR)/hotplug2/rom KERNELVER=$(LINUX_KERNEL)
1309 emf:
1310 $(MAKE) -C $(SRCBASE)/emf/emfconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1312 emf-install: emf
1313 $(MAKE) -C $(SRCBASE)/emf/emfconf INSTALLDIR=$(INSTALLDIR) install
1315 igs:
1316 $(MAKE) -C $(SRCBASE)/emf/igsconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1318 igs-install: igs
1319 $(MAKE) -C $(SRCBASE)/emf/igsconf INSTALLDIR=$(INSTALLDIR) install
1322 ebtables: dummy
1323 $(MAKE) -C ebtables CC=$(CC) LD=$(LD) \
1324 CFLAGS="-Os $(EXTRACFLAGS) -DEBT_MIN_ALIGN=4 -Wall -Wunused" \
1325 BINDIR="/usr/sbin" LIBDIR="/usr/lib/ebtables" KERNEL_INCLUDES=$(LINUXDIR)/include $(if $(TCONFIG_IPV6),DO_IPV6=1,)
1327 ebtables-install: ebtables
1328 install -D ebtables/ebtables $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1330 @mkdir -p $(TARGETDIR)/rom/etc
1331 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/ebtables/ethertypes > $(TARGETDIR)/rom/etc/ethertypes
1332 chmod 0644 $(TARGETDIR)/rom/etc/ethertypes
1334 install -d $(INSTALLDIR)/ebtables/usr/lib
1335 install -d $(INSTALLDIR)/ebtables/usr/lib/ebtables
1336 install -D ebtables/*.so $(INSTALLDIR)/ebtables/usr/lib/
1337 install -D ebtables/extensions/*.so $(INSTALLDIR)/ebtables/usr/lib/ebtables/
1339 $(STRIP) $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1340 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/ebtables/*.so
1341 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/libebt*.so
1343 ebtables-clean:
1344 make -C ebtables clean
1346 lzo/stamp-h1:
1347 cd lzo && \
1348 CFLAGS="-Os -Wall $(EXTRACFLAGS)" $(CONFIGURE) --enable-shared --enable-static
1349 touch lzo/stamp-h1
1351 lzo: lzo/stamp-h1
1353 lzo-clean:
1354 -$(MAKE) -C lzo clean
1355 @rm -f lzo/stamp-h1
1357 lzo-install: lzo
1358 install -D lzo/src/.libs/liblzo2.so $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1359 $(STRIP) $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1360 cd $(INSTALLDIR)/lzo/usr/lib && ln -sf liblzo2.so.2 liblzo2.so
1363 openvpn: openvpn/.conf openssl lzo
1365 openvpn/.conf:
1366 cd openvpn && CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1367 LDFLAGS="-L$(TOP)/openssl -L$(TOP)/lzo/src/.libs -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1368 $(CONFIGURE) --prefix= \
1369 --with-lzo-headers="$(TOP)/lzo/include" \
1370 --with-ssl-headers="$(TOP)/openssl/include/" \
1371 --with-iproute-path="/usr/sbin/ip" \
1372 --disable-debug --disable-plugins --enable-management --enable-small \
1373 --disable-selinux --disable-socks --enable-password-save
1374 touch openvpn/.conf
1376 openvpn-clean:
1377 -$(MAKE) -C openvpn clean
1378 @rm -f openvpn/.conf
1380 openvpn-install: openvpn
1381 install -D openvpn/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1382 $(STRIP) -s $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1383 chmod 0500 $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1385 #shibby
1386 libcurl/stamp-h1: zlib openssl
1387 cd libcurl && CC=$(CC) STRIP='mipsel-uclibc-strip' \
1388 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1389 CPPFLAGS="-I$(TOP)/zlib" \
1390 LDFLAGS="-L$(TOP)/zlib -ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1391 $(CONFIGURE) --prefix=/usr --disable-thread --enable-shared --enable-static \
1392 --enable-ares --enable-cookies --enable-crypto-auth --enable-nonblocking \
1393 --enable-file --enable-ftp --enable-http --enable-ipv6 --enable-tftp \
1394 --disable-nls --disable-ares --disable-dict --disable-debug --disable-gopher \
1395 --disable-ldap --disable-manual --disable-telnet --disable-verbose \
1396 --with-random="/dev/urandom" --with-ssl="$(TOP)/openssl" \
1397 --without-gnutls --without-krb4 --without-libidn \
1398 --with-linux-headers=$(LINUXDIR)/include \
1399 OPENSSL_CFLAGS="-I$(TOP)/openssl/include" \
1400 OPENSSL_LIBS="-L$(TOP)/openssl -lcrypto -lssl"
1401 touch libcurl/stamp-h1
1403 libcurl: libcurl/stamp-h1
1404 @$(MAKE) -C libcurl
1406 libcurl-clean:
1407 -@$(MAKE) -C libcurl clean
1408 @rm -f libcurl/stamp-h1 libcurl/Makefile
1410 libcurl-install: libcurl
1411 install -d $(INSTALLDIR)/libcurl/usr/lib
1412 install -D libcurl/lib/.libs/libcurl.so.4.2.0 $(INSTALLDIR)/libcurl/usr/lib/libcurl.so.4.2.0
1413 $(STRIP) -s $(INSTALLDIR)/libcurl/usr/lib/libcurl.so.4.2.0
1414 cd $(INSTALLDIR)/libcurl/usr/lib/ && \
1415 ln -sf libcurl.so.4.2.0 libcurl.so.4 && \
1416 ln -sf libcurl.so.4.2.0 libcurl.so
1418 libevent/stamp-h1:
1419 cd libevent && \
1420 CC=$(CC) CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1421 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1422 $(CONFIGURE)
1423 touch libevent/stamp-h1
1425 libevent: libevent/stamp-h1
1426 @$(SEP)
1427 $(MAKE) -C libevent
1429 libevent-clean:
1430 -@$(MAKE) -C libevent clean
1431 @rm -f libevent/stamp-h1 libevent/Makefile
1433 libevent-install: libevent
1434 install -d $(INSTALLDIR)/libevent/usr/lib
1435 install libevent/.libs/libevent-2.0.so.5.1.0 $(INSTALLDIR)/libevent/usr/lib/libevent-2.0.so.5
1436 $(STRIP) -s $(INSTALLDIR)/libevent/usr/lib/libevent-2.0.so.5
1438 transmission/stamp-h1: openssl libcurl libevent zlib gettext
1439 cd transmission && CC=$(CC) AR=$(AR) LD=$(LD) STRIP='mipsel-uclibc-strip' \
1440 CFLAGS="-Os -Wall -fno-delete-null-pointer-checks -funit-at-a-time \
1441 --param large-function-growth=800 --param max-inline-insns-single=3000 \
1442 -ffunction-sections -fdata-sections \
1443 -O2 -O0 -std=gnu99 -ggdb3 -W -Wpointer-arith -Wformat-security -Wcast-align -Wundef \
1444 -Wcast-align -Wstrict-prototypes -Wmissing-declarations -Wmissing-format-attribute \
1445 -Wredundant-decls -Wnested-externs -Wunused-parameter -Wwrite-strings -Winline -Wfloat-equal \
1446 -Wextra -Wdeclaration-after-statement -Winit-self" \
1447 LDFLAGS="-L$(TOP)/zlib -ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1448 CPPFLAGS="-I$(TOP)/zlib -O3 -DTR_EMBEDDED" \
1449 ac_cv_header_libintl_h=no \
1450 $(CONFIGURE) --target=mipsel-linux --prefix=/usr --disable-gtk --disable-nls \
1451 --enable-lightweight --enable-largefile \
1452 LIBCURL_CFLAGS="-I$(TOP)/libcurl/include" \
1453 LIBCURL_LIBS="-L$(TOP)/libcurl/lib/.libs/ -lcurl" \
1454 LIBEVENT_CFLAGS="-I$(TOP)/libevent/include" \
1455 LIBEVENT_LIBS="-L$(TOP)/libevent/.libs -levent" \
1456 OPENSSL_CFLAGS="-I$(TOP)/openssl/include" \
1457 OPENSSL_LIBS="-L$(TOP)/openssl -lcrypto -lssl"
1458 touch transmission/stamp-h1
1460 transmission: transmission/stamp-h1
1461 @$(SEP)
1462 $(MAKE) -C transmission
1464 transmission-clean:
1465 -@$(MAKE) -C transmission clean
1466 @rm -f transmission/stamp-h1 transmission/Makefile
1468 transmission-install: transmission
1469 $(MAKE) -C transmission DESTDIR=$(INSTALLDIR)/transmission install-strip
1470 @rm -rf $(INSTALLDIR)/transmission/usr/share/man
1471 @rm -rf $(INSTALLDIR)/transmission/usr/bin/transmission-cli
1472 @rm -rf $(INSTALLDIR)/transmission/usr/bin/transmission-show
1473 @rm -rf $(INSTALLDIR)/transmission/usr/bin/transmission-edit
1474 $(STRIP) -s $(INSTALLDIR)/transmission/usr/bin/transmission-daemon
1475 $(STRIP) -s $(INSTALLDIR)/transmission/usr/bin/transmission-remote
1476 $(STRIP) -s $(INSTALLDIR)/transmission/usr/bin/transmission-create
1477 install -D transmission/btcheck $(INSTALLDIR)/transmission/usr/bin/btcheck
1478 install -D transmission/btqueue $(INSTALLDIR)/transmission/usr/bin/btqueue
1481 # Generic rules
1485 @[ ! -d $* ] || ( $(SEP); $(MAKE) -C $* )
1488 %-clean:
1489 @-[ ! -d $* ] || $(MAKE) -C $* clean
1491 %-distclean:
1492 @-[ ! -d $* ] || $(MAKE) -C $* distclean
1494 %-install: %
1495 @[ ! -d $* ] || $(MAKE) -C $* install INSTALLDIR=$(INSTALLDIR)/$*
1497 %-build:
1498 $(MAKE) $*-clean $*
1500 $(obj-y) $(obj-n) $(obj-clean) $(obj-install): dummy
1502 .PHONY: all clean distclean mrproper install package
1503 .PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
1504 .PHONY: dummy libnet libpcap