ccollect:0.6.2->0.7.0
[nslu2-linux/optware.git] / Makefile
blob49d7339afb04a7cac03c43e540691f8b5100bb63
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 gitosis \
124 hellanzb \
125 hplip \
126 ipython \
127 mailman \
128 mod-python mod-wsgi \
129 putmail \
130 pyrex \
131 sabnzbd sabnzbdplus \
132 scons \
133 py-4suite py-amara py-apsw \
134 py-bazaar-ng py-beaker py-bittorrent py-bluez py-buildutils \
135 py-celementtree py-cheetah py-cherrypy py-cherrytemplate py-cjson \
136 py-clips py-codeville py-configobj py-constraint py-crypto py-curl \
137 py-decorator py-decoratortools py-django py-docutils py-duplicity \
138 py-elementtree py-feedparser py-flup py-formencode \
139 py-gdchart2 py-gd py-genshi py-gnosis-utils \
140 py-hgsvn py-kid py-lxml \
141 py-mako py-markdown py-mercurial \
142 py-moin py-mssql py-mx-base py-mysql \
143 py-myghty py-myghtyutils \
144 py-nose \
145 py-openssl \
146 py-paste py-pastedeploy py-pastescript py-pastewebkit \
147 py-pexpect py-pil py-ply py-protocols \
148 py-pgsql py-psycopg py-psycopg2 py-pygresql \
149 py-pudge py-pylons py-pyro py-quixote \
150 py-rdiff-backup py-reportlab py-routes py-roundup py-ruledispatch \
151 py-scgi py-selector py-serial py-setuptools \
152 py-silvercity py-simplejson py-simpy py-soappy \
153 py-sqlalchemy py-sqlite py-sqlobject \
154 py-tailor py-tgfastdata py-trac \
155 py-turbocheetah py-turbogears py-turbojson py-turbokid \
156 py-urwid py-usb py-weatherget py-webpy py-wsgiref py-webhelpers \
157 py-xml py-yaml py-yenc py-zope-interface \
158 py-twisted py-axiom py-epsilon py-mantissa py-nevow \
160 ERLANG_PACKAGES = \
161 erlang erl-yaws \
163 # removed asterisk-chan-capi, doesn't build because of asterisk-stage problems
164 ASTERISK_PACKAGES = \
165 asterisk asterisk-sounds \
166 asterisk14 \
167 asterisk14-chan-capi \
168 asterisk14-core-sounds-en-alaw \
169 asterisk14-core-sounds-en-g729 \
170 asterisk14-core-sounds-en-gsm \
171 asterisk14-core-sounds-en-ulaw \
172 asterisk14-extra-sounds-en-alaw \
173 asterisk14-extra-sounds-en-g729 \
174 asterisk14-extra-sounds-en-gsm \
175 asterisk14-extra-sounds-en-ulaw \
176 asterisk14-moh-freeplay-alaw \
177 asterisk14-moh-freeplay-g729 \
178 asterisk14-moh-freeplay-gsm \
179 asterisk14-moh-freeplay-ulaw \
180 asterisk14-gui \
181 asterisk16 \
182 asterisk16-addons \
184 PACKAGES_REQUIRE_LINUX26 = \
185 inotail \
186 lm-sensors \
187 module-init-tools \
188 sysfsutils \
189 varnish \
191 PACKAGES_ONLY_WORK_ON_LINUX24 = \
192 modutils \
193 spindown \
195 # libao - has runtime trouble?
196 COMMON_CROSS_PACKAGES = \
197 9base \
198 abook adduser adns aiccu alac-decoder amule analog antinat \
199 apcupsd appweb \
200 apache apr apr-util \
201 arc aria2 arping arpwatch aspell \
202 $(ASTERISK_PACKAGES) \
203 at atftp atk atop audiofile autoconf automake autossh avahi \
204 bash bc bftpd bind bip bison bitchx bitlbee bogofilter \
205 bridge-utils \
206 bsdgames bsdmainutils \
207 btpd busybox byrequest bzflag bzip2 \
208 bluez-libs bluez-utils bluez-hcidump \
209 bluez2-libs bluez2-utils \
210 c-ares cabextract cairo calc calcurse castget \
211 catdoc ccollect ccxstream cdargs cdrtools centerim \
212 cherokee chicken chillispot chrpath cksfv \
213 classpath clamav clearsilver climm clips cmdftp \
214 cogito confuse connect coreutils corkscrew cpio cron \
215 cscope ctags ctcs ctorrent ctrlproxy \
216 cups cups-pdf cvs \
217 cyrus-imapd cyrus-sasl \
218 dansguardian dash davtools dbus dcraw denyhosts dev-pts dfu-util \
219 dialog dict digitemp dircproxy distcc dhcp diffstat diffutils \
220 dmsetup dnsmasq dnstracer dokuwiki dosfstools dovecot \
221 dropbear drraw dspam dtach dump \
222 e2fsprogs e2tools eaccelerator ed ecl electric-fence elinks \
223 emacs22 endian enhanced-ctorrent esmtp esniper \
224 $(ERLANG_PACKAGES) \
225 esound eggdrop eventlog expat extract-xiso ez-ipupdate \
226 faad2 fann fcgi fconfig fdupes fetchmail ffmpeg \
227 ficy file finch findutils firedrill-httptunnel \
228 fis fish fixesext flac flex flip \
229 fontconfig freecell freeradius freetds freetype freeze \
230 fribidi ftpcopy fslint ftpd-topfield fuppes \
231 gambit-c gawk gcal gconv-modules gdb gdbm gdchart \
232 geoip gettext \
233 ggrab ghostscript git glib gnet gnokii \
234 gnu-httptunnel gnu-smalltalk gnugo gnupg gnuplot gnutls gpgme \
235 gloox gpsd \
236 grep groff gsasl gsnmp gtmess gtk gtypist gutenprint gzip \
237 gphoto2 libgphoto2 \
238 gift giftcurs gift-ares gift-fasttrack gift-gnutella \
239 gift-openft gift-opennap \
240 haproxy haserl hd2u hdparm hello hexcurse heyu \
241 hiawatha hnb hpijs hping htop httping \
242 ice icecast id3lib iftop ii iksemel imagemagick imap \
243 inadyn indent inetutils ink ipac-ng \
244 iperf ipkg-web iptables iptraf iputils-arping \
245 ircd-hybrid irssi ivorbis-tools \
246 jabberd jamvm jed jikes jove joe \
247 keychain kismet kissdx knock \
248 lame launchtool lcd4linux ldconfig leafnode less lftp lha \
249 liba52 libao libart libbt libcapi20 libcdio libcurl \
250 libdaemon libdb libdlna \
251 libdvb libdvbpsi libdvdnav libdvdread \
252 libesmtp libevent libexif libextractor libftdi \
253 libgc libgcrypt libgd libghttp libgmp libgpg-error \
254 libid3tag libidn libieee1284 libijs libinklevel libjpeg libksba \
255 liblcms libmad libmemcache libmpcdec libmpeg2 libmrss libmtp \
256 libnetfilter-queue libnfnetlink libnsl libnxml \
257 libol libogg libosip2 libopensync libotr \
258 libpar2 libpcap libpng libpth librsync \
259 libshout libsigc++ libsoup libsndfile libstdc++ \
260 libtasn1 libtiff libtool libtorrent \
261 libupnp libusb libvncserver libvorbis libvorbisidec libxml2 libxslt \
262 lighttpd lirc links2 linksys-tftp littlesmalltalk llink \
263 logrotate lookat loudmouth lrzsz lsof ltrace \
264 lua luarocks \
265 lynx lzo \
266 m4 madplay make man man-pages mc mcabber md5deep mdadm \
267 mediatomb mediawiki memcached metalog memtester \
268 mg miau microcom microdc2 microperl mimms \
269 minicom mini-sendmail minihttpd miscfiles \
270 mktemp mlocate moblock moc modutils monit most motion \
271 mod-fastcgi moe monotone mp3blaster mpack mpage \
272 mpc mpd mpdscribble \
273 mpg123 mpop mrtg msmtp \
274 msort msynctool mt-daapd mt-daapd-svn mtools \
275 mtr multitail mutt mxml \
276 mysql mysql-connector-odbc \
277 nagg nagios-plugins nail nano nanoblogger nbench-byte \
278 ncdu ncftp ncmpc ncurses ncursesw nd ne nemesis \
279 neon net-snmp net-tools netatalk netcat nethack netio netrik \
280 newsbeuter newt \
281 nfs-server nfs-utils \
282 nget nginx ngrep nickle ninvaders nmap nload noip nrpe \
283 ntfsprogs ntop ntp ntpclient nttcp nut nvi nylon nzbget \
284 ocaml oleo open2300 \
285 openobex obexftp \
286 opendchub openldap openser openssh openssl openvpn \
287 optware-devel ossp-js oww \
288 p7zip p910nd pal palantir pango par2cmdline patch patchutils \
289 pcapsipdump pciutils pcre pen perltgd pinentry \
290 phoneme-advanced \
291 php php-apache php-fcgi php-thttpd phpmyadmin \
292 picocom picolisp pkgconfig player polipo \
293 popt poptop portmap postgresql postfix pound ppp privoxy procmail \
294 procps proftpd proxytunnel psmisc psutils puppy pure-ftpd pv pwgen \
295 python python24 python25 python26 $(PYTHON_PACKAGES) \
296 qemacs qemu qemu-libc-i386 quagga quickie quilt \
297 radiusclient-ng rc rcs rdate readline re2c recode recordext \
298 redir renderext rhtvision rlfe rlwrap rrdcollect rrdtool \
299 rssh rsstail rsync rtorrent rtpproxy ruby rubygems \
300 sablevm samba samba2 sane-backends \
301 scli scponly screen scsi-idle sdl sdparm \
302 sed sendmail ser ser2net setserial setpwc sg3-utils \
303 sharutils simh sipcalc siproxd slang slrn slsc \
304 sm smartmontools snort snownews \
305 socat softflowd spandsp speex spindown sqlite sqlite2 \
306 sqsh squeak squid srelay ssam sslwrap strace stunnel streamripper \
307 stupid-ftpd sudo surfraw swi-prolog svn syslog-ng sysstat syx \
308 taged taglib tar tcl tcpwrappers tftp-hpa \
309 tcpdump tcpflow tcsh termcap texinfo textutils thttpd \
310 tig tin tinyproxy tinyscheme tmsnc tnef tnftp tnftpd \
311 toppyweb tor torrent torrentflux \
312 transcode transmission transmissiond tre tree trickle \
313 tshark tsocks ttf-bitstream-vera tz tzwatch \
314 ucl uemacs unarj unfs3 units unixodbc unrar unrtf \
315 unzip up-imapproxy updatedd upslug2 \
316 upx usbutils ushare utf8proc util-linux util-linux-ng \
317 vblade vdr-mediamvp vim vitetris vlc \
318 vnstat vorbis-tools vpnc vsftpd vte vtun \
319 w3cam w3m wakelan webalizer weechat wget \
320 which whois wizd wpa-supplicant wput wxbase \
321 xmlrpc-c \
322 x11 xau xauth xaw xchat xcursor xdmcp xdpyinfo xext \
323 xextensions xfixes xft xinetd \
324 xmu xpdf xpm xproto xrender xt xterm xtrans xtst \
325 x264 xmail xvid \
326 yafc yawk yougrabber \
327 zile zip zlib zoo zsh \
329 # emacs and xemacs needs to run themselves to dump an image, so they probably will never cross-compile.
330 # ocaml does not use gnu configure, cross build may work by some more tweaking, build native first
331 # pure-ftpd too many AC_RUN_IF_ELSE
332 COMMON_NATIVE_PACKAGES = \
333 emacs \
334 xemacs \
335 hugs \
336 mldonkey \
337 mzscheme \
338 ocaml \
339 pure-ftpd \
340 unison \
342 # libiconv - has been made obsolete by gconv-modules
343 # Metalog - has been made obsolete by syslog-ng
344 PACKAGES_OBSOLETED = erl-escript libiconv metalog \
345 perl-spamassassin perl-mime-base64 jabber tzcode \
347 ##############
349 HOST_MACHINE:=$(shell uname -m | sed -e 's/i[3-9]86/i386/' )
350 HOST_OS:=$(shell uname)
352 # Directory location definitions
354 OPTWARE_TOP=$(shell if ! grep -q ^OPTWARE_TOP= ./Makefile; then cd ..; fi; pwd)
355 BASE_DIR:=$(shell pwd)
357 SOURCE_DIR=$(BASE_DIR)/sources
358 DL_DIR=$(BASE_DIR)/downloads
359 TOOL_BUILD_DIR=$(BASE_DIR)/toolchain
360 PACKAGE_DIR=$(BASE_DIR)/packages
362 BUILD_DIR=$(BASE_DIR)/builds
363 STAGING_DIR=$(BASE_DIR)/staging
365 STAGING_PREFIX=$(STAGING_DIR)/opt
366 STAGING_INCLUDE_DIR=$(STAGING_PREFIX)/include
367 STAGING_LIB_DIR=$(STAGING_PREFIX)/lib
368 STAGING_CPPFLAGS=$(TARGET_CFLAGS) -I$(STAGING_INCLUDE_DIR)
369 STAGING_LDFLAGS=$(TARGET_LDFLAGS) -L$(STAGING_LIB_DIR) -Wl,-rpath,/opt/lib -Wl,-rpath-link,$(STAGING_LIB_DIR)
371 HOST_BUILD_DIR=$(BASE_DIR)/host/builds
372 HOST_STAGING_DIR=$(BASE_DIR)/host/staging
374 HOST_STAGING_PREFIX=$(HOST_STAGING_DIR)/opt
375 HOST_STAGING_INCLUDE_DIR=$(HOST_STAGING_PREFIX)/include
376 HOST_STAGING_LIB_DIR=$(HOST_STAGING_PREFIX)/lib
377 HOST_STAGING_CPPFLAGS=-I$(HOST_STAGING_INCLUDE_DIR)
378 HOST_STAGING_LDFLAGS=-L$(HOST_STAGING_LIB_DIR) -Wl,-rpath,/opt/lib -Wl,-rpath-link,$(HOST_STAGING_LIB_DIR)
380 export TMPDIR=$(BASE_DIR)/tmp
382 ##############
384 all: directories toolchain packages
386 TARGET_OPTIMIZATION=-O2 #-mtune=xscale -march=armv4 -Wa,-mcpu=xscale
387 TARGET_DEBUGGING= #-g
389 include $(OPTWARE_TOP)/platforms/toolchain-$(OPTWARE_TARGET).mk
390 ifndef TARGET_USRLIBDIR
391 TARGET_USRLIBDIR = $(TARGET_LIBDIR)
392 endif
394 ifeq (darwin,$(TARGET_OS))
395 SHLIB_EXT=dylib
397 DYLIB=.dylib
398 else # default linux
399 SHLIB_EXT=so
400 SO=.so
401 DYLIB=
402 endif
404 ifeq ($(LIBC_STYLE), uclibc)
405 include $(OPTWARE_TOP)/platforms/packages-uclibc.mk
406 else
407 LIBC_STYLE=glibc
408 endif
410 include $(OPTWARE_TOP)/platforms/packages-$(OPTWARE_TARGET).mk
412 ifeq ($(HOSTCC), $(TARGET_CC))
413 PACKAGES ?= $(COMMON_NATIVE_PACKAGES)
414 PACKAGES_READY_FOR_TESTING = $(NATIVE_PACKAGES_READY_FOR_TESTING)
415 else
416 PACKAGES ?= $(filter-out $(NATIVE_PACKAGES) $(BROKEN_PACKAGES), $(COMMON_CROSS_PACKAGES) $(SPECIFIC_PACKAGES))
417 PACKAGES_READY_FOR_TESTING = $(CROSS_PACKAGES_READY_FOR_TESTING)
418 endif
420 ifneq (, $(filter ipkg-opt $(OPTWARE_TARGET)-bootstrap $(OPTWARE_TARGET)-optware-bootstrap, $(PACKAGES)))
421 UPD-ALT_PREFIX ?= /opt
422 endif
424 testing:
425 $(MAKE) PACKAGES="$(PACKAGES_READY_FOR_TESTING)" all
426 $(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))
428 # Common tools which may need overriding
429 CVS=cvs
430 SUDO=sudo
431 WGET=wget --passive-ftp
432 PERL=perl
434 # The hostname or IP number of our local dl.sf.net mirror
435 SOURCEFORGE_MIRROR=easynews.dl.sf.net
436 SOURCES_NLO_SITE=http://sources.nslu2-linux.org/sources
438 TARGET_CXX=$(TARGET_CROSS)g++
439 TARGET_CC=$(TARGET_CROSS)gcc
440 TARGET_CPP="$(TARGET_CC) -E"
441 TARGET_LD=$(TARGET_CROSS)ld
442 TARGET_AR=$(TARGET_CROSS)ar
443 TARGET_AS=$(TARGET_CROSS)as
444 TARGET_NM=$(TARGET_CROSS)nm
445 TARGET_RANLIB=$(TARGET_CROSS)ranlib
446 TARGET_STRIP?=$(TARGET_CROSS)strip
447 TARGET_CONFIGURE_OPTS= \
448 AR=$(TARGET_AR) \
449 AS=$(TARGET_AS) \
450 LD=$(TARGET_LD) \
451 NM=$(TARGET_NM) \
452 CC=$(TARGET_CC) \
453 CPP=$(TARGET_CPP) \
454 GCC=$(TARGET_CC) \
455 CXX=$(TARGET_CXX) \
456 RANLIB=$(TARGET_RANLIB) \
457 STRIP=$(TARGET_STRIP)
458 TARGET_PATH=$(STAGING_PREFIX)/bin:$(STAGING_DIR)/bin:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin
460 STRIP_COMMAND ?= $(TARGET_STRIP) --remove-section=.comment --remove-section=.note --strip-unneeded
462 PATCH_LIBTOOL=sed -i \
463 -e 's|^sys_lib_search_path_spec=.*"$$|sys_lib_search_path_spec="$(TARGET_LIBDIR) $(STAGING_LIB_DIR)"|' \
464 -e 's|^sys_lib_dlsearch_path_spec=.*"$$|sys_lib_dlsearch_path_spec=""|' \
465 -e 's|^hardcode_libdir_flag_spec=.*"$$|hardcode_libdir_flag_spec=""|' \
466 -e 's|nmedit |$(TARGET_CROSS)nmedit |' \
468 # Clear these variables to remove assumptions
474 GCC=
475 CXX=
476 RANLIB=
477 STRIP=
478 LD_LIBRARY_PATH=
480 PACKAGES_CLEAN:=$(patsubst %,%-clean,$(PACKAGES))
481 PACKAGES_SOURCE:=$(patsubst %,%-source,$(PACKAGES))
482 PACKAGES_DIRCLEAN:=$(patsubst %,%-dirclean,$(PACKAGES))
483 PACKAGES_STAGE:=$(patsubst %,%-stage,$(PACKAGES))
484 PACKAGES_IPKG:=$(patsubst %,%-ipk,$(PACKAGES))
486 $(PACKAGES) : directories toolchain
487 $(PACKAGES_STAGE) %-stage : directories toolchain
488 $(PACKAGES_IPKG) %-ipk : directories toolchain ipkg-utils
490 .PHONY: index
491 index: $(PACKAGE_DIR)/Packages
493 ifeq ($(PACKAGE_DIR),$(BASE_DIR)/packages)
494 ifeq (,$(findstring -bootstrap,$(SPECIFIC_PACKAGES)))
495 $(PACKAGE_DIR)/Packages: $(BUILD_DIR)/*.ipk
496 else
497 $(PACKAGE_DIR)/Packages: $(BUILD_DIR)/*.ipk $(BUILD_DIR)/*.xsh
498 endif
499 if ls $(BUILD_DIR)/*_$(TARGET_ARCH).xsh > /dev/null 2>&1; then \
500 rm -f $(@D)/*_$(TARGET_ARCH).xsh ; \
501 cp -fal $(BUILD_DIR)/*_$(TARGET_ARCH).xsh $(@D)/ ; \
503 rm -f $(@D)/*_$(TARGET_ARCH).ipk
504 cp -fal $(BUILD_DIR)/*_$(TARGET_ARCH).ipk $(@D)/
505 else
506 $(PACKAGE_DIR)/Packages:
507 endif
509 cd $(PACKAGE_DIR); \
510 $(IPKG_MAKE_INDEX) . > Packages; \
511 gzip -c Packages > Packages.gz; \
513 @echo "ALL DONE."
515 packages: $(PACKAGES_IPKG)
516 $(MAKE) index
518 .PHONY: all clean dirclean distclean directories packages source toolchain \
519 buildroot-toolchain libuclibc++-toolchain \
520 autoclean \
521 $(PACKAGES) $(PACKAGES_SOURCE) $(PACKAGES_DIRCLEAN) \
522 $(PACKAGES_STAGE) $(PACKAGES_IPKG) \
523 query-%
525 query-%:
526 @echo $($(*))
528 include make/*.mk
530 directories: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(STAGING_PREFIX) \
531 $(STAGING_LIB_DIR) $(STAGING_INCLUDE_DIR) $(TOOL_BUILD_DIR) \
532 $(PACKAGE_DIR) $(TMPDIR)
534 $(DL_DIR):
535 mkdir $(DL_DIR)
537 $(BUILD_DIR):
538 mkdir $(BUILD_DIR)
540 $(STAGING_DIR):
541 mkdir $(STAGING_DIR)
543 $(STAGING_PREFIX):
544 mkdir $(STAGING_PREFIX)
546 $(STAGING_LIB_DIR):
547 mkdir $(STAGING_LIB_DIR)
549 $(STAGING_INCLUDE_DIR):
550 mkdir $(STAGING_INCLUDE_DIR)
552 $(TOOL_BUILD_DIR):
553 mkdir $(TOOL_BUILD_DIR)
555 $(PACKAGE_DIR):
556 mkdir $(PACKAGE_DIR)
558 $(TMPDIR):
559 mkdir $(TMPDIR)
561 source: $(PACKAGES_SOURCE)
563 check-packages:
564 @$(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))
566 autoclean:
567 $(PERL) -w scripts/optware-autoclean.pl -v -C $(BASE_DIR)
569 clean: $(TARGETS_CLEAN) $(PACKAGES_CLEAN)
570 find . -name '*~' -print | xargs /bin/rm -f
571 find . -name '.*~' -print | xargs /bin/rm -f
572 find . -name '.#*' -print | xargs /bin/rm -f
574 dirclean: $(PACKAGES_DIRCLEAN)
576 distclean:
577 cd $(OPTWARE_TOP)
578 rm -rf $(BUILD_DIR) $(STAGING_DIR) $(PACKAGE_DIR)
579 rm -rf host
580 rm -rf `ls platforms/toolchain-*.mk | sed 's|^platforms/toolchain-\(.*\)\.mk$$|\1|'`
582 toolclean:
583 rm -rf $(TOOL_BUILD_DIR)
585 %-savespace:
586 scripts/clean-workdir.sh $*
588 host/.configured:
589 [ -d $(HOST_BUILD_DIR) ] || ( \
590 if [ "$(OPTWARE_TARGET)" = $(shell basename $(BASE_DIR)) ]; \
591 then mkdir -p ../host; ln -s ../host .; \
592 else mkdir -p host; \
593 fi; \
594 mkdir -p $(HOST_BUILD_DIR) $(HOST_STAGING_PREFIX); \
596 [ -e $@ ] || touch $@
598 %-target %/.configured:
599 [ -e ${DL_DIR} ] || mkdir -p ${DL_DIR}
600 [ -e $*/Makefile ] || ( \
601 mkdir -p $* ; \
602 echo "OPTWARE_TARGET=$*" > $*/Makefile ; \
603 echo "include ../Makefile" >> $*/Makefile ; \
604 ln -s ../downloads $*/downloads ; \
605 ln -s ../make $*/make ; \
606 ln -s ../scripts $*/scripts ; \
607 ln -s ../sources $*/sources ; \
609 touch $*/.configured
612 make/%.mk:
613 PKG_UP=$$(echo $* | tr [a-z\-] [A-Z_]); \
614 sed -e "s/<foo>/$*/g" -e "s/<FOO>/$${PKG_UP}/g" \
615 -e '6,11d' make/template.mk > $@