Add PPTP runtime and GUI
[tomato.git] / release / src / router / Makefile
blob6faadbd01556ee52a5755f62ea30419b0f32b86e
2 # Broadcom Linux Router Makefile
4 # Copyright 2005, Broadcom Corporation
5 # All Rights Reserved.
7 # THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 # KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 # SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 # FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
14 include common.mak
16 #TOMATO_EXPERIMENTAL=0
21 SEP=echo "\033[41;1m $@ \033[0m"
24 # standard packages
26 obj-y += lzma-loader
27 obj-y += nvram
28 obj-y += shared
29 obj-y += prebuilt
30 obj-y += igmpproxy
31 obj-y += iptables
32 obj-y += rc
33 obj-y += iproute2
34 obj-y += rom
35 obj-y += others
36 obj-y += busybox
37 obj-y += httpd
38 obj-y += www
39 obj-y += bridge
40 obj-y += dnsmasq
41 obj-y += etc
42 # obj-y += vlan # use Busybox vconfig
43 obj-y += pppd
44 obj-y += rp-pppoe
45 obj-y += utils
46 obj-y += ntpc
47 obj-y += rstats
48 obj-$(TCONFIG_SNMP) += snmp
49 obj-y += cstats
51 # !!TB - updated Broadcom Wireless driver
52 obj-y += et
53 obj-y += libbcmcrypto
54 obj-y += wlconf
56 obj-y += cyassl
57 obj-y += mssl
58 obj-y += mdu
60 #Roadkill
61 obj-$(TCONFIG_NOCAT) += nocat
62 # !!TB
63 obj-$(TCONFIG_USB) += p910nd
65 ifeq ($(CONFIG_LINUX26),y)
66 obj-$(TCONFIG_USB) += sd-idle
67 else
68 obj-$(TCONFIG_USB) += scsi-idle
69 endif
71 obj-y += libusb10
72 #obj-y += libusb
73 obj-y += usbmodeswitch
74 obj-$(TCONFIG_FTP) += vsftpd
76 ifeq ($(CONFIG_LINUX26),y)
77 ifeq ($(TCONFIG_SAMBASRV),y)
78 NEED_EX_NLS = y
79 endif
80 ifeq ($(TCONFIG_USB_EXTRAS),y)
81 NEED_EX_USB = y
82 endif
83 endif
85 ifeq ($(TCONFIG_SAMBASRV),y)
86 ifeq ($(TCONFIG_SAMBA3),y)
87 NEED_SAMBA3 = y
88 else
89 NEED_SAMBA2 = y
90 endif
91 endif
93 ifeq ($(TCONFIG_IPV6),y)
94 export TCONFIG_IPV6 := y
95 else
96 TCONFIG_IPV6 :=
97 endif
99 obj-$(NEED_SAMBA2) += samba
100 obj-$(NEED_SAMBA3) += samba3
101 obj-$(TCONFIG_NTFS) += ntfs-3g
102 obj-$(TCONFIG_EBTABLES) += ebtables
103 obj-$(TCONFIG_IPV6) += radvd
104 obj-$(TCONFIG_IPV6) += dhcpv6
106 obj-$(TCONFIG_MEDIA_SERVER) += zlib
107 obj-$(TCONFIG_MEDIA_SERVER) += sqlite
108 obj-$(TCONFIG_MEDIA_SERVER) += ffmpeg
109 obj-$(TCONFIG_MEDIA_SERVER) += libogg
110 obj-$(TCONFIG_MEDIA_SERVER) += flac
111 obj-$(TCONFIG_MEDIA_SERVER) += jpeg
112 obj-$(TCONFIG_MEDIA_SERVER) += libexif
113 obj-$(TCONFIG_MEDIA_SERVER) += libid3tag
114 obj-$(TCONFIG_MEDIA_SERVER) += libvorbis
115 obj-$(TCONFIG_MEDIA_SERVER) += minidlna
116 MEDIA_SERVER_STATIC=y
118 obj-y += miniupnpd
119 # obj-y += upnp
123 # configurable packages
125 obj-$(TCONFIG_L2TP) += xl2tpd
126 obj-$(TCONFIG_PPTP) += accel-pptp
127 obj-$(TCONFIG_HTTPS) += openssl
128 obj-$(TCONFIG_SSH) += dropbear
129 obj-$(TCONFIG_ZEBRA) += zebra
130 # obj-$(TCONFIG_IPP2P) += ipp2p
131 obj-$(TCONFIG_LZO) += lzo
132 obj-$(TCONFIG_OPENVPN) += openvpn
133 obj-$(TCONFIG_EMF) += emf
134 obj-$(TCONFIG_EMF) += igs
136 obj-$(CONFIG_LINUX26) += hotplug2
137 obj-$(CONFIG_LINUX26) += udevtrigger
139 ifeq ($(TCONFIG_OPENVPN),y)
140 export FULL_OPENSSL := y
141 else
142 ifeq ($(TCONFIG_FTP_SSL),y)
143 export FULL_OPENSSL := y
144 else
145 FULL_OPENSSL :=
146 endif
147 endif
149 obj-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 \
197 INSTALL_MOD_STRIP="--strip-debug -x -R .comment -R .note -R .pdr -R .mdebug.abi32 -R .note.gnu.build-id -R .gnu.attributes -R .reginfo" \
198 DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
200 ifneq ($(CONFIG_LINUX26),y)
201 find $(TARGETDIR)/lib/modules -name wl.*o -exec $(STRIP) --strip-unneeded -x {} \;
202 find $(TARGETDIR)/lib/modules -name et.*o -exec $(STRIP) --strip-unneeded -x {} \;
203 find $(TARGETDIR)/lib/modules -name bcm57*.*o -exec $(STRIP) --strip-unneeded -x {} \;
204 find $(TARGETDIR)/lib/modules -name ctf.*o -exec $(STRIP) --strip-unneeded -x {} \;
205 find $(TARGETDIR)/lib/modules -name emf.*o -exec $(STRIP) --strip-unneeded -x {} \;
206 find $(TARGETDIR)/lib/modules -name igs.*o -exec $(STRIP) --strip-unneeded -x {} \;
207 find $(TARGETDIR)/lib/modules -name jffs*.*o -exec $(STRIP) --strip-unneeded -x {} \;
209 find $(TARGETDIR)/lib/modules -name *.*o -exec $(STRIP) --strip-debug -x -R .mdebug.abi32 {} \;
210 endif
212 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv diag/* . && rm -rf diag
214 # nice and clean
215 -cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et.4702/* . && rm -rf et.4702 || true
216 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv et/* . && rm -rf et
217 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv wl/* . && rm -rf wl
218 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv cifs/* . && rm -rf cifs
219 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs2/* . && rm -rf jffs2 || true
220 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jffs/* . && rm -rf jffs || true
221 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_inflate/* . && rm -rf zlib_inflate || true
222 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv zlib_deflate/* . && rm -rf zlib_deflate || true
223 cd $(TARGETDIR)/lib/modules/*/kernel/lib && mv lzo/* . && rm -rf lzo || true
224 rm -rf $(TARGETDIR)/lib/modules/*/pcmcia
226 ##!!TB
227 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext2/* . && rm -rf ext2 || true
228 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ext3/* . && rm -rf ext3 || true
229 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jbd/* . && rm -rf jbd || true
230 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fat/* . && rm -rf fat || true
231 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv jfs/* . && rm -rf jfs || true
232 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv vfat/* . && rm -rf vfat || true
233 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv msdos/* . && rm -rf msdos || true
234 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv fuse/* . && rm -rf fuse || true
235 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv ntfs/* . && rm -rf ntfs || true
236 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv smbfs/* . && rm -rf smbfs || true
237 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv reiserfs/* . && rm -rf reiserfs || true
238 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfs/* . && rm -rf hfs || true
239 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv hfsplus/* . && rm -rf hfsplus || true
240 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv lockd/* . && rm -rf lockd || true
241 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfsd/* . && rm -rf nfsd || true
242 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nfs/* . && rm -rf nfs || true
243 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv xfs/* . && rm -rf xfs || true
244 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv nls/* . && rm -rf nls || true
245 cd $(TARGETDIR)/lib/modules/*/kernel/fs && mv exportfs/* . && rm -rf exportfs || true
246 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv sunrpc/* . && rm -rf sunrpc || true
247 cd $(TARGETDIR)/lib/modules/*/kernel/net && mv auth_gss/* . && rm -rf auth_gss || true
248 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv oss/* . && rm -rf oss || true
249 cd $(TARGETDIR)/lib/modules/*/kernel/sound/core && mv seq/* . && rm -rf seq || true
250 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv core/* . && rm -rf core || true
251 cd $(TARGETDIR)/lib/modules/*/kernel/sound && mv usb/* . && rm -rf usb || true
252 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv hcd/* . && rm -rf hcd || true
253 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv host/* . && rm -rf host || true
254 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv storage/* . && rm -rf storage || true
255 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv serial/* . && rm -rf serial || true
256 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv core/* . && rm -rf core || true
257 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv class/* . && rm -rf class || true
258 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv misc/* . && rm -rf misc || true
259 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/usb && mv usbip/* . && rm -rf usbip || true
260 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv core/* . && rm -rf core || true
261 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv card/* . && rm -rf card || true
262 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc && mv host/* . && rm -rf host || true
263 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/hid && mv usbhid/* . && rm -rf usbhid || true
264 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv joystick/* . && rm -rf joystick || true
265 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv keyboard/* . && rm -rf keyboard || true
266 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv misc/* . && rm -rf misc || true
267 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/input && mv mouse/* . && rm -rf mouse || true
268 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv uvc/* . && rm -rf uvc || true
269 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv pwc/* . && rm -rf pwc || true
270 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv gl860/* . && rm -rf gl860 || true
271 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv m5602/* . && rm -rf m5602 || true
272 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video/gspca && mv stv06xx/* . && rm -rf stv06xx || true
273 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media/video && mv gspca/* . && rm -rf gspca || true
274 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/media && mv video/* . && rm -rf video || true
276 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv bcm57xx/* . && rm -rf bcm57xx || true
277 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv emf/* . && rm -rf emf || true
278 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv igs/* . && rm -rf igs || true
279 cd $(TARGETDIR)/lib/modules/*/kernel/drivers/net && mv ctf/* . && rm -rf ctf || true
280 cd $(TARGETDIR)/lib/modules && rm -f */source || true
282 # misc
283 for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
284 (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
285 done
287 ifneq ($(TCONFIG_L7),y)
288 rm -f $(TARGETDIR)/usr/lib/iptables/libipt_layer7.so
289 endif
291 # uClibc
292 install $(LIBDIR)/ld-uClibc.so.0 $(TARGETDIR)/lib/
293 install $(LIBDIR)/libcrypt.so.0 $(TARGETDIR)/lib/
294 install $(LIBDIR)/libpthread.so.0 $(TARGETDIR)/lib/
295 install $(LIBDIR)/libgcc_s.so.1 $(TARGETDIR)/lib/
296 $(STRIP) $(TARGETDIR)/lib/libgcc_s.so.1
297 install $(LIBDIR)/libc.so.0 $(TARGETDIR)/lib/
298 install $(LIBDIR)/libdl.so.0 $(TARGETDIR)/lib/
299 install $(LIBDIR)/libm.so.0 $(TARGETDIR)/lib/
300 install $(LIBDIR)/libnsl.so.0 $(TARGETDIR)/lib/
301 ifeq ($(TCONFIG_SSH),y)
302 install $(LIBDIR)/libutil.so.0 $(TARGETDIR)/lib/
303 endif
304 ifneq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
305 install $(LIBDIR)/libresolv.so.0 $(TARGETDIR)/lib/
306 $(STRIP) $(TARGETDIR)/lib/*.so.0
307 endif
309 @cd $(TARGETDIR) && $(TOP)/others/rootprep.sh
311 @echo ---
313 ifeq ($(TCONFIG_OPTIMIZE_SHARED_LIBS),y)
314 @$(SRCBASE)/btools/libfoo.pl
315 else
316 @$(SRCBASE)/btools/libfoo.pl --noopt
317 endif
318 @chmod 0555 $(TARGETDIR)/lib/*.so*
319 @chmod 0555 $(TARGETDIR)/usr/lib/*.so*
321 # !!TB - moved to run after libfoo.pl - to make sure shared libs include all symbols needed by extras
322 # separated/copied extra stuff
323 @rm -rf $(PLATFORMDIR)/extras
324 @mkdir $(PLATFORMDIR)/extras
325 @mv $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/ip_gre.*o $(PLATFORMDIR)/extras/ || true
327 $(if $(TCONFIG_OPENVPN),@cp -f,$(if $(TCONFIG_USB_EXTRAS),@cp -f,$(if $(TCONFIG_IPV6),@cp -f,@mv))) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/tun.*o $(PLATFORMDIR)/extras/ || true
328 $(if $(TCONFIG_EBTABLES),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/bridge/netfilter/ebt*.*o $(PLATFORMDIR)/extras/ || true
330 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ifb.*o $(PLATFORMDIR)/extras/ || true
331 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sched/sch_red.*o $(PLATFORMDIR)/extras/ || true
332 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/ntfs.*o $(PLATFORMDIR)/extras/ || true
333 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/smbfs.*o $(PLATFORMDIR)/extras/ || true
334 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/reiserfs.*o $(PLATFORMDIR)/extras/ || true
335 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/jfs.*o $(PLATFORMDIR)/extras/ || true
336 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/nfs.*o $(PLATFORMDIR)/extras/ || true
337 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/nfsd.*o $(PLATFORMDIR)/extras/ || true
338 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/lockd.*o $(PLATFORMDIR)/extras/ || true
339 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/exportfs.*o $(PLATFORMDIR)/extras/ || true
340 @mv $(TARGETDIR)/lib/modules/*/kernel/net/sunrpc.*o $(PLATFORMDIR)/extras/ || true
341 @mv $(TARGETDIR)/lib/modules/*/kernel/net/auth_rpcgss.*o $(PLATFORMDIR)/extras/ || true
342 @mv $(TARGETDIR)/lib/modules/*/kernel/net/rpcsec_gss_krb5.*o $(PLATFORMDIR)/extras/ || true
343 @mv $(TARGETDIR)/lib/modules/*/kernel/fs/xfs.*o $(PLATFORMDIR)/extras/ || true
344 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi/sr_mod.*o $(PLATFORMDIR)/extras/ || true
345 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/scanner.*o $(PLATFORMDIR)/extras/ || true
347 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbserial.*o $(PLATFORMDIR)/extras/ || true
348 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/option.*o $(PLATFORMDIR)/extras/ || true
349 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/sierra.*o $(PLATFORMDIR)/extras/ || true
350 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/*acm.*o $(PLATFORMDIR)/extras/ || true
351 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ftdi_sio.*o $(PLATFORMDIR)/extras/ || true
352 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/pl2303.*o $(PLATFORMDIR)/extras/ || true
353 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc/*.*o $(PLATFORMDIR)/extras/ || true
354 $(if $(NEED_EX_USB),@ls,@rm -rf) $(TARGETDIR)/lib/modules/*/kernel/drivers/mmc || true
356 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbip*.*o $(PLATFORMDIR)/extras/ || true
357 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbkbd.*o $(PLATFORMDIR)/extras/ || true
358 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/usbmouse.*o $(PLATFORMDIR)/extras/ || true
359 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/hid*.*o $(PLATFORMDIR)/extras/ || true
360 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ipw.*o $(PLATFORMDIR)/extras/ || true
361 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/audio.*o $(PLATFORMDIR)/extras/ || true
362 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/ov51*.*o $(PLATFORMDIR)/extras/ || true
363 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/pwc*.*o $(PLATFORMDIR)/extras/ || true
364 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/emi*.*o $(PLATFORMDIR)/extras/ || true
365 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/mii.*o $(PLATFORMDIR)/extras/ || true
366 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/cdc_ether.*o $(PLATFORMDIR)/extras/ || true
367 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/cdc_subset.*o $(PLATFORMDIR)/extras/ || true
368 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/usbnet.*o $(PLATFORMDIR)/extras/ || true
369 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb/rndis_host.*o $(PLATFORMDIR)/extras/ || true
370 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/net/usb || true
371 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/media/* $(PLATFORMDIR)/extras/ || true
372 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/media || true
373 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/sound/* $(PLATFORMDIR)/extras/ || true
374 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/sound || true
375 @mv $(TARGETDIR)/lib/modules/*/kernel/sound/* $(PLATFORMDIR)/extras/ || true
376 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/sound || true
377 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/input/* $(PLATFORMDIR)/extras/ || true
378 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/input || true
379 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/hid/* $(PLATFORMDIR)/extras/ || true
380 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/hid || true
381 @cp -f $(TARGETDIR)/lib/modules/*/kernel/drivers/net/bcm57*.*o $(PLATFORMDIR)/extras/ || true
382 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ctf*.*o $(PLATFORMDIR)/extras/ || true
383 $(if $(TCONFIG_PPTP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pptp.*o $(PLATFORMDIR)/extras/ || true
384 $(if $(TCONFIG_L2TP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pppol2tp.*o $(PLATFORMDIR)/extras/ || true
385 @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ppp_deflate.*o $(PLATFORMDIR)/extras/ || true
386 @mv $(TARGETDIR)/lib/modules/*/kernel/crypto/* $(PLATFORMDIR)/extras/ || true
387 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/crypto || true
389 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_cp9*.*o $(PLATFORMDIR)/extras/ || true
390 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_cp1251.*o $(PLATFORMDIR)/extras/ || true
391 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_euc-jp.*o $(PLATFORMDIR)/extras/ || true
392 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_sjis.*o $(PLATFORMDIR)/extras/ || true
393 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_gb2312.*o $(PLATFORMDIR)/extras/ || true
394 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_euc-kr.*o $(PLATFORMDIR)/extras/ || true
395 $(if $(NEED_EX_NLS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_big5.*o $(PLATFORMDIR)/extras/ || true
397 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/nls_*.*o $(PLATFORMDIR)/extras/ || true
398 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/usb/*.*o $(PLATFORMDIR)/extras/ || true
399 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi/*.*o $(PLATFORMDIR)/extras/ || true
400 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/leds/*.*o $(PLATFORMDIR)/extras/ || true
401 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/ext2.*o $(PLATFORMDIR)/extras/ || true
402 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/ext3.*o $(PLATFORMDIR)/extras/ || true
403 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jbd.*o $(PLATFORMDIR)/extras/ || true
404 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/mbcache.*o $(PLATFORMDIR)/extras/ || true
405 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fat.*o $(PLATFORMDIR)/extras/ || true
406 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/vfat.*o $(PLATFORMDIR)/extras/ || true
407 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/msdos.*o $(PLATFORMDIR)/extras/ || true
408 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fuse.*o $(PLATFORMDIR)/extras/ || true
409 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfs.*o $(PLATFORMDIR)/extras/ || true
410 $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfsplus.*o $(PLATFORMDIR)/extras/ || true
412 ifneq ($(TCONFIG_USB),y)
413 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/usb || true
414 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/scsi || true
415 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/leds || true
416 endif
418 $(if $(TCONFIG_USB_EXTRAS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/connector/cn.*o $(PLATFORMDIR)/extras/ || true
419 $(if $(TCONFIG_USB_EXTRAS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/block/loop.*o $(PLATFORMDIR)/extras/ || true
420 ifneq ($(TCONFIG_USB_EXTRAS),y)
421 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/connector || true
422 @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/block || true
423 endif
424 $(if $(TCONFIG_CIFS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/cifs.*o $(PLATFORMDIR)/extras/ || true
425 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@mv,@cp -f),@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jffs2.*o $(PLATFORMDIR)/extras/ || true
426 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@mv,@cp -f),@mv) $(TARGETDIR)/lib/modules/*/kernel/lib/zlib_*.*o $(PLATFORMDIR)/extras/ || true
427 $(if $(TCONFIG_JFFS2),$(if $(TCONFIG_JFFSV1),@cp -f,@mv),@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/jffs.*o $(PLATFORMDIR)/extras/ || true
428 [ ! -f $(TARGETDIR)/lib/modules/*/kernel/lib/* ] && rm -rf $(TARGETDIR)/lib/modules/*/kernel/lib || true
429 $(if $(TCONFIG_L7),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/ipv4/netfilter/ipt_layer7.*o $(PLATFORMDIR)/extras/ || true
430 $(if $(TCONFIG_L7),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/net/netfilter/xt_layer7.*o $(PLATFORMDIR)/extras/ || true
432 @mkdir -p $(PLATFORMDIR)/extras/apps
433 @mkdir -p $(PLATFORMDIR)/extras/lib
435 @mv $(TARGETDIR)/usr/sbin/ttcp $(PLATFORMDIR)/extras/apps/ || true
436 @mv $(TARGETDIR)/usr/sbin/mii-tool $(PLATFORMDIR)/extras/apps/ || true
437 @mv $(TARGETDIR)/usr/sbin/robocfg $(PLATFORMDIR)/extras/apps/ || true
439 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/lib/libusb* $(PLATFORMDIR)/extras/lib/ || true
440 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/sbin/usb_modeswitch $(PLATFORMDIR)/extras/apps/ || true
441 @cp usbmodeswitch/usb_modeswitch.conf $(PLATFORMDIR)/extras/apps/usb_modeswitch.conf || true
442 @cp usbmodeswitch/usb_modeswitch.setup $(PLATFORMDIR)/extras/apps/usb_modeswitch.setup || true
443 @mkdir -p $(PLATFORMDIR)/extras/apps/usb_modeswitch.d
444 @cp -f usbmodeswitch/data/usb_modeswitch.d/* $(PLATFORMDIR)/extras/apps/usb_modeswitch.d || true
445 ifneq ($(NEED_EX_USB),y)
446 @rm -rf $(TARGETDIR)/rom/etc/usb_modeswitch.d || true
447 @rm -f $(TARGETDIR)/rom/etc/usb_modeswitch.conf || true
448 endif
449 $(if $(NEED_EX_USB),@cp -f,@mv) $(TARGETDIR)/usr/sbin/chat $(PLATFORMDIR)/extras/apps/ || true
451 @mkdir -p $(TARGETDIR)/rom/etc/l7-protocols
452 ifeq ($(TCONFIG_L7PAT),y)
453 @cd layer7 && ./squish.sh
454 cp layer7/squished/*.pat $(TARGETDIR)/rom/etc/l7-protocols
455 endif
457 ifeq ($(TCONFIG_PPTP),y)
458 @mkdir -p $(TARGETDIR)/rom/etc/vpn
459 cp rc/vpn/* $(TARGETDIR)/rom/etc/vpn
460 chmod +x $(TARGETDIR)/rom/etc/vpn/*
461 endif
463 busybox/examples/depmod.pl -k $(LINUXDIR)/vmlinux -b $(TARGETDIR)/lib/modules/*/
464 @mv $(TARGETDIR)/lib/modules/*/modules.dep $(TARGETDIR)/lib/modules/
465 @echo ---
467 @rm -f $(TARGETDIR)/lib/modules/*/build
469 @$(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs-lzma
470 @$(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(TARGETDIR) $(PLATFORMDIR)/target.image -all-root -noappend -nopad | tee target.info
472 # Package kernel and filesystem
473 # if grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
474 # cp $(PLATFORMDIR)/target.image $(LINUXDIR)/arch/mips/ramdisk/$${CONFIG_EMBEDDED_RAMDISK_IMAGE} ; \
475 # $(MAKE) -C $(LINUXDIR) zImage ; \
476 # else \
477 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz $(PLATFORMDIR)/ ; \
478 # trx -o $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image ; \
479 # fi
481 # Pad self-booting Linux to a 64 KB boundary
482 # cp $(LINUXDIR)/arch/mips/brcm-boards/bcm947xx/compressed/zImage $(PLATFORMDIR)/
483 # dd conv=sync bs=64k < $(PLATFORMDIR)/zImage > $(PLATFORMDIR)/linux.bin
484 # Append filesystem to self-booting Linux
485 # cat $(PLATFORMDIR)/target.image >> $(PLATFORMDIR)/linux.bin
488 libc: $(LIBDIR)/ld-uClibc.so.0
489 # $(MAKE) -C ../../../tools-src/uClibc all
490 # $(MAKE) -C ../../../tools-src/uClibc install
494 # cleaners
497 clean: clean-build $(obj-clean)
498 rm -rf layer7/squished
499 rm -f .ipv6-y .ipv6-n
500 rm -f .fullssl-y .fullssl-n
501 make -C config clean
503 clean-build: dummy
504 rm -rf $(TARGETDIR)
505 rm -rf $(INSTALLDIR)
506 rm -f $(PLATFORMDIR)/linux.trx $(PLATFORMDIR)/vmlinuz $(PLATFORMDIR)/target.image
507 rm -rf $(PLATFORMDIR)/extras
509 distclean: clean
510 ifneq ($(INSIDE_MAK),1)
511 $(MAKE) -C $(SRCBASE) $@ INSIDE_MAK=1
512 endif
513 # -rm -f $(LIBDIR)/*.so.0 $(LIBDIR)/*.so
516 # configuration
519 CONFIG_IN := config/config.in
521 config/conf config/mconf:
522 @$(MAKE) -C config
524 rconf: config/conf
525 @config/conf $(CONFIG_IN)
527 rmconf: config/mconf
528 @config/mconf $(CONFIG_IN)
530 roldconf: config/conf
531 @config/conf -o $(CONFIG_IN)
532 @$(MAKE) shared-clean rc-clean nvram-clean httpd-clean prebuilt-clean libbcmcrypto-clean dhcpv6-clean
534 kconf:
535 @$(MAKE) -C $(LINUXDIR) config
537 kmconf:
538 @$(MAKE) -C $(LINUXDIR) menuconfig
540 koldconf:
541 @$(MAKE) -C $(LINUXDIR) oldconfig
542 @$(MAKE) -C $(LINUXDIR) include/linux/version.h
544 bboldconf:
545 @$(MAKE) -C busybox oldconfig
547 config conf: rconf kconf
549 menuconfig mconf: rmconf kmconf
551 .ipv6-y .ipv6-n:
552 @rm -f .ipv6-y .ipv6-n
553 @$(MAKE) iptables-clean ebtables-clean pppd-clean zebra-clean dnsmasq-clean iproute2-clean
554 @touch $@
556 .fullssl-y .fullssl-n:
557 @rm -f .fullssl-y .fullssl-n
558 @$(MAKE) openssl-clean vsftpd-clean mssl-clean mdu-clean httpd-clean
559 @touch $@
561 dependconf: .ipv6-$(if $(TCONFIG_IPV6),y,n) .fullssl-$(if $(FULL_OPENSSL),y,n)
563 oldconfig oldconf: koldconf roldconf dependconf bboldconf
567 # overrides and extra dependencies
570 busybox: dummy
571 @$(MAKE) -C busybox EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)"
573 # V=1
575 busybox-install:
576 rm -rf $(INSTALLDIR)/busybox
577 $(MAKE) -C busybox install EXTRA_CFLAGS="-fPIC $(EXTRACFLAGS)" CONFIG_PREFIX=$(INSTALLDIR)/busybox
579 busybox-clean:
580 $(MAKE) -C busybox distclean
582 busybox-config:
583 $(MAKE) -C busybox menuconfig
586 httpd: shared nvram mssl
587 @$(SEP)
588 @$(MAKE) -C httpd
590 www-install:
591 @$(MAKE) -C www install INSTALLDIR=$(INSTALLDIR)/www TOMATO_EXPERIMENTAL=$(TOMATO_EXPERIMENTAL)
593 matrixssl:
594 @$(SEP)
595 @$(MAKE) -C matrixssl/src
597 matrixssl-install:
598 @true
600 matrixssl-clean:
601 $(MAKE) -C matrixssl/src clean
603 cyassl/stamp-h1:
604 @cd cyassl && CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
605 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections \
606 -DNO_MD4 -DNO_AES -DNO_ERROR_STRINGS -DNO_HC128 -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED" \
607 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
608 PTHREAD_LIBS="-lpthread" \
609 $(CONFIGURE)
610 @touch cyassl/stamp-h1
612 cyassl: cyassl/stamp-h1
613 @$(SEP)
614 @$(MAKE) -C cyassl
616 cyassl-clean:
617 -@$(MAKE) -C cyassl clean
618 @rm -f cyassl/stamp-h1
620 cyassl-install:
621 @true
623 ifeq ($(FULL_OPENSSL),y)
624 OPENSSL_CIPHERS:=enable-rc5
625 else
626 OPENSSL_CIPHERS:=no-dh no-idea no-rc2 no-rc5 no-aes no-aes192 no-cast no-des no-modes no-tls1 no-tlsext
627 endif
629 openssl/stamp-h1:
630 cd openssl && \
631 ./Configure linux-mipsel --openssldir=/etc --cross-compile-prefix=' ' \
632 -ffunction-sections -fdata-sections -Wl,--gc-sections \
633 shared $(OPENSSL_CIPHERS) \
634 no-sha0 no-smime no-camellia no-krb5 no-rmd160 no-ripemd \
635 no-seed no-capieng no-cms no-gms no-gmp no-rfc3779 \
636 no-ec no-ecdh no-ecdsa no-err no-hw no-jpake no-threads \
637 no-zlib no-engine no-engines no-sse2 no-perlasm \
638 no-dtls1 no-store no-psk no-md2 no-mdc2 no-ts
640 @$(MAKE) -C openssl clean
641 @touch openssl/stamp-h1
643 openssl: openssl/stamp-h1
645 openssl-clean:
646 -@$(MAKE) -C openssl clean
647 @rm -f openssl/stamp-h1
649 openssl-install: openssl
650 install -D openssl/libcrypto.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
651 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libcrypto.so.1.0.0
652 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libcrypto.so.1.0.0 libcrypto.so
654 install -D openssl/apps/openssl $(INSTALLDIR)/openssl/usr/sbin/openssl
655 $(STRIP) $(INSTALLDIR)/openssl/usr/sbin/openssl
656 chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/openssl
658 install -D -m 0500 httpd/gencert.sh $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
660 # perl -e 'while (<>) { s/.SECS/time()-(24*60*60)/e; print; }' < httpd/gencert.sh > $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
661 # chmod 0500 $(INSTALLDIR)/openssl/usr/sbin/gencert.sh
663 ifeq ($(FULL_OPENSSL),y)
664 install -D openssl/libssl.so.1.0.0 $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
665 $(STRIP) $(INSTALLDIR)/openssl/usr/lib/libssl.so.1.0.0
666 cd $(INSTALLDIR)/openssl/usr/lib && ln -sf libssl.so.1.0.0 libssl.so
667 endif
669 mssl: $(if $(FULL_OPENSSL),openssl,cyassl)
671 mdu: shared mssl
673 rc: nvram shared
675 bridge/Makefile:
676 cd bridge && CFLAGS="-Os -g $(EXTRACFLAGS)" \
677 $(CONFIGURE) --prefix="" --with-linux-headers=$(LINUXDIR)/include
679 bridge: bridge/Makefile
680 @$(SEP)
681 @$(MAKE) -C bridge
683 bridge-clean:
684 -@$(MAKE) -C bridge clean
685 @rm -f bridge/Makefile
687 bridge-install:
688 install -D bridge/brctl/brctl $(INSTALLDIR)/bridge/usr/sbin/brctl
689 $(STRIP) $(INSTALLDIR)/bridge/usr/sbin/brctl
691 dnsmasq:
692 @$(SEP)
693 @$(MAKE) -C dnsmasq \
694 COPTS="$(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6) $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
695 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC"
697 dnsmasq-install:
698 install -D dnsmasq/src/dnsmasq $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
699 $(STRIP) $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
701 iptables:
702 @$(SEP)
703 $(MAKE) -C iptables BINDIR=/usr/sbin LIBDIR=/usr/lib KERNEL_DIR=$(LINUXDIR) COPT_FLAGS="-Os $(EXTRACFLAGS) -U CONFIG_NVRAM_SIZE"
705 iptables-install:
706 install -D iptables/iptables $(INSTALLDIR)/iptables/usr/sbin/iptables
707 cd $(INSTALLDIR)/iptables/usr/sbin && \
708 ln -sf iptables iptables-restore
710 install -d $(INSTALLDIR)/iptables/usr/lib/iptables
711 install -D iptables/extensions/*.so $(INSTALLDIR)/iptables/usr/lib/iptables/
713 install -D iptables/libiptc.so $(INSTALLDIR)/iptables/usr/lib/libiptc.so
715 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/iptables
716 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/iptables/*.so
717 $(STRIP) $(INSTALLDIR)/iptables/usr/lib/libiptc.so
719 ifeq ($(TCONFIG_IPV6),y)
720 install iptables/ip6tables $(INSTALLDIR)/iptables/usr/sbin/ip6tables
721 $(STRIP) $(INSTALLDIR)/iptables/usr/sbin/ip6tables
722 cd $(INSTALLDIR)/iptables/usr/sbin && \
723 ln -sf ip6tables ip6tables-restore
724 endif
726 iptables-clean:
727 -$(MAKE) -C iptables KERNEL_DIR=$(LINUXDIR) clean
729 ppp:
730 @$(SEP)
731 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
732 # $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp DFLAGS="-DDEBUG -DDEBUGALL"
734 ppp-%:
735 $(MAKE) -C ppp/pppoecd $* INSTALLDIR=$(INSTALLDIR)/ppp $(if $(TCONFIG_IPV6),HAVE_INET6=y,)
737 rp-pppoe/src/stamp-h1: rp-pppoe/src/Makefile.in
738 cd rp-pppoe/src && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
739 $(CONFIGURE) --prefix=/usr --enable-plugin=$(TOP)/pppd \
740 ac_cv_linux_kernel_pppoe=yes rpppoe_cv_pack_bitfields=rev
741 @touch rp-pppoe/src/stamp-h1
743 rp-pppoe: pppd rp-pppoe/src/stamp-h1
744 $(MAKE) -C rp-pppoe/src pppoe-relay rp-pppoe.so
746 rp-pppoe-clean:
747 -$(MAKE) -C rp-pppoe/src clean
748 @rm -f rp-pppoe/src/pppoe-relay
749 @rm -f rp-pppoe/src/stamp-h1
751 rp-pppoe-install: rp-pppoe
752 install -D rp-pppoe/src/rp-pppoe.so $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/rp-pppoe.so
753 $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/lib/pppd/*.so
754 # install -D rp-pppoe/src/pppoe-relay $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
755 # $(STRIP) $(INSTALLDIR)/rp-pppoe/usr/sbin/pppoe-relay
758 upnp: nvram shared iptables
760 miniupnpd-config:
761 @cd miniupnpd && ./genconfig.sh
763 miniupnpd: iptables miniupnpd-config
764 @$(SEP)
765 $(MAKE) -C miniupnpd miniupnpd -f Makefile.linux \
766 TARGET_OPENWRT="not really" CC=$(CC) \
767 CFLAGS="-Wall -Os -D_GNU_SOURCE $(EXTRACFLAGS) -I$(TOP)/iptables/include -I$(TOP)/shared" \
768 LDFLAGS="-L$(TOP)/iptables -liptc" LIBS=""
770 miniupnpd-clean:
771 -$(MAKE) -C miniupnpd -f Makefile.linux clean
772 @rm -f miniupnpd/config.h
774 miniupnpd-install:
775 install -D miniupnpd/miniupnpd $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
776 $(STRIP) $(INSTALLDIR)/miniupnpd/usr/sbin/miniupnpd
778 # !!TB
779 shared: busybox
781 vsftpd: $(if $(TCONFIG_FTP_SSL),openssl,)
782 @$(SEP)
783 $(MAKE) -C vsftpd
785 vsftpd-install: vsftpd
786 install -D vsftpd/vsftpd $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
787 $(STRIP) -s $(INSTALLDIR)/vsftpd/usr/sbin/vsftpd
789 ntfs-3g/Makefile:
790 cd ntfs-3g && \
791 CC=$(CC) CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
792 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
793 $(CONFIGURE) --enable-shared=no --enable-static=no \
794 --disable-library --disable-ldconfig --disable-mount-helper --with-fuse=internal \
795 --disable-posix-acls --disable-nfconv --disable-dependency-tracking
797 ntfs-3g: ntfs-3g/Makefile
798 @$(MAKE) -C ntfs-3g
800 ntfs-3g-clean:
801 -@$(MAKE) -C ntfs-3g clean
802 @rm -f ntfs-3g/Makefile
804 ntfs-3g-install: ntfs-3g
805 install -D ntfs-3g/src/ntfs-3g $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
806 $(STRIP) -s $(INSTALLDIR)/ntfs-3g/bin/ntfs-3g
807 install -d $(INSTALLDIR)/ntfs-3g/sbin && cd $(INSTALLDIR)/ntfs-3g/sbin && \
808 ln -sf ../bin/ntfs-3g mount.ntfs-3g && \
809 ln -sf ../bin/ntfs-3g mount.ntfs
811 libusb10/Makefile: libusb10/Makefile.in
812 cd libusb10 && CFLAGS="-Os -Wall $(EXTRACFLAGS)" LIBS="-lpthread" \
813 $(CONFIGURE) --prefix=/usr ac_cv_lib_rt_clock_gettime=no
815 libusb10: libusb10/Makefile
816 $(MAKE) -C $@
818 libusb10-install: libusb10
819 install -D libusb10/libusb/.libs/libusb-1.0.so $(INSTALLDIR)/libusb10/usr/lib/libusb-1.0.so
820 $(STRIP) $(INSTALLDIR)/libusb10/usr/lib/*.so
822 libusb10-clean:
823 -@$(MAKE) -C $@ clean
824 @rm -rf libusb10/Makefile
826 libusb/Makefile: libusb/Makefile.in
827 cd libusb && CFLAGS="-Wall -Os $(EXTRACFLAGS)" \
828 $(CONFIGURE) --prefix=/usr \
829 LIBUSB_1_0_CFLAGS="-I$(TOP)/libusb10/libusb" \
830 LIBUSB_1_0_LIBS="-L$(TOP)/libusb10/libusb/.libs -lusb-1.0 -lpthread \
831 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share"
833 libusb: libusb10 libusb/Makefile
834 $(MAKE) -C $@
836 libusb-install: libusb
837 install -D libusb/libusb/.libs/libusb-0.1.so $(INSTALLDIR)/libusb/usr/lib/libusb-0.1.so
838 $(STRIP) $(INSTALLDIR)/libusb/usr/lib/*.so
840 libusb-clean:
841 -@$(MAKE) -C $@ clean
842 @rm -rf libusb/Makefile
844 usbmodeswitch: libusb10
845 $(MAKE) -C $@ CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -DLIBUSB10 \
846 -Wl,-R/lib:/usr/lib:/opt/usr/lib:/usr/local/share -lpthread \
847 -I$(TOP)/libusb10/libusb -L$(TOP)/libusb10/libusb/.libs -lusb-1.0"
849 usbmodeswitchdb-install:
850 @mkdir -p $(TARGETDIR)/rom/etc/usb_modeswitch.d
851 # compress whitespace
852 @for D in $(wildcard $(TOP)/usbmodeswitch/data/usb_modeswitch.d/*); do \
853 F=`basename $$D`; \
854 sed 's/###.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $$D > $(TARGETDIR)/rom/etc/usb_modeswitch.d/$$F; \
855 done
857 usbmodeswitch-install: usbmodeswitch usbmodeswitchdb-install
858 install -D usbmodeswitch/usb_modeswitch $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
859 $(STRIP) -s $(INSTALLDIR)/usbmodeswitch/usr/sbin/usb_modeswitch
860 @mkdir -p $(TARGETDIR)/rom/etc
861 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/usbmodeswitch/usb_modeswitch.conf > $(TARGETDIR)/rom/etc/usb_modeswitch.conf
864 radvd/stamp-h1:
865 cd radvd && CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
866 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
867 $(CONFIGURE) --prefix=""
868 @$(MAKE) -C radvd clean
869 @touch radvd/stamp-h1
871 radvd: radvd/stamp-h1
873 radvd-clean:
874 -@$(MAKE) -C radvd distclean
875 @rm -f radvd/stamp-h1
877 radvd-install: radvd
878 install -D radvd/radvd $(INSTALLDIR)/radvd/usr/sbin/radvd
879 $(STRIP) $(INSTALLDIR)/radvd/usr/sbin/radvd
881 dhcpv6/stamp-h1:
882 @cd dhcpv6 && \
883 CFLAGS="-Os -Wall $(EXTRACFLAGS) -D_GNU_SOURCE -ffunction-sections -fdata-sections" \
884 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
885 ac_cv_func_setpgrp_void=yes \
886 $(CONFIGURE) --prefix= --with-localdbdir=/var
887 @$(MAKE) -C dhcpv6 clean
888 @touch dhcpv6/stamp-h1
890 dhcpv6: dhcpv6/stamp-h1
891 @$(SEP)
892 @$(MAKE) -C dhcpv6 dhcp6c
894 dhcpv6-install: dhcpv6
895 install -D dhcpv6/dhcp6c $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
896 $(STRIP) $(INSTALLDIR)/dhcpv6/usr/sbin/dhcp6c
898 dhcpv6-clean:
899 -@$(MAKE) -C dhcpv6 clean
900 @rm -f dhcpv6/Makefile dhcpv6/stamp-h1
903 p910nd:
904 samba:
905 samba3:
907 nvram: shared
909 prebuilt: shared libbcmcrypto
911 vlan:
912 @$(SEP)
913 @$(MAKE) -C vlan CROSS=$(CROSS_COMPILE) # STRIPTOOL=$(STRIP)
915 vlan-install:
916 $(MAKE) -C vlan CROSS=$(CROSS_COMPILE) INSTALLDIR=$(INSTALLDIR) install # STRIPTOOL=$(STRIP)
917 $(STRIP) $(INSTALLDIR)/vlan/usr/sbin/vconfig
920 pptp-client-install:
921 install -D pptp-client/pptp $(INSTALLDIR)/pptp-client/usr/sbin/pptp
922 $(STRIP) $(INSTALLDIR)/pptp-client/usr/sbin/pptp
925 accel-pptp: pppd accel-pptp/Makefile
926 @$(MAKE) -C accel-pptp
928 accel-pptp/Makefile: accel-pptp/Makefile.in $(LINUXDIR)/include/linux/version.h
929 cd accel-pptp && CFLAGS="-g -O2 $(EXTRACFLAGS)" \
930 $(CONFIGURE) --prefix=/usr KDIR=$(LINUXDIR) PPPDIR=$(TOP)/pppd
932 accel-pptp-clean:
933 -@$(MAKE) -C accel-pptp clean
934 @rm -f accel-pptp/Makefile
936 accel-pptp-install: accel-pptp
937 install -D accel-pptp/src/.libs/pptp.so $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
938 $(STRIP) $(INSTALLDIR)/accel-pptp/usr/lib/pppd/pptp.so
941 pppd/Makefile: pppd/linux/Makefile.top
942 cd pppd && $(CONFIGURE) --prefix=/usr --sysconfdir=/tmp
944 pppd: pppd/Makefile
945 @$(SEP)
946 @$(MAKE) -C pppd MFLAGS='$(if $(TCONFIG_IPV6),HAVE_INET6=y,) EXTRACFLAGS="$(EXTRACFLAGS)"'
948 pppd-clean:
949 -$(MAKE) -C pppd clean
950 @rm -f pppd/Makefile
952 pppd-install: pppd
953 install -D pppd/pppd/pppd $(INSTALLDIR)/pppd/usr/sbin/pppd
954 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/pppd
955 install -D pppd/chat/chat $(INSTALLDIR)/pppd/usr/sbin/chat
956 $(STRIP) $(INSTALLDIR)/pppd/usr/sbin/chat
957 ifeq ($(TCONFIG_L2TP),y)
958 install -D pppd/pppd/plugins/pppol2tp/pppol2tp.so $(INSTALLDIR)/pppd/usr/lib/pppd/pppol2tp.so
959 $(STRIP) $(INSTALLDIR)/pppd/usr/lib/pppd/*.so
960 endif
962 # ipupdate-install:
963 # install -D ipupdate/ez-ipupdate $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
964 # $(STRIP) $(INSTALLDIR)/ipupdate/usr/sbin/ez-ipupdate
966 zebra/stamp-h1:
967 @cd zebra && rm -f config.cache && \
968 CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
969 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
970 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
971 $(CONFIGURE) --sysconfdir=/etc \
972 --enable-netlink $(if $(TCONFIG_IPV6),--enable-ipv6,--disable-ipv6) --disable-ripngd --disable-ospfd --disable-doc \
973 --disable-ospf6d --disable-bgpd --disable-bgpd-announce
974 @touch zebra/stamp-h1
976 zebra: zebra/stamp-h1
977 @$(MAKE) -C zebra CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD)
979 zebra-clean:
980 -@$(MAKE) -C zebra clean
981 @rm -f zebra/stamp-h1
983 zebra-install: zebra
984 install -D zebra/zebra/zebra $(INSTALLDIR)/zebra/usr/sbin/zebra
985 install -D zebra/ripd/ripd $(INSTALLDIR)/zebra/usr/sbin/ripd
986 install -D zebra/lib/libzebra.so $(INSTALLDIR)/zebra/usr/lib/libzebra.so
987 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/zebra
988 $(STRIP) $(INSTALLDIR)/zebra/usr/sbin/ripd
989 $(STRIP) $(INSTALLDIR)/zebra/usr/lib/libzebra.so
992 rp-l2tp-install:
993 install -d $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
994 install rp-l2tp/handlers/*.so $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp
995 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/lib/l2tp/*.so
996 install -D rp-l2tp/handlers/l2tp-control $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
997 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tp-control
998 install -D rp-l2tp/l2tpd $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
999 $(STRIP) $(INSTALLDIR)/rp-l2tp/usr/sbin/l2tpd
1001 xl2tpd: pppd
1002 CFLAGS="-g $(EXTRACFLAGS)" $(MAKE) -C $@ PREFIX=/usr xl2tpd
1004 xl2tpd-install: xl2tpd
1005 install -D xl2tpd/xl2tpd $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
1006 $(STRIP) $(INSTALLDIR)/xl2tpd/usr/sbin/xl2tpd
1009 bpalogin-install:
1010 install -D bpalogin/bpalogin $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
1011 $(STRIP) $(INSTALLDIR)/bpalogin/usr/sbin/bpalogin
1014 # libnet:
1015 # @$(SEP)
1016 # @-mkdir -p libnet/lib
1017 # @$(MAKE) -C libnet CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
1019 # libpcap:
1020 # @$(SEP)
1021 # @$(MAKE) -C libpcap CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
1023 libbcm:
1024 @[ ! -f libbcm/Makefile ] || $(MAKE) -C libbcm
1026 libbcm-install:
1027 install -D libbcm/libbcm.so $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
1028 $(STRIP) $(INSTALLDIR)/libbcm/usr/lib/libbcm.so
1031 iproute2:
1032 @$(SEP)
1033 @$(MAKE) -C $@ KERNEL_INCLUDE=$(LINUXDIR)/include EXTRACFLAGS="$(EXTRACFLAGS) $(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6)"
1035 iproute2-install: iproute2
1036 install -D iproute2/tc/tc $(INSTALLDIR)/iproute2/usr/sbin/tc
1037 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/tc
1038 install -D iproute2/ip/ip $(INSTALLDIR)/iproute2/usr/sbin/ip
1039 $(STRIP) $(INSTALLDIR)/iproute2/usr/sbin/ip
1042 ntpc: nvram shared
1045 dropbear: dropbear/config.h
1046 @$(SEP)
1047 @$(MAKE) -C dropbear PROGRAMS="dropbear dbclient dropbearkey scp" MULTI=1
1049 dropbear-install:
1050 install -D dropbear/dropbearmulti $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1051 $(STRIP) $(INSTALLDIR)/dropbear/usr/bin/dropbearmulti
1052 cd $(INSTALLDIR)/dropbear/usr/bin && \
1053 ln -sf dropbearmulti dropbear && \
1054 ln -sf dropbearmulti dropbearconvert && \
1055 ln -sf dropbearmulti dropbearkey && \
1056 ln -sf dropbearmulti dbclient && \
1057 ln -sf dropbearmulti ssh && \
1058 ln -sf dropbearmulti scp
1060 dropbear-clean:
1061 -@$(MAKE) -C dropbear clean
1062 @rm -f dropbear/config.h
1064 dropbear/config.h:
1065 cd dropbear && \
1066 CFLAGS="-Os -Wall $(EXTRACFLAGS) -DARGTYPE=3 -ffunction-sections -fdata-sections" \
1067 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1068 ac_cv_func_logout=no ac_cv_func_logwtmp=no \
1069 $(CONFIGURE) --disable-zlib --enable-syslog --disable-lastlog --disable-utmp \
1070 --disable-utmpx --disable-wtmp --disable-wtmpx --disable-pututline \
1071 --disable-pututxline --disable-loginfunc --disable-pam --enable-openpty --enable-bundled-libtom
1072 @$(MAKE) -C dropbear clean
1074 # Media libraries
1076 sqlite/stamp-h1:
1077 cd sqlite && \
1078 CC=$(CC) CFLAGS="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1079 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1080 $(CONFIGURE) --prefix=/usr --enable-shared --enable-static \
1081 --disable-readline --disable-dynamic-extensions --enable-threadsafe
1082 touch sqlite/stamp-h1
1084 sqlite: sqlite/stamp-h1
1085 @$(MAKE) -C sqlite all
1087 sqlite-clean:
1088 -@$(MAKE) -C sqlite clean
1089 @rm -f sqlite/stamp-h1
1091 sqlite-install: sqlite
1092 @$(SEP)
1093 ifneq ($(MEDIA_SERVER_STATIC),y)
1094 install -D sqlite/.libs/libsqlite3.so.0 $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1095 $(STRIP) $(INSTALLDIR)/sqlite/usr/lib/libsqlite3.so.0
1096 endif
1098 FFMPEG_FILTER_CONFIG= $(foreach c, $(2), --$(1)="$(c)")
1100 FFMPEG_DECODERS:=aac ac3 atrac3 flac h264 jpegls mp3 mpeg1video mpeg2video mpeg4 mpeg4aac mpegvideo png wmav1 wmav2
1101 FFMPEG_CONFIGURE_DECODERS:=$(call FFMPEG_FILTER_CONFIG,enable-decoder,$(FFMPEG_DECODERS))
1103 FFMPEG_PARSERS:=aac ac3 h264 mpeg4video mpegaudio mpegvideo
1104 FFMPEG_CONFIGURE_PARSERS:=$(call FFMPEG_FILTER_CONFIG,enable-parser,$(FFMPEG_PARSERS))
1106 FFMPEG_PROTOCOLS:=file
1107 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FFMPEG_FILTER_CONFIG,enable-protocol,$(FFMPEG_PROTOCOLS))
1109 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
1110 FFMPEG_CONFIGURE_DEMUXERS:=$(call FFMPEG_FILTER_CONFIG,disable-demuxer,$(FFMPEG_DISABLED_DEMUXERS))
1112 ffmpeg/stamp-h1: zlib
1113 cd ffmpeg && symver_asm_label=no symver_gnu_asm=no symver=no CC=$(CC) \
1114 ./configure --enable-cross-compile --arch=mips --target_os=linux \
1115 --cross-prefix=$(CROSS_COMPILE) --enable-shared --enable-gpl --disable-doc \
1116 --enable-pthreads --enable-small --disable-encoders --disable-filters \
1117 --disable-muxers --disable-devices --disable-ffmpeg --disable-ffplay \
1118 --disable-ffserver --disable-ffprobe --disable-avdevice --disable-swscale \
1119 --disable-hwaccels --disable-network --disable-bsfs --disable-mpegaudio-hp \
1120 --enable-demuxers $(FFMPEG_CONFIGURE_DEMUXERS) \
1121 --disable-decoders $(FFMPEG_CONFIGURE_DECODERS) \
1122 --disable-parsers $(FFMPEG_CONFIGURE_PARSERS) \
1123 --disable-protocols $(FFMPEG_CONFIGURE_PROTOCOLS) \
1124 --extra-cflags="-Os $(EXTRACFLAGS) -ffunction-sections -fdata-sections -fPIC -I$(TOP)/zlib" \
1125 --extra-ldflags="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \
1126 --extra-libs="-L$(TOP)/zlib -lz" \
1127 --enable-zlib --disable-debug --prefix=''
1128 touch ffmpeg/stamp-h1
1130 ffmpeg: ffmpeg/stamp-h1 zlib
1131 @$(MAKE) -C ffmpeg all
1133 ffmpeg-clean:
1134 -@$(MAKE) -C ffmpeg clean
1135 @rm -f ffmpeg/stamp-h1 ffmpeg/config.h ffmpeg/config.mak
1137 ffmpeg-install: ffmpeg
1138 @$(SEP)
1139 ifneq ($(MEDIA_SERVER_STATIC),y)
1140 install -D ffmpeg/libavformat/libavformat.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1141 install -D ffmpeg/libavcodec/libavcodec.so.52 $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1142 install -D ffmpeg/libavutil/libavutil.so.50 $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1143 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavformat.so.52
1144 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavcodec.so.52
1145 $(STRIP) $(INSTALLDIR)/ffmpeg/usr/lib/libavutil.so.50
1146 endif
1148 libogg/stamp-h1:
1149 cd libogg && \
1150 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1151 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1152 $(CONFIGURE) --enable-shared --enable-static --prefix=''
1153 touch libogg/stamp-h1
1155 libogg: libogg/stamp-h1
1156 @$(MAKE) -C libogg all
1158 libogg-clean:
1159 -@$(MAKE) -C libogg clean
1160 @rm -f libogg/stamp-h1
1162 libogg-install: libogg
1163 @$(SEP)
1164 ifneq ($(MEDIA_SERVER_STATIC),y)
1165 install -D libogg/src/.libs/libogg.so.0 $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1166 $(STRIP) $(INSTALLDIR)/libogg/usr/lib/libogg.so.0
1167 endif
1169 flac/stamp-h1: libogg
1170 cd flac && \
1171 CFLAGS="-Os $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1172 CPPFLAGS="-I$(TOP)/libogg/include -I$(LINUXDIR)/include" \
1173 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1174 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-rpath \
1175 --disable-doxygen-docs --disable-xmms-plugin --disable-cpplibs \
1176 --without-libiconv-prefix --disable-altivec --disable-3dnow --disable-sse
1177 touch flac/stamp-h1
1179 flac: flac/stamp-h1 libogg
1180 @$(MAKE) -C flac/src/libFLAC all
1182 flac-clean:
1183 -@$(MAKE) -C flac clean
1184 @rm -f flac/stamp-h1
1186 flac-install: flac
1187 @$(SEP)
1188 ifneq ($(MEDIA_SERVER_STATIC),y)
1189 install -D flac/src/libFLAC/.libs/libFLAC.so.8 $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1190 $(STRIP) $(INSTALLDIR)/flac/usr/lib/libFLAC.so.8
1191 endif
1193 jpeg/stamp-h1:
1194 cd jpeg && \
1195 CFLAGS="-Os $(EXTRACFLAGS) -fPIC" CC=$(CC) AR2="touch" $(CONFIGURE) --enable-shared --enable-static --prefix=''
1196 touch jpeg/stamp-h1
1198 jpeg: jpeg/stamp-h1
1199 @$(MAKE) -C jpeg LIBTOOL="" O=o A=a CC=$(CC) AR2="touch" libjpeg.a libjpeg.so
1201 jpeg-clean:
1202 -@$(MAKE) -C jpeg clean
1203 @rm -f jpeg/stamp-h1 jpeg/Makefile
1205 jpeg-install: jpeg
1206 @$(SEP)
1207 ifneq ($(MEDIA_SERVER_STATIC),y)
1208 install -D jpeg/libjpeg.so $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1209 $(STRIP) $(INSTALLDIR)/jpeg/usr/lib/libjpeg.so
1210 endif
1212 libexif/stamp-h1:
1213 cd libexif && CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1214 LDFLAGS="-fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1215 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1216 --disable-docs --disable-rpath --disable-nls --without-libiconv-prefix --without-libintl-prefix
1217 touch libexif/stamp-h1
1219 libexif: libexif/stamp-h1
1220 @$(MAKE) -C libexif all
1222 libexif-clean:
1223 -@$(MAKE) -C libexif clean
1224 @rm -f libexif/stamp-h1
1226 libexif-install: libexif
1227 @$(SEP)
1228 ifneq ($(MEDIA_SERVER_STATIC),y)
1229 install -D libexif/libexif/.libs/libexif.so.12 $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1230 $(STRIP) $(INSTALLDIR)/libexif/usr/lib/libexif.so.12
1231 endif
1233 zlib/stamp-h1:
1234 cd zlib && \
1235 CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1236 ./configure --shared --prefix=''
1237 touch zlib/stamp-h1
1239 zlib: zlib/stamp-h1
1240 @$(MAKE) -C zlib CC=$(CC) AR="ar rc" RANLIB=$(RANLIB) LD=$(LD) all
1242 zlib-clean:
1243 -@$(MAKE) -C zlib clean
1244 @rm -f zlib/stamp-h1 zlib/Makefile zlib/zconf.h zlib/zlib.pc
1246 zlib-install: zlib
1247 @$(SEP)
1248 ifneq ($(MEDIA_SERVER_STATIC),y)
1249 install -d $(INSTALLDIR)/zlib/usr/lib
1250 install -D zlib/libz.so.1 $(INSTALLDIR)/zlib/usr/lib/
1251 $(STRIP) $(INSTALLDIR)/zlib/usr/lib/libz.so.1
1252 endif
1254 libid3tag/stamp-h1: zlib
1255 cd libid3tag && \
1256 CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" CPPFLAGS="-I$(TOP)/zlib" \
1257 LDFLAGS="-L$(TOP)/zlib -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1258 $(CONFIGURE) --enable-shared --enable-static --prefix='' \
1259 --disable-debugging --disable-profiling
1260 touch libid3tag/stamp-h1
1262 libid3tag: libid3tag/stamp-h1 zlib
1263 @$(MAKE) -C libid3tag all
1265 libid3tag-clean:
1266 -@$(MAKE) -C libid3tag clean
1267 @rm -f libid3tag/stamp-h1
1269 libid3tag-install: libid3tag
1270 @$(SEP)
1271 ifneq ($(MEDIA_SERVER_STATIC),y)
1272 install -D libid3tag/.libs/libid3tag.so.0 $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1273 $(STRIP) $(INSTALLDIR)/libid3tag/usr/lib/libid3tag.so.0
1274 endif
1276 libvorbis/stamp-h1: libogg
1277 cd libvorbis && \
1278 CFLAGS="-Os -Wall $(EXTRACFLAGS) -fPIC -ffunction-sections -fdata-sections" \
1279 CPPFLAGS="-I$(TOP)/libogg/include" \
1280 LDFLAGS="-L$(TOP)/libogg/src/.libs -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1281 $(CONFIGURE) --enable-shared --enable-static --prefix='' --disable-oggtest \
1282 --with-ogg-includes="$(TOP)/libogg/include" \
1283 --with-ogg-libraries="$(TOP)/libogg/src/.libs"
1284 touch libvorbis/stamp-h1
1286 libvorbis: libvorbis/stamp-h1
1287 @$(MAKE) -C libvorbis/lib all
1289 libvorbis-clean:
1290 -@$(MAKE) -C libvorbis clean
1291 @rm -f libvorbis/stamp-h1
1293 libvorbis-install: libvorbis
1294 @$(SEP)
1295 ifneq ($(MEDIA_SERVER_STATIC),y)
1296 install -D libvorbis/lib/.libs/libvorbis.so.0 $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1297 $(STRIP) $(INSTALLDIR)/libvorbis/usr/lib/libvorbis.so.0
1298 endif
1300 minidlna: zlib sqlite ffmpeg libogg flac jpeg libexif libid3tag libvorbis
1301 @$(SEP)
1302 @$(MAKE) -C minidlna CC=$(CC) $(if $(MEDIA_SERVER_STATIC),STATIC=1,) minidlna
1305 igmpproxy/src/Makefile: igmpproxy/src/Makefile.in
1306 cd igmpproxy && CFLAGS="-O2 -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1307 LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \
1308 $(CONFIGURE) --prefix=/usr
1310 igmpproxy: igmpproxy/src/Makefile
1311 @$(SEP)
1312 @$(MAKE) -C igmpproxy/src
1314 igmpproxy-install: igmpproxy
1315 install -D igmpproxy/src/igmpproxy $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1316 $(STRIP) $(INSTALLDIR)/igmpproxy/usr/sbin/igmpproxy
1318 igmpproxy-clean:
1319 -$(MAKE) -C igmpproxy/src clean
1320 @rm -f igmpproxy/src/Makefile
1322 udev:
1323 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)" \
1324 PROGRAMS=udevtrigger
1326 udev-install: udev
1327 install -d $(INSTALLDIR)
1328 install -d $(TARGETDIR)
1329 $(MAKE) -C udev DESTDIR=$(INSTALLDIR) prefix=/udev install-udevtrigger
1331 hotplug2:
1332 $(MAKE) -C $@ CROSS_COMPILE=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1334 hotplug2-install: hotplug2
1335 $(MAKE) -C hotplug2 install PREFIX=$(INSTALLDIR)/hotplug2 SUBDIRS=""
1336 $(MAKE) -C hotplug2/examples install PREFIX=$(INSTALLDIR)/hotplug2/rom KERNELVER=$(LINUX_KERNEL)
1338 emf:
1339 $(MAKE) -C $(SRCBASE)/emf/emfconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1341 emf-install: emf
1342 $(MAKE) -C $(SRCBASE)/emf/emfconf INSTALLDIR=$(INSTALLDIR) install
1344 igs:
1345 $(MAKE) -C $(SRCBASE)/emf/igsconf CROSS=$(CROSS_COMPILE) EXTRACFLAGS="$(EXTRACFLAGS)"
1347 igs-install: igs
1348 $(MAKE) -C $(SRCBASE)/emf/igsconf INSTALLDIR=$(INSTALLDIR) install
1351 ebtables: dummy
1352 $(MAKE) -C ebtables CC=$(CC) LD=$(LD) \
1353 CFLAGS="-Os $(EXTRACFLAGS) -DEBT_MIN_ALIGN=4 -Wall -Wunused" \
1354 LOCKFILE="/var/lock/ebtables" LOCKDIR="/var/lock" \
1355 BINDIR="/usr/sbin" LIBDIR="/usr/lib/ebtables" KERNEL_INCLUDES=$(LINUXDIR)/include $(if $(TCONFIG_IPV6),DO_IPV6=1,)
1357 ebtables-install: ebtables
1358 install -D ebtables/ebtables $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1360 @mkdir -p $(TARGETDIR)/rom/etc
1361 @sed 's/#.*//g;s/[ \t]\+/ /g;s/^[ \t]*//;s/[ \t]*$$//;/^$$/d' < $(TOP)/ebtables/ethertypes > $(TARGETDIR)/rom/etc/ethertypes
1362 chmod 0644 $(TARGETDIR)/rom/etc/ethertypes
1364 install -d $(INSTALLDIR)/ebtables/usr/lib
1365 install -d $(INSTALLDIR)/ebtables/usr/lib/ebtables
1366 install -D ebtables/*.so $(INSTALLDIR)/ebtables/usr/lib/
1367 install -D ebtables/extensions/*.so $(INSTALLDIR)/ebtables/usr/lib/ebtables/
1369 $(STRIP) $(INSTALLDIR)/ebtables/usr/sbin/ebtables
1370 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/ebtables/*.so
1371 $(STRIP) $(INSTALLDIR)/ebtables/usr/lib/libebt*.so
1373 ebtables-clean:
1374 make -C ebtables clean
1376 #Roadkill
1377 glib:
1378 @$(SEP)
1379 @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 \
1380 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 \
1381 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 \
1382 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 \
1383 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
1384 @$(MAKE) -C glib
1386 glib-clean:
1387 $(MAKE) -C glib clean
1389 glib-install:
1390 @$(MAKE) -C glib DESTDIR=$(INSTALLDIR)/glib install
1392 #Roadkill
1393 nocat: glib glib-install
1394 @$(SEP)
1395 @cd nocat && \
1396 NC_CONF_PATH="/" \
1397 $(CONFIGURE) --with-firewall=iptables --with-glib-prefix="$(INSTALLDIR)/glib/usr" --localstatedir=/var --sysconfdir=/etc
1398 @$(MAKE) -C nocat
1400 echo *** cleaning up glib staging after compile
1401 rm -rfv $(INSTALLDIR)/glib/usr
1402 echo *** integrate glib to nocat installdir
1403 install -d $(INSTALLDIR)/nocat/usr/lib
1404 install -D glib/.libs/libglib-1.2.so.0.0.10 $(INSTALLDIR)/nocat/usr/lib/libglib-1.2.so.0.0.10
1405 cd $(INSTALLDIR)/nocat/usr/lib && ln -s libglib-1.2.so.0.0.10 libglib-1.2.so.0
1406 $(STRIP) $(INSTALLDIR)/nocat/usr/lib/libglib-1.2.so.0.0.10
1408 nocat-clean:
1409 $(MAKE) -C nocat clean
1411 nocat-install:
1412 install -D nocat/src/splashd $(INSTALLDIR)/nocat/usr/sbin/splashd
1413 $(STRIP) $(INSTALLDIR)/nocat/usr/sbin/splashd
1414 mkdir -p $(INSTALLDIR)/nocat/usr/libexec/nocat
1415 install -D nocat/libexec/iptables/* $(INSTALLDIR)/nocat/usr/libexec/nocat
1417 lzo/stamp-h1:
1418 cd lzo && \
1419 CFLAGS="-Os -Wall -fPIC $(EXTRACFLAGS)" $(CONFIGURE) --enable-shared --enable-static
1420 touch lzo/stamp-h1
1422 lzo: lzo/stamp-h1
1424 lzo-clean:
1425 -$(MAKE) -C lzo clean
1426 @rm -f lzo/stamp-h1
1428 lzo-install: lzo
1429 install -D lzo/src/.libs/liblzo2.so $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1430 $(STRIP) $(INSTALLDIR)/lzo/usr/lib/liblzo2.so.2
1431 cd $(INSTALLDIR)/lzo/usr/lib && ln -sf liblzo2.so.2 liblzo2.so
1434 openvpn: openvpn/.conf openssl lzo
1436 openvpn/.conf:
1437 cd openvpn && CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \
1438 LDFLAGS="-L$(TOP)/openssl -L$(TOP)/lzo/src/.libs -ffunction-sections -fdata-sections -Wl,--gc-sections" \
1439 $(CONFIGURE) --prefix= \
1440 --with-lzo-headers="$(TOP)/lzo/include" \
1441 --with-ssl-headers="$(TOP)/openssl/include/" \
1442 --with-iproute-path="/usr/sbin/ip" \
1443 --disable-debug --disable-plugins --enable-management --enable-small \
1444 --disable-selinux --disable-socks --enable-password-save
1445 touch openvpn/.conf
1447 openvpn-clean:
1448 -$(MAKE) -C openvpn clean
1449 @rm -f openvpn/.conf
1451 openvpn-install: openvpn
1452 install -D openvpn/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1453 $(STRIP) -s $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1454 chmod 0500 $(INSTALLDIR)/openvpn/usr/sbin/openvpn
1456 sd-idle/stamp-h1:
1457 cd sd-idle \
1458 CFLAGS="-Os -Wall --host=mipsel-linux --target=mipsel-linux $(EXTRACFLAGS)" \
1459 $(MAKE) -C sd-idle
1460 chmod 0755 sd-idle/sd-idle
1461 touch sd-idle/stamp-h1
1463 sd-idle-clean:
1464 -$(MAKE) -C sd-idle clean
1465 @rm -f sd-idle/stamp-h1
1467 sd-idle-install: sd-idle/stamp-h1
1468 install -d $(INSTALLDIR)/sd-idle/usr/bin
1469 install -D sd-idle/sd-idle $(INSTALLDIR)/sd-idle/usr/bin/sd-idle
1470 $(STRIP) -s $(INSTALLDIR)/sd-idle/usr/bin/sd-idle
1472 snmp/stamp-h1:
1473 cd snmp && \
1474 CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
1475 $(CONFIGURE) --prefix=/usr --with-endianness=little --enable-mini-agent --disable-debugging \
1476 --disable-privacy --without-opaque-special-types --with-persistent-directory=/tmp/snmp-persist \
1477 --with-default-snmp-version=3 --with-sys-contact=root --with-sys-location=Unknown --with-logfile=/dev/null \
1478 --with-out-transports=UDPIPv6,TCPIPv6,AAL5PVC,IPX,TCP,Unix --enable-shared=no --enable-static --with-gnu-ld \
1479 --enable-internal-md5 --with-copy-persistent-files=no --without-openssl -sysconfdir=/tmp \
1480 --with-mib-modules=mibII,host,mibII/ip,mibII/tcp,mibII/udp,mibII/icmp,mibII/var_route,mibII/kernel_linux,qos,ucd_snmp \
1481 --with-out-mib-modules=snmpv3mibs,agent_mips,agentx,notification,utilities,target --disable-ipv6 --with-defaults \
1482 --without-efence --without-rsaref --without-kmem-usage --without-rpm --without-dmalloc
1483 touch snmp/stamp-h1
1485 snmp: snmp/stamp-h1
1486 @$(SEP)
1487 $(MAKE) -C snmp
1489 snmp-clean:
1490 -$(MAKE) -C snmp clean
1491 @rm -f snmp/stamp-h1
1493 snmp-install: snmp
1494 install -D snmp/agent/snmpd $(INSTALLDIR)/snmp/usr/sbin/snmpd
1495 $(STRIP) $(INSTALLDIR)/snmp/usr/sbin/snmpd
1498 # Generic rules
1502 @[ ! -d $* ] || ( $(SEP); $(MAKE) -C $* )
1505 %-clean:
1506 @-[ ! -d $* ] || $(MAKE) -C $* clean
1508 %-distclean:
1509 @-[ ! -d $* ] || $(MAKE) -C $* distclean
1511 %-install: %
1512 @[ ! -d $* ] || $(MAKE) -C $* install INSTALLDIR=$(INSTALLDIR)/$*
1514 %-build:
1515 $(MAKE) $*-clean $*
1517 $(obj-y) $(obj-n) $(obj-clean) $(obj-install): dummy
1519 .PHONY: all clean distclean mrproper install package
1520 .PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
1521 .PHONY: dummy libnet libpcap