various: chase gnutls2 upgrade
[nslu2-linux/optware.git] / Makefile
blobef7d46164c0ce4f22e55cea00f67c22fa8107ca7
1 # Makefile for Optware packages
3 # Copyright (C) 2004 by Rod Whitby <unslung@gmail.com>
4 # Copyright (C) 2004 by Oleg I. Vdovikin <oleg@cs.msu.su>
5 # Copyright (C) 2001-2004 Erik Andersen <andersen@codepoet.org>
6 # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 # one of `ls platforms/toolchain-*.mk | sed 's|^platforms/toolchain-\(.*\)\.mk$$|\1|'`
24 OPTWARE_TARGET ?= nslu2
27 # Add new packages here - make sure you have tested cross compilation.
28 # When they have been tested, they will be promoted and uploaded.
30 CROSS_PACKAGES_READY_FOR_TESTING = \
32 # Add new native-only packages here
33 # When they have been tested, they will be promoted and uploaded.
35 NATIVE_PACKAGES_READY_FOR_TESTING = \
37 # iozone - fileop_linux-arm.o: No such file or directory
38 # parted - does not work on the slug, even when compiled natively
39 # lumikki - does not install to /opt
40 # doxygen - host binary, not stripped
41 # bpalogin - for some reason it can't find 'sed' on the build machine
42 PACKAGES_THAT_NEED_TO_BE_FIXED = gkrellm parted lumikki \
43 doxygen \
44 iozone \
45 bpalogin \
47 PERL_PACKAGES = \
48 perl \
49 perl-algorithm-diff \
50 perl-appconfig perl-assp \
51 perl-archive-tar perl-archive-zip \
52 perl-b-keywords \
53 perl-berkeleydb \
54 perl-bit-vector \
55 perl-bsd-resource \
56 perl-business-isbn-data perl-business-isbn \
57 perl-carp-clan \
58 perl-cgi-application \
59 perl-class-accessor perl-class-data-inheritable perl-class-dbi perl-class-trigger \
60 perl-clone \
61 perl-compress-zlib \
62 perl-convert-binhex perl-convert-tnef perl-convert-uulib \
63 perl-crypt-openssl-random perl-crypt-openssl-rsa perl-crypt-ssleay \
64 perl-danga-socket \
65 perl-date-calc perl-date-manip \
66 perl-db-file \
67 perl-dbd-mysql perl-dbd-sqlite perl-dbi \
68 perl-dbix-contextualfetch \
69 perl-devel-caller perl-devel-lexalias \
70 perl-device-serialport \
71 perl-digest-hmac perl-digest-perl-md5 perl-digest-sha1 perl-digest-sha \
72 perl-encode-detect \
73 perl-extutils-cbuilder perl-extutils-parsexs \
74 perl-file-next perl-file-rename \
75 perl-gd perl-gd-barcode \
76 perl-html-parser perl-html-tagset perl-html-template perl-hottproxy \
77 perl-ima-dbi \
78 perl-io-multiplex perl-io-socket-ssl perl-io-string perl-io-stringy perl-io-zlib \
79 perl-ip-country \
80 perl-json-xs \
81 perl-lexical-persistence \
82 perl-libnet perl-libwww \
83 perl-mail-spf-query perl-mailtools \
84 perl-mime-tools \
85 perl-module-build perl-module-refresh perl-module-signature \
86 perl-net-cidr-lite perl-net-dns perl-net-ident perl-net-server perl-net-ssleay \
87 perl-padwalker \
88 perl-par-dist \
89 perl-pod-readme \
90 perl-scgi \
91 perl-storable \
92 perl-sys-hostname-long \
93 perl-sys-syscall \
94 perl-template-toolkit \
95 perl-term-readkey perl-term-readline-gnu \
96 perl-text-diff \
97 perl-unicode-map perl-unicode-string \
98 perl-universal-moniker \
99 perl-unix-syslog \
100 perl-uri \
101 perl-version \
102 perl-wakeonlan \
103 perl-xml-parser \
104 perl-yaml-syck \
105 ack \
106 amavisd-new \
107 colordiff \
108 cowsay \
109 ddclient \
110 ipcalc \
111 perlbal \
112 perlconsole \
113 postgrey \
114 rsnapshot \
115 slimserver squeezecenter \
116 spamassassin \
117 stow \
119 PYTHON_PACKAGES = \
120 cherokee-pyscgi \
121 dstat \
122 getmail \
123 hellanzb \
124 hplip \
125 ipython \
126 mailman \
127 mod-python mod-wsgi \
128 putmail \
129 pyrex \
130 sabnzbd sabnzbdplus \
131 scons \
132 py-4suite py-amara py-apsw \
133 py-bazaar-ng py-beaker py-bittorrent py-bluez py-buildutils \
134 py-celementtree py-cheetah py-cherrypy py-cherrytemplate py-cjson \
135 py-clips py-codeville py-configobj py-constraint py-crypto py-curl \
136 py-decorator py-decoratortools py-django py-docutils py-duplicity \
137 py-elementtree py-feedparser py-flup py-formencode \
138 py-gdchart2 py-gd py-genshi py-gnosis-utils \
139 py-hgsvn py-kid py-lxml \
140 py-mako py-markdown py-mercurial \
141 py-moin py-mssql py-mx-base py-mysql \
142 py-myghty py-myghtyutils \
143 py-nose \
144 py-openssl \
145 py-paste py-pastedeploy py-pastescript py-pastewebkit \
146 py-pexpect py-pil py-ply py-protocols \
147 py-pgsql py-psycopg py-psycopg2 py-pygresql \
148 py-pudge py-pylons py-pyro py-quixote \
149 py-rdiff-backup py-reportlab py-routes py-roundup py-ruledispatch \
150 py-scgi py-selector py-serial py-setuptools \
151 py-silvercity py-simplejson py-simpy py-soappy \
152 py-sqlalchemy py-sqlite py-sqlobject \
153 py-tailor py-tgfastdata py-trac \
154 py-turbocheetah py-turbogears py-turbojson py-turbokid \
155 py-urwid py-usb py-weatherget py-webpy py-wsgiref py-webhelpers \
156 py-xml py-yaml py-yenc py-zope-interface \
157 py-twisted py-axiom py-epsilon py-mantissa py-nevow \
159 ERLANG_PACKAGES = \
160 erlang erl-yaws \
162 # removed asterisk-chan-capi, doesn't build because of asterisk-stage problems
163 ASTERISK_PACKAGES = \
164 asterisk asterisk-sounds \
165 asterisk14 \
166 asterisk14-chan-capi \
167 asterisk14-core-sounds-en-alaw \
168 asterisk14-core-sounds-en-g729 \
169 asterisk14-core-sounds-en-gsm \
170 asterisk14-core-sounds-en-ulaw \
171 asterisk14-extra-sounds-en-alaw \
172 asterisk14-extra-sounds-en-g729 \
173 asterisk14-extra-sounds-en-gsm \
174 asterisk14-extra-sounds-en-ulaw \
175 asterisk14-moh-freeplay-alaw \
176 asterisk14-moh-freeplay-g729 \
177 asterisk14-moh-freeplay-gsm \
178 asterisk14-moh-freeplay-ulaw \
179 asterisk14-gui \
180 asterisk16 \
181 asterisk16-addons \
183 PACKAGES_REQUIRE_LINUX26 = \
184 inotail \
185 lm-sensors \
186 module-init-tools \
187 sysfsutils \
188 varnish \
190 PACKAGES_ONLY_WORK_ON_LINUX24 = \
191 modutils \
192 spindown \
194 # libao - has runtime trouble?
195 COMMON_CROSS_PACKAGES = \
196 9base \
197 abook adduser adns aiccu alac-decoder amule analog antinat \
198 apcupsd appweb \
199 apache apr apr-util \
200 arc aria2 arping arpwatch aspell \
201 $(ASTERISK_PACKAGES) \
202 at atftp atk atop audiofile autoconf automake autossh avahi \
203 bash bc bftpd bind bip bison bitchx bitlbee bogofilter \
204 bridge-utils \
205 bsdgames bsdmainutils \
206 btpd busybox byrequest bzflag bzip2 \
207 bluez-libs bluez-utils bluez-hcidump \
208 bluez2-libs bluez2-utils \
209 c-ares cabextract cairo calc calcurse castget \
210 catdoc ccollect ccxstream cdargs cdrtools centerim \
211 cherokee chicken chillispot chrpath cksfv \
212 classpath clamav clearsilver clips cmdftp \
213 cogito confuse connect coreutils corkscrew cpio cron \
214 cscope ctags ctcs ctorrent ctrlproxy \
215 cups cups-pdf cvs \
216 cyrus-imapd cyrus-sasl \
217 dansguardian dash davtools dbus dcraw denyhosts dev-pts dfu-util \
218 dialog dict digitemp dircproxy distcc dhcp diffstat diffutils \
219 dmsetup dnsmasq dnstracer dokuwiki dosfstools dovecot \
220 dropbear drraw dspam dtach dump \
221 e2fsprogs e2tools eaccelerator ed ecl electric-fence elinks \
222 emacs22 endian enhanced-ctorrent esmtp esniper \
223 $(ERLANG_PACKAGES) \
224 esound eggdrop eventlog expat extract-xiso ez-ipupdate \
225 faad2 fann fcgi fconfig fdupes fetchmail ffmpeg \
226 ficy file finch findutils firedrill-httptunnel \
227 fis fish fixesext flac flex flip \
228 fontconfig freecell freeradius freetds freetype freeze \
229 fribidi ftpcopy fslint ftpd-topfield fuppes \
230 gambit-c gawk gcal gconv-modules gdb gdbm gdchart \
231 geoip gettext \
232 ggrab ghostscript git glib gnet gnokii \
233 gnu-httptunnel gnu-smalltalk gnugo gnupg gnuplot gnutls gpgme \
234 gpsd \
235 grep groff gsasl gsnmp gtmess gtk gtypist gutenprint gzip \
236 gphoto2 libgphoto2 \
237 gift giftcurs gift-ares gift-fasttrack gift-gnutella \
238 gift-openft gift-opennap \
239 haproxy haserl hd2u hdparm hello hexcurse heyu \
240 hiawatha hnb hpijs hping htop httping \
241 ice icecast id3lib iftop ii iksemel imagemagick imap \
242 inadyn indent inetutils ink ipac-ng \
243 iperf ipkg-web iptables iptraf iputils-arping \
244 ircd-hybrid irssi ivorbis-tools \
245 jabberd jamvm jed jikes jove joe \
246 keychain kismet kissdx knock \
247 lame launchtool lcd4linux ldconfig leafnode less lftp lha \
248 liba52 libao libart libbt libcapi20 libcdio libcurl \
249 libdaemon libdb libdlna \
250 libdvb libdvbpsi libdvdnav libdvdread \
251 libesmtp libevent libexif libextractor libftdi \
252 libgc libgcrypt libgd libghttp libgmp libgpg-error \
253 libid3tag libidn libieee1284 libijs libinklevel libjpeg libksba \
254 liblcms libmad libmemcache libmpcdec libmpeg2 libmrss libmtp \
255 libnetfilter-queue libnfnetlink libnsl libnxml \
256 libol libogg libosip2 libopensync libotr \
257 libpar2 libpcap libpng libpth librsync \
258 libshout libsigc++ libsoup libsndfile libstdc++ \
259 libtasn1 libtiff libtool libtorrent \
260 libupnp libusb libvncserver libvorbis libvorbisidec libxml2 libxslt \
261 lighttpd lirc linksys-tftp littlesmalltalk llink \
262 logrotate lookat loudmouth lrzsz lsof ltrace \
263 lua luarocks \
264 lynx lzo \
265 m4 madplay make man man-pages mc mcabber md5deep mdadm \
266 mediatomb mediawiki memcached metalog memtester \
267 mg miau microcom microdc2 microperl mimms \
268 minicom mini-sendmail minihttpd miscfiles \
269 mktemp mlocate moblock moc modutils monit most motion \
270 mod-fastcgi moe monotone mp3blaster mpack mpage \
271 mpc mpd mpdscribble \
272 mpg123 mpop mrtg msmtp \
273 msort msynctool mt-daapd mt-daapd-svn mtools \
274 mtr multitail mutt mxml \
275 mysql mysql-connector-odbc \
276 nagg nagios-plugins nail nano nanoblogger nbench-byte \
277 ncdu ncftp ncmpc ncurses ncursesw nd ne nemesis \
278 neon net-snmp net-tools netatalk netcat nethack netio \
279 newsbeuter newt \
280 nfs-server nfs-utils \
281 nget nginx ngrep nickle ninvaders nmap nload noip nrpe \
282 ntfsprogs ntop ntp ntpclient nttcp nut nvi nylon nzbget \
283 ocaml oleo open2300 \
284 openobex obexftp \
285 opencdk opendchub openldap openser openssh openssl openvpn \
286 optware-devel ossp-js oww \
287 p7zip p910nd pal palantir pango par2cmdline patch patchutils \
288 pcapsipdump pciutils pcre pen perltgd pinentry \
289 phoneme-advanced \
290 php php-apache php-fcgi php-thttpd phpmyadmin \
291 picocom picolisp pkgconfig player polipo \
292 popt poptop portmap postgresql postfix pound ppp privoxy procmail \
293 procps proftpd proxytunnel psmisc psutils puppy pure-ftpd pv pwgen \
294 python python24 python25 $(PYTHON_PACKAGES) \
295 qemacs qemu qemu-libc-i386 quagga quickie quilt \
296 radiusclient-ng rc rcs rdate readline re2c recode recordext \
297 redir renderext rhtvision rlfe rlwrap rrdcollect rrdtool \
298 rssh rsstail rsync rtorrent rtpproxy ruby rubygems \
299 sablevm samba samba2 sane-backends \
300 scli scponly screen scsi-idle sdl sdparm \
301 sed sendmail ser ser2net setserial setpwc sg3-utils \
302 sharutils simh sipcalc siproxd slang slrn slsc \
303 sm smartmontools snort snownews \
304 socat softflowd spandsp speex spindown sqlite sqlite2 \
305 sqsh squeak squid srelay ssam sslwrap strace stunnel streamripper \
306 stupid-ftpd sudo surfraw swi-prolog svn syslog-ng sysstat syx \
307 taged taglib tar tcl tcpwrappers tftp-hpa \
308 tcpdump tcpflow tcsh termcap texinfo textutils thttpd \
309 tig tin tinyproxy tinyscheme tmsnc tnef tnftp tnftpd \
310 toppyweb tor torrent torrentflux \
311 transcode transmission transmissiond tre tree trickle \
312 tshark tsocks ttf-bitstream-vera tz tzwatch \
313 ucl uemacs unarj unfs3 units unixodbc unrar unrtf \
314 unzip up-imapproxy updatedd upslug2 \
315 upx usbutils ushare utf8proc util-linux util-linux-ng \
316 vblade vdr-mediamvp vim vitetris vlc \
317 vnstat vorbis-tools vpnc vsftpd vte vtun \
318 w3cam w3m wakelan webalizer weechat wget \
319 which whois wizd wpa-supplicant wput wxbase \
320 xmlrpc-c \
321 x11 xau xauth xaw xchat xcursor xdmcp xdpyinfo xext \
322 xextensions xfixes xft xinetd \
323 xmu xpdf xpm xproto xrender xt xterm xtrans xtst \
324 x264 xmail xvid \
325 yafc yawk yougrabber \
326 zile zip zlib zoo zsh \
328 # emacs and xemacs needs to run themselves to dump an image, so they probably will never cross-compile.
329 # ocaml does not use gnu configure, cross build may work by some more tweaking, build native first
330 # pure-ftpd too many AC_RUN_IF_ELSE
331 COMMON_NATIVE_PACKAGES = \
332 emacs \
333 xemacs \
334 hugs \
335 mldonkey \
336 mzscheme \
337 ocaml \
338 pure-ftpd \
339 unison \
341 # libiconv - has been made obsolete by gconv-modules
342 # Metalog - has been made obsolete by syslog-ng
343 PACKAGES_OBSOLETED = erl-escript libiconv metalog \
344 perl-spamassassin perl-mime-base64 jabber tzcode \
346 ##############
348 HOST_MACHINE:=$(shell uname -m | sed -e 's/i[3-9]86/i386/' )
349 HOST_OS:=$(shell uname)
351 # Directory location definitions
353 OPTWARE_TOP=$(shell if ! grep -q ^OPTWARE_TOP= ./Makefile; then cd ..; fi; pwd)
354 BASE_DIR:=$(shell pwd)
356 SOURCE_DIR=$(BASE_DIR)/sources
357 DL_DIR=$(BASE_DIR)/downloads
358 TOOL_BUILD_DIR=$(BASE_DIR)/toolchain
359 PACKAGE_DIR=$(BASE_DIR)/packages
361 BUILD_DIR=$(BASE_DIR)/builds
362 STAGING_DIR=$(BASE_DIR)/staging
364 STAGING_PREFIX=$(STAGING_DIR)/opt
365 STAGING_INCLUDE_DIR=$(STAGING_PREFIX)/include
366 STAGING_LIB_DIR=$(STAGING_PREFIX)/lib
367 STAGING_CPPFLAGS=$(TARGET_CFLAGS) -I$(STAGING_INCLUDE_DIR)
368 STAGING_LDFLAGS=$(TARGET_LDFLAGS) -L$(STAGING_LIB_DIR) -Wl,-rpath,/opt/lib -Wl,-rpath-link,$(STAGING_LIB_DIR)
370 HOST_BUILD_DIR=$(BASE_DIR)/host/builds
371 HOST_STAGING_DIR=$(BASE_DIR)/host/staging
373 HOST_STAGING_PREFIX=$(HOST_STAGING_DIR)/opt
374 HOST_STAGING_INCLUDE_DIR=$(HOST_STAGING_PREFIX)/include
375 HOST_STAGING_LIB_DIR=$(HOST_STAGING_PREFIX)/lib
376 HOST_STAGING_CPPFLAGS=-I$(HOST_STAGING_INCLUDE_DIR)
377 HOST_STAGING_LDFLAGS=-L$(HOST_STAGING_LIB_DIR) -Wl,-rpath,/opt/lib -Wl,-rpath-link,$(HOST_STAGING_LIB_DIR)
379 export TMPDIR=$(BASE_DIR)/tmp
381 ##############
383 all: directories toolchain packages
385 TARGET_OPTIMIZATION=-O2 #-mtune=xscale -march=armv4 -Wa,-mcpu=xscale
386 TARGET_DEBUGGING= #-g
388 include $(OPTWARE_TOP)/platforms/toolchain-$(OPTWARE_TARGET).mk
389 ifndef TARGET_USRLIBDIR
390 TARGET_USRLIBDIR = $(TARGET_LIBDIR)
391 endif
393 ifeq (darwin,$(TARGET_OS))
394 SHLIB_EXT=dylib
396 DYLIB=.dylib
397 else # default linux
398 SHLIB_EXT=so
399 SO=.so
400 DYLIB=
401 endif
403 ifeq ($(LIBC_STYLE), uclibc)
404 include $(OPTWARE_TOP)/platforms/packages-uclibc.mk
405 else
406 LIBC_STYLE=glibc
407 endif
409 include $(OPTWARE_TOP)/platforms/packages-$(OPTWARE_TARGET).mk
411 ifeq ($(HOSTCC), $(TARGET_CC))
412 PACKAGES ?= $(COMMON_NATIVE_PACKAGES)
413 PACKAGES_READY_FOR_TESTING = $(NATIVE_PACKAGES_READY_FOR_TESTING)
414 else
415 PACKAGES ?= $(filter-out $(NATIVE_PACKAGES) $(BROKEN_PACKAGES), $(COMMON_CROSS_PACKAGES) $(SPECIFIC_PACKAGES))
416 PACKAGES_READY_FOR_TESTING = $(CROSS_PACKAGES_READY_FOR_TESTING)
417 endif
419 ifneq (, $(filter ipkg-opt $(OPTWARE_TARGET)-bootstrap $(OPTWARE_TARGET)-optware-bootstrap, $(PACKAGES)))
420 UPD-ALT_PREFIX ?= /opt
421 endif
423 testing:
424 $(MAKE) PACKAGES="$(PACKAGES_READY_FOR_TESTING)" all
425 $(PERL) -w scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) --objdump-path=$(TARGET_CROSS)objdump --base-dir=$(BASE_DIR) $(patsubst %,$(BUILD_DIR)/%*.ipk,$(PACKAGES_READY_FOR_TESTING))
427 # Common tools which may need overriding
428 CVS=cvs
429 SUDO=sudo
430 WGET=wget --passive-ftp
431 PERL=perl
433 # The hostname or IP number of our local dl.sf.net mirror
434 SOURCEFORGE_MIRROR=easynews.dl.sf.net
435 SOURCES_NLO_SITE=http://sources.nslu2-linux.org/sources
437 TARGET_CXX=$(TARGET_CROSS)g++
438 TARGET_CC=$(TARGET_CROSS)gcc
439 TARGET_CPP="$(TARGET_CC) -E"
440 TARGET_LD=$(TARGET_CROSS)ld
441 TARGET_AR=$(TARGET_CROSS)ar
442 TARGET_AS=$(TARGET_CROSS)as
443 TARGET_NM=$(TARGET_CROSS)nm
444 TARGET_RANLIB=$(TARGET_CROSS)ranlib
445 TARGET_STRIP?=$(TARGET_CROSS)strip
446 TARGET_CONFIGURE_OPTS= \
447 AR=$(TARGET_AR) \
448 AS=$(TARGET_AS) \
449 LD=$(TARGET_LD) \
450 NM=$(TARGET_NM) \
451 CC=$(TARGET_CC) \
452 CPP=$(TARGET_CPP) \
453 GCC=$(TARGET_CC) \
454 CXX=$(TARGET_CXX) \
455 RANLIB=$(TARGET_RANLIB) \
456 STRIP=$(TARGET_STRIP)
457 TARGET_PATH=$(STAGING_PREFIX)/bin:$(STAGING_DIR)/bin:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin
459 STRIP_COMMAND ?= $(TARGET_STRIP) --remove-section=.comment --remove-section=.note --strip-unneeded
461 PATCH_LIBTOOL=sed -i \
462 -e 's|^sys_lib_search_path_spec=.*"$$|sys_lib_search_path_spec="$(TARGET_LIBDIR) $(STAGING_LIB_DIR)"|' \
463 -e 's|^sys_lib_dlsearch_path_spec=.*"$$|sys_lib_dlsearch_path_spec=""|' \
464 -e 's|^hardcode_libdir_flag_spec=.*"$$|hardcode_libdir_flag_spec=""|' \
465 -e 's|nmedit |$(TARGET_CROSS)nmedit |' \
467 # Clear these variables to remove assumptions
473 GCC=
474 CXX=
475 RANLIB=
476 STRIP=
477 LD_LIBRARY_PATH=
479 PACKAGES_CLEAN:=$(patsubst %,%-clean,$(PACKAGES))
480 PACKAGES_SOURCE:=$(patsubst %,%-source,$(PACKAGES))
481 PACKAGES_DIRCLEAN:=$(patsubst %,%-dirclean,$(PACKAGES))
482 PACKAGES_STAGE:=$(patsubst %,%-stage,$(PACKAGES))
483 PACKAGES_IPKG:=$(patsubst %,%-ipk,$(PACKAGES))
485 $(PACKAGES) : directories toolchain
486 $(PACKAGES_STAGE) %-stage : directories toolchain
487 $(PACKAGES_IPKG) %-ipk : directories toolchain ipkg-utils
489 .PHONY: index
490 index: $(PACKAGE_DIR)/Packages
492 ifeq ($(PACKAGE_DIR),$(BASE_DIR)/packages)
493 ifeq (,$(findstring -bootstrap,$(SPECIFIC_PACKAGES)))
494 $(PACKAGE_DIR)/Packages: $(BUILD_DIR)/*.ipk
495 else
496 $(PACKAGE_DIR)/Packages: $(BUILD_DIR)/*.ipk $(BUILD_DIR)/*.xsh
497 endif
498 if ls $(BUILD_DIR)/*_$(TARGET_ARCH).xsh > /dev/null 2>&1; then \
499 rm -f $(@D)/*_$(TARGET_ARCH).xsh ; \
500 cp -fal $(BUILD_DIR)/*_$(TARGET_ARCH).xsh $(@D)/ ; \
502 rm -f $(@D)/*_$(TARGET_ARCH).ipk
503 cp -fal $(BUILD_DIR)/*_$(TARGET_ARCH).ipk $(@D)/
504 else
505 $(PACKAGE_DIR)/Packages:
506 endif
508 cd $(PACKAGE_DIR); \
509 $(IPKG_MAKE_INDEX) . > Packages; \
510 gzip -c Packages > Packages.gz; \
512 @echo "ALL DONE."
514 packages: $(PACKAGES_IPKG)
515 $(MAKE) index
517 .PHONY: all clean dirclean distclean directories packages source toolchain \
518 buildroot-toolchain libuclibc++-toolchain \
519 autoclean \
520 $(PACKAGES) $(PACKAGES_SOURCE) $(PACKAGES_DIRCLEAN) \
521 $(PACKAGES_STAGE) $(PACKAGES_IPKG) \
522 query-%
524 query-%:
525 @echo $($(*))
527 include make/*.mk
529 directories: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(STAGING_PREFIX) \
530 $(STAGING_LIB_DIR) $(STAGING_INCLUDE_DIR) $(TOOL_BUILD_DIR) \
531 $(PACKAGE_DIR) $(TMPDIR)
533 $(DL_DIR):
534 mkdir $(DL_DIR)
536 $(BUILD_DIR):
537 mkdir $(BUILD_DIR)
539 $(STAGING_DIR):
540 mkdir $(STAGING_DIR)
542 $(STAGING_PREFIX):
543 mkdir $(STAGING_PREFIX)
545 $(STAGING_LIB_DIR):
546 mkdir $(STAGING_LIB_DIR)
548 $(STAGING_INCLUDE_DIR):
549 mkdir $(STAGING_INCLUDE_DIR)
551 $(TOOL_BUILD_DIR):
552 mkdir $(TOOL_BUILD_DIR)
554 $(PACKAGE_DIR):
555 mkdir $(PACKAGE_DIR)
557 $(TMPDIR):
558 mkdir $(TMPDIR)
560 source: $(PACKAGES_SOURCE)
562 check-packages:
563 @$(PERL) -w scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) --objdump-path=$(TARGET_CROSS)objdump --base-dir=$(BASE_DIR) $(filter-out $(BUILD_DIR)/crosstool-native-%,$(wildcard $(BUILD_DIR)/*.ipk))
565 autoclean:
566 $(PERL) -w scripts/optware-autoclean.pl -v -C $(BASE_DIR)
568 clean: $(TARGETS_CLEAN) $(PACKAGES_CLEAN)
569 find . -name '*~' -print | xargs /bin/rm -f
570 find . -name '.*~' -print | xargs /bin/rm -f
571 find . -name '.#*' -print | xargs /bin/rm -f
573 dirclean: $(PACKAGES_DIRCLEAN)
575 distclean:
576 cd $(OPTWARE_TOP)
577 rm -rf $(BUILD_DIR) $(STAGING_DIR) $(PACKAGE_DIR)
578 rm -rf host
579 rm -rf `ls platforms/toolchain-*.mk | sed 's|^platforms/toolchain-\(.*\)\.mk$$|\1|'`
581 toolclean:
582 rm -rf $(TOOL_BUILD_DIR)
584 %-savespace:
585 scripts/clean-workdir.sh $*
587 host/.configured:
588 [ -d $(HOST_BUILD_DIR) ] || ( \
589 if [ "$(OPTWARE_TARGET)" = $(shell basename $(BASE_DIR)) ]; \
590 then mkdir -p ../host; ln -s ../host .; \
591 else mkdir -p host; \
592 fi; \
593 mkdir -p $(HOST_BUILD_DIR) $(HOST_STAGING_PREFIX); \
595 [ -e $@ ] || touch $@
597 %-target %/.configured:
598 [ -e ${DL_DIR} ] || mkdir -p ${DL_DIR}
599 [ -e $*/Makefile ] || ( \
600 mkdir -p $* ; \
601 echo "OPTWARE_TARGET=$*" > $*/Makefile ; \
602 echo "include ../Makefile" >> $*/Makefile ; \
603 ln -s ../downloads $*/downloads ; \
604 ln -s ../make $*/make ; \
605 ln -s ../scripts $*/scripts ; \
606 ln -s ../sources $*/sources ; \
608 touch $*/.configured
611 make/%.mk:
612 PKG_UP=$$(echo $* | tr [a-z\-] [A-Z_]); \
613 sed -e "s/<foo>/$*/g" -e "s/<FOO>/$${PKG_UP}/g" \
614 -e '6,11d' make/template.mk > $@