1 # Makefile for the NSLU2 Linux development system
2 # Licensed under the GPL v2 or later
4 HOST_MACHINE
:=$(shell uname
-m | sed \
5 -e
's/i[3-9]86/i386/' \
7 -e
's/armv5teb/armeb/' \
15 prefetch
: prefetch-unslung prefetch-slugos prefetch-angstrom prefetch-optware
19 [ ! -e unslung
] ||
${MAKE} unslung
20 [ ! -e slugos
] ||
${MAKE} slugosbe slugosle
21 [ ! -e optware
] ||
${MAKE} optware
22 [ ! -e openwrt
] ||
${MAKE} openwrt
23 [ ! -e angstrom
] ||
${MAKE} angstrombe angstromle
26 ifneq ($(HOST_MACHINE
),armeb
)
27 setup
: setup-common setup-kernel setup-bitbake setup-openembedded setup-unslung \
28 setup-slugos setup-angstrom setup-optware setup-openwrt
30 setup
: setup-common setup-optware
33 .PHONY
: setup-developer
34 setup-developer
: setup-common setup-bitbake setup-openembedded setup-optware-developer setup-openwrt-developer
37 ifneq ($(HOST_MACHINE
),armeb
)
38 update
: update-common update-kernel update-bitbake update-openembedded update-optware update-openwrt
40 update
: update-common update-optware
44 status
: status-common status-kernel status-bitbake status-openembedded status-optware status-openwrt
47 clobber: clobber-unslung clobber-slugos clobber-angstrom \
48 clobber-optware clobber-openwrt
51 distclean: distclean-common distclean-bitbake distclean-openembedded \
52 distclean-unslung distclean-slugos distclean-angstrom \
53 distclean-optware distclean-releases distclean-openwrt
55 .PHONY
: prefetch-optware
58 for f in optware
/platforms
/packages-
*.mk
; do \
59 export target
=`echo $$f | sed -e 's|optware/platforms/packages-\(.*\)\.mk|\1|'` ; \
60 [ ! -e optware
/$$target ] || make prefetch-optware-
$$target ; \
63 .PHONY
: prefetch-optware-
%
64 prefetch-optware-
%: optware
/%/.configured
65 ( cd optware
/$* ; ${MAKE} source
)
67 .PHONY
: prefetch-unslung-
%-beta
68 prefetch-unslung-
%-beta
: releases
/unslung-
%-beta
/.configured
69 ( cd releases
/unslung-
$*-beta
; ${MAKE} prefetch
)
72 prefetch-
%: %/.configured bitbake
/.git
/config openembedded
/.git
/config
73 ( cd
$* ; ${MAKE} prefetch
)
75 .PHONY
: unslung unslung-image
76 unslung unslung-image
: unslung
/.configured bitbake
/.git
/config openembedded
/.git
/config
78 ${MAKE} setup-machine-nslu2be setup-distro-unslung setup-image-unslung-image
; \
81 .PHONY
: slugosbe slugosbe-image
82 slugosbe slugosbe-image
: slugos
/.configured bitbake
/.git
/config openembedded
/.git
/config
84 ${MAKE} setup-machine-nslu2be setup-distro-slugos setup-image-slugos-image
; \
87 .PHONY
: slugosle slugosle-image
88 slugosle slugosle-image
: slugos
/.configured bitbake
/.git
/config openembedded
/.git
/config
90 ${MAKE} setup-machine-nslu2le setup-distro-slugos setup-image-slugos-image
; \
93 .PHONY
: angstrombe angstrombe-image
94 angstrombe angstrombe-image
: angstrom
/.configured bitbake
/.git
/config openembedded
/.git
/config
96 ${MAKE} setup-machine-ixp4xxbe setup-distro-angstrom-2008.1 setup-image-base-image
; \
99 .PHONY
: angstromle angstromle-image
100 angstromle angstromle-image
: angstrom
/.configured bitbake
/.git
/config openembedded
/.git
/config
102 ${MAKE} setup-machine-ixp4xxle setup-distro-angstrom-2008.1 setup-image-base-image
; \
105 .PHONY
: openwrt openwrt-image
106 openwrt openwrt-image
: openwrt
/.configured
107 ( cd openwrt
; ${MAKE} -k world
)
109 .PHONY
: unslung-packages
110 unslung-packages
: unslung
/.configured bitbake
/.git
/config openembedded
/.git
/config
112 ${MAKE} setup-machine-nslu2be setup-distro-unslung setup-image-unslung-image setup-packages-unslung-packages
; \
115 .PHONY
: slugosbe-packages
116 slugosbe-packages
: slugos
/.configured bitbake
/.git
/config openembedded
/.git
/config
118 ${MAKE} setup-machine-nslu2be setup-distro-slugos setup-image-slugos-image setup-packages-slugos-packages
; \
121 .PHONY
: slugosle-packages
122 slugosle-packages
: slugos
/.configured bitbake
/.git
/config openembedded
/.git
/config
124 ${MAKE} setup-machine-nslu2le setup-distro-slugos setup-image-slugos-image setup-packages-slugos-packages
; \
127 .PHONY
: angstrombe-packages
128 angstrombe-packages
: angstrom
/.configured bitbake
/.git
/config openembedded
/.git
/config
130 ${MAKE} setup-machine-ixp4xxbe setup-distro-angstrom-2008.1 setup-image-base-image setup-packages-meta-angstrom
; \
133 .PHONY
: angstrombe-packages
134 angstromle-packages
: angstrom
/.configured bitbake
/.git
/config openembedded
/.git
/config
136 ${MAKE} setup-machine-ixp4xxle setup-distro-angstrom-2008.1 setup-image-base-image setup-packages-meta-angstrom
; \
139 .PHONY
: openwrt-packages
140 openwrt-packages
: openwrt
/.configured
141 ( cd openwrt
; ${MAKE} -k world
)
144 %-packages
: %/.configured bitbake
/.git
/config openembedded
/.git
/config
145 ( cd
$* ; ${MAKE} -k distro
)
147 .PHONY
: openwrt-index
148 openwrt-index
: openwrt
/.configured
149 ( cd openwrt
; ${MAKE} -k package
/index
)
152 %-index
: %/.configured bitbake
/.git
/config openembedded
/.git
/config
153 ( cd
$* ; ${MAKE} -k index
)
157 [ ! -e optware
] || \
158 for f in optware
/platforms
/packages-
*.mk
; do \
159 export target
=`echo $$f | sed -e 's|optware/platforms/packages-\(.*\)\.mk|\1|'` ; \
160 [ ! -e optware
/$$target ] || make optware-
$$target ; \
164 optware-
%: optware
/%/.configured
165 ( cd optware
/$* ; ${MAKE} autoclean
; ${MAKE} -k
)
167 slugosle-
%-beta
: update-slugos-
%-beta build-slugosle-
%-beta
170 slugosbe-
%-beta
: update-slugos-
%-beta build-slugosbe-
%-beta
173 unslung-
%-beta
: update-unslung-
%-beta build-unslung-
%-beta
176 openwrt-
%: update-openwrt-
% build-openwrt-
%
179 # The following two targets are deprecated,
180 # but are preserved for building old releases.
182 debianslug-
%-beta
: update-slugos-
%-beta build-debianslug-
%-beta
185 openslug-
%-beta
: update-slugos-
%-beta build-openslug-
%-beta
188 build-slugosle-
%-beta
: releases
/slugos-
%-beta
/.configured
189 ( cd releases
/slugos-
$*-beta
; ${MAKE} -k slugosle-distro
)
191 build-slugosbe-
%-beta
: releases
/slugos-
%-beta
/.configured
192 ( cd releases
/slugos-
$*-beta
; ${MAKE} -k slugosbe-distro
)
194 build-unslung-
%-beta
: releases
/unslung-
%-beta
/.configured
195 ( cd releases
/unslung-
$*-beta
; ${MAKE} -k unslung-distro
)
197 build-openwrt-
%: releases
/openwrt-
%/.configured
198 ( cd releases
/openwrt-
$* ; ${MAKE} -k world package
/index
)
200 # The following two targets are deprecated,
201 # but are preserved for building old releases.
203 build-debianslug-
%-beta
: releases
/slugos-
%-beta
/.configured
204 ( cd releases
/slugos-
$*-beta
; ${MAKE} -k debianslug-distro
)
206 build-openslug-
%-beta
: releases
/slugos-
%-beta
/.configured
207 ( cd releases
/slugos-
$*-beta
; ${MAKE} -k openslug-distro
)
209 OE_SNAPSHOT_SITE
:= http
://www.openembedded.org
/snapshots
212 .PRECIOUS
: common
/.git
/config
213 setup-common common
/.git
/config
:
214 [ -e common
/.git
/config
] || \
215 ( git clone git
://repo.or.cz
/nslu2-linux
/master.git common
&& \
217 ln
-s common
/Makefile Makefile
)
218 touch common
/.git
/config
221 .PRECIOUS
: kernel
/.git
/config
222 setup-kernel kernel
/.git
/config
:
223 [ -e downloads
] ||
( mkdir
-p downloads
)
224 [ -e kernel
/.git
/config
] || \
225 git clone git
://repo.or.cz
/nslu2-linux
/kernel.git
226 [ -e kernel
/downloads
] ||
( ln
-s ..
/downloads kernel
/downloads
)
227 touch kernel
/.git
/config
229 .PHONY
: setup-bitbake
230 .PRECIOUS
: bitbake
/.git
/config
231 setup-bitbake bitbake
/.git
/config
: common
/.git
/config
232 [ -e bitbake
/.git
/config
] || \
233 git clone git
://git.openmoko.org
/git
/bitbake.git bitbake
234 touch bitbake
/.git
/config
236 .PHONY
: setup-openembedded
237 .PRECIOUS
: openembedded
/.git
/config
238 setup-openembedded openembedded
/.git
/config
: common
/.git
/config
239 [ -e openembedded
/.git
/config
] || \
240 git clone git
://git.openembedded.net
/org.openembedded.dev openembedded
241 touch openembedded
/.git
/config
243 .PHONY
: setup-openwrt
244 .PRECIOUS
: openwrt
/.configured
245 setup-openwrt openwrt
/.configured
: common
/.git
/config
246 [ -e downloads
] ||
( mkdir
-p downloads
)
247 [ -e openwrt
/Makefile
] || \
248 ( svn
co https
://svn.openwrt.org
/openwrt
/trunk openwrt
)
249 [ -e openwrt
/dl
] ||
( ln
-s ..
/downloads openwrt
/dl
)
250 [ -e openwrt
/.config
] ||
( cp common
/conf
/openwrt.config openwrt
/.config
)
252 .
/scripts
/feeds update
; \
253 .
/scripts
/feeds
install -a
; \
255 touch openwrt
/.configured
257 .PHONY
: setup-optware
258 .PRECIOUS
: optware
/.git
/config
259 setup-optware optware
/.git
/config
:
260 [ -e optware
/.git
/config
] || \
261 git clone git
://repo.or.cz
/nslu2-linux
/optware.git
262 touch optware
/.git
/config
264 # This pattern rule has to come before the subsequent %/.configured openembedded pattern rule.
265 .PRECIOUS
: optware
/%/.configured
266 optware
/%/.configured
: optware
/.configured
267 [ -e downloads
] ||
( mkdir
-p downloads
)
268 [ -e optware
/$*/Makefile
] ||
( \
269 mkdir
-p optware
/$* ; \
270 echo
"OPTWARE_TARGET=$*" > optware
/$*/Makefile
; \
271 echo
"include ../Makefile" >> optware
/$*/Makefile
; \
272 ln
-s ..
/..
/downloads optware
/$*/downloads
; \
273 ln
-s ..
/make optware
/$*/make
; \
274 ln
-s ..
/scripts optware
/$*/scripts
; \
275 ln
-s ..
/sources optware
/$*/sources
; \
277 touch optware
/$*/.configured
279 .PHONY
: setup-openwrt-developer
280 setup-openwrt-developer
:
281 [ ! -e openwrt
] ||
( mv openwrt openwrt-user
)
282 svn
co https
://${LOGNAME}@svn.openwrt.org
/openwrt
/trunk openwrt
283 ${MAKE} setup-openwrt
285 .PHONY
: setup-unslung setup-slugos setup-angstrom
286 setup-unslung setup-slugos setup-angstrom
: \
287 setup-
%: common
/.git
/config
288 rm -rf
$*/.configured
289 ${MAKE} $*/.configured
291 # This pattern rule has to come before the subsequent %/.configured openembedded pattern rule.
292 .PHONY
: setup-slugos-
%-beta
293 .PRECIOUS
: releases
/slugos-
%-beta
/.configured
294 setup-slugos-
%-beta releases
/slugos-
%-beta
/.configured
: common
/.git
/config
295 [ -e releases
/slugos-
$*-beta
] ||
( \
296 mkdir
-p releases
; \
297 svn checkout http
://svn.nslu2-linux.org
/svnroot
/slugos
/releases
/slugos-
$*-beta \
298 releases
/slugos-
$*-beta \
300 ( cd releases
/slugos-
$*-beta
; ${MAKE} setup-env
)
301 [ -e downloads
] ||
( mkdir
-p downloads
)
302 [ -e releases
/slugos-
$*-beta
/downloads
] || \
303 ln
-s ..
/..
/downloads releases
/slugos-
$*-beta
/
304 touch releases
/slugos-
$*-beta
/.configured
306 # This pattern rule has to come before the subsequent %/.configured openembedded pattern rule.
307 .PHONY
: setup-unslung-
%-beta
308 .PRECIOUS
: releases
/unslung-
%-beta
/.configured
309 setup-unslung-
%-beta releases
/unslung-
%-beta
/.configured
: common
/.git
/config
310 [ -e releases
/unslung-
$*-beta
] ||
( \
311 mkdir
-p releases
; \
312 svn checkout http
://svn.nslu2-linux.org
/svnroot
/unslung
/releases
/unslung-
$*-beta \
313 releases
/unslung-
$*-beta \
315 ( cd releases
/unslung-
$*-beta
; ${MAKE} setup-env
)
316 [ -e downloads
] ||
( mkdir
-p downloads
)
317 [ -e releases
/unslung-
$*-beta
/downloads
] || \
318 ln
-s ..
/..
/downloads releases
/unslung-
$*-beta
/
319 touch releases
/unslung-
$*-beta
/.configured
321 # This pattern rule has to come before the subsequent %/.configured openembedded pattern rule.
322 .PHONY
: setup-openwrt-
%
323 .PRECIOUS
: releases
/openwrt-
%/.configured
324 setup-openwrt-
% releases
/openwrt-
%/.configured
:
325 [ -e downloads
] ||
( mkdir
-p downloads
)
326 [ -e releases
/openwrt-
$* ] ||
( \
327 mkdir
-p releases
; \
328 svn checkout https
://svn.openwrt.org
/openwrt
/tags/$* \
329 releases
/openwrt-
$* \
331 [ -e releases
/openwrt-
$*/dl
] || ln
-s ..
/..
/downloads releases
/openwrt-
$*/dl
332 [ -e releases
/openwrt-
$*/.config
] || \
333 ( cp common
/conf
/openwrt-
$*.config releases
/openwrt-
$*/.config
)
334 touch releases
/openwrt-
$*/.configured
336 .PHONY
: setup-slugos-
%-beta-developer
337 setup-slugos-
%-beta-developer
:
338 [ -e releases
/slugos-
$*-beta
] ||
( \
339 mkdir
-p releases
; \
340 svn checkout https
://svn.nslu2-linux.org
/svnroot
/slugos
/releases
/slugos-
$*-beta \
341 releases
/slugos-
$*-beta \
343 ${MAKE} setup-slugos-
$*-beta
345 .PHONY
: setup-unslung-
%-beta-developer
346 setup-unslung-
%-beta-developer
:
347 [ -e releases
/unslung-
$*-beta
] ||
( \
348 mkdir
-p releases
; \
349 svn checkout https
://svn.nslu2-linux.org
/svnroot
/unslung
/releases
/unslung-
$*-beta \
350 releases
/unslung-
$*-beta \
352 ${MAKE} setup-unslung-
$*-beta
354 .PRECIOUS
: %/.configured
355 %/.configured
: common
/.git
/config
356 [ -d
$* ] ||
( mkdir
-p
$* )
357 [ -e downloads
] ||
( mkdir
-p downloads
)
358 [ -e
$*/Makefile
] ||
( cd
$* ; ln
-sf ..
/common
/openembedded.mk Makefile
)
359 [ -e
$*/setup-env
] ||
( cd
$* ; ln
-sf ..
/common
/setup-env .
)
360 [ -e
$*/downloads
] ||
( cd
$* ; ln
-sf ..
/downloads .
)
361 [ -e
$*/bitbake
] ||
( cd
$* ; ln
-sf ..
/bitbake .
)
362 [ -e
$*/openembedded
] ||
( cd
$* ; ln
-sf ..
/openembedded .
)
363 [ -d
$*/conf
] ||
( mkdir
-p
$*/conf
)
364 [ -e
$*/conf
/local.conf.sample
] || \
365 ( cd
$*/conf
; ln
-sf ..
/..
/common
/conf
/local.conf.sample .
)
366 [ -e
$*/conf
/site.conf
] ||
( cd
$*/conf
; ln
-sf ..
/..
/common
/conf
/site.conf .
)
367 [ -e
$*/conf
/auto.conf
] ||
( \
368 if
[ "$*" = "angstrom" ] ; then \
369 echo
"DISTRO=\"$*-2008.1\"" > $*/conf
/auto.conf
; \
370 echo
"MACHINE=\"ixp4xxbe\"" >> $*/conf
/auto.conf
; \
371 echo
"IMAGE_TARGET = \"base-image\"" >> $*/conf
/auto.conf
; \
372 echo
"DISTRO_TARGET = \"meta-angstrom\"" >> $*/conf
/auto.conf
; \
373 echo
"ENABLE_BINARY_LOCALE_GENERATION = \"0\"" >> $*/conf
/auto.conf
; \
375 echo
"DISTRO=\"$*\"" > $*/conf
/auto.conf
; \
376 echo
"MACHINE=\"nslu2be\"" >> $*/conf
/auto.conf
; \
377 echo
"IMAGE_TARGET=\"$*-image\"" >> $*/conf
/auto.conf
; \
378 echo
"DISTRO_TARGET=\"$*-packages\"" >> $*/conf
/auto.conf
; \
381 [ -e
$*/conf
/local.conf
] ||
( cd
$*/conf
; touch local.conf
)
385 .PHONY
: setup-host-debian
389 autoconf automake automake1.9 \
396 g++ gawk gcj gettext gfortran git \
397 libc6-dev libglib2.0-dev libtool \
399 patch pkg-config python python-dev python-psyco python2.4 python2.4-dev \
401 sed sharutils subversion \
406 .PHONY
: setup-host-ubuntu
408 sudo apt-get
install \
409 autoconf automake automake1.9 \
412 devio diffstat docbook \
415 gcc gcc-3.3 g
++ gawk gcj gettext gfortran git git-core groff-base \
419 libc6-dev libglib2.0
-dev libncurses5-dev libssl-dev libtool \
423 patch pkg-config python python-dev python2.4 python2.4
-dev \
426 sdcc sed sharutils subversion sun-java5-jdk sysutils \
427 tcl8.4 texinfo texi2html \
431 @echo
"To get python2.4-psyco (Recommended to speed up builds), please read"
432 @echo
"http://ubuntuguide.org/#extrarepositories"
433 @echo
"NOTE: python2.4-psyco will not work on 64-bit archs"
436 .PHONY
: setup-host-gentoo
460 .PHONY
: setup-host-centos
481 sudo rpm
-ivh http
://www.python.org
/pyvault
/centos-4-i386
/help2man-1.29
-1.noarch.rpm
483 .PHONY
: update-common
485 ( cd common
; git pull
)
487 .PHONY
: update-bitbake
488 update-bitbake
: bitbake
/.git
/config
489 ( cd bitbake
; git pull
)
491 .PHONY
: update-openembedded
492 update-openembedded
: openembedded
/.git
/config
493 ( cd openembedded
; git pull
)
495 .PHONY
: update-optware
496 update-optware
: optware
/.git
/config
497 ( cd optware
; git pull
)
499 .PHONY
: update-kernel
500 update-kernel
: kernel
/.git
/config
501 ( cd kernel
; git pull
)
503 .PHONY
: update-openwrt
504 update-openwrt
: openwrt
/.configured
505 ( cd openwrt
; svn update
; .
/scripts
/feeds update
)
507 update-slugos-
%-beta
: releases
/slugos-
%-beta
/.configured
508 ( cd releases
/slugos-
$*-beta
; svn update
)
510 update-unslung-
%-beta
: releases
/unslung-
%-beta
/.configured
511 ( cd releases
/unslung-
$*-beta
; svn update
)
513 update-openwrt-
%: releases
/openwrt-
%/.configured
514 ( cd releases
/openwrt-
$* ; svn update
)
516 .PHONY
: check-makefile
518 ( wget
-q
-O
- http
://www.nslu2-linux.org
/Makefile | diff
-u Makefile
- )
520 .PHONY
: status-common
521 status-common
: common
/.git
/config
522 ( cd common
; git diff
--stat
)
524 .PHONY
: status-bitbake
525 status-bitbake
: bitbake
/.git
/config
526 ( cd bitbake
; git diff
--stat
)
528 .PHONY
: status-kernel
529 status-kernel
: kernel
/.git
/config
530 ( cd kernel
; git diff
--stat
)
532 .PHONY
: status-openembedded
533 status-openembedded
: openembedded
/.git
/config
534 ( cd openembedded
; git diff
--stat
)
536 .PHONY
: status-optware
537 status-optware
: optware
/.git
/config
538 ( cd optware
; git diff
--stat
)
540 .PHONY
: status-openwrt
541 status-openwrt
: openwrt
/.configured
542 ( cd openwrt
; svn status
)
544 status-slugosbe-
%-beta
:
545 ( cd releases
/slugosbe-
$*-beta
; svn status
)
547 status-unslung-
%-beta
:
548 ( cd releases
/unslung-
$*-beta
; svn status
)
550 .PHONY
: clobber-unslung
552 [ ! -e unslung
/Makefile
] ||
( cd unslung
; ${MAKE} clobber )
554 .PHONY
: clobber-slugos
556 [ ! -e slugos
/Makefile
] ||
( cd slugos
; ${MAKE} clobber )
558 .PHONY
: clobber-angstrom
560 [ ! -e angstrom
/Makefile
] ||
( cd angstrom
; ${MAKE} clobber )
562 .PHONY
: clobber-openwrt
564 [ ! -e openwrt
/Makefile
] ||
( cd openwrt
; ${MAKE} clean )
566 .PHONY
: clobber-optware
568 [ ! -e optware
] || \
569 for f in optware
/platforms
/packages-
*.mk
; do \
570 export target
=`echo $$f | sed -e 's|optware/platforms/packages-\(.*\)\.mk|\1|'` ; \
571 [ ! -e optware
/$$target ] || make clobber-optware-
$$target ; \
574 .PHONY
: clobber-optware-
%
576 [ ! -e optware
/$*/Makefile
] ||
( cd optware
/$* ; ${MAKE} distclean )
578 .PHONY
: distclean-common
582 .PHONY
: distclean-kernel
586 .PHONY
: distclean-bitbake
590 .PHONY
: distclean-openembedded
591 distclean-openembedded
:
594 .PHONY
: distclean-unslung
598 .PHONY
: distclean-slugos
602 .PHONY
: distclean-angstrom
606 .PHONY
: distclean-openwrt
610 .PHONY
: distclean-optware
614 .PHONY
: distclean-releases
619 distclean: distclean-common distclean-kernel distclean-bitbake distclean-openembedded distclean-openwrt \
620 distclean-unslung distclean-slugos distclean-angstrom distclean-optware \
624 # Targets for use by those with write access to the repositories
627 push
: push-common push-optware push-kernel
630 push-common
: update-common
631 ( cd common
; git push
--all ssh
://repo.or.cz
/srv
/git
/nslu2-linux
/master.git
)
633 .PHONY
: import-optware
634 import-optware
: optware
/.git
/config
635 ( cd optware
; git svn rebase
-A AUTHORS
)
638 push-optware
: import-optware
639 ( cd optware
; git push
--all ssh
://repo.or.cz
/srv
/git
/nslu2-linux
/optware.git
)
641 .PHONY
: import-kernel
642 import-kernel
: kernel
/.git
/config
643 ( cd kernel
; git svn rebase
-A AUTHORS
)
646 push-kernel
: import-kernel
647 ( cd kernel
; git push
--all ssh
://repo.or.cz
/srv
/git
/nslu2-linux
/kernel.git
)