Migrated unslung and openslug to the new setup - type 'make setup-unslung setup-opens...
authorRod Whitby <rod@whitby.id.au>
Sat, 30 Jul 2005 05:27:45 +0000 (05:27 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Sat, 30 Jul 2005 05:27:45 +0000 (05:27 +0000)
.mtn-ignore [deleted file]
Makefile
openslug/.mt-ignore [deleted file]
openslug/Makefile
unslung/.mt-ignore [deleted file]
unslung/Makefile
unslung/conf/.mt-ignore [deleted file]

diff --git a/.mtn-ignore b/.mtn-ignore
deleted file mode 100644 (file)
index 170b9c1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-bitbake
-downloads
-monotone
-oe-symlinks
-openembedded
-optware
-
index 700ca40..d60927e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ setup-monotone monotone/nslu2-linux.db:
 downloads:
        [ -e $@ ] || mkdir -p $@
 
-unslung/Makefile openslug/Makefile common/openembedded.mk common/setup-env MT/revision:
+MT/revision:
        ${MAKE} downloads
        [ -e monotone/nslu2-linux.db ] || ( ${MAKE} monotone/nslu2-linux.db )
        [ -e MT/revision ] || ( monotone -d monotone/nslu2-linux.db co -b org.nslu2-linux.dev . )
@@ -84,25 +84,62 @@ setup-openembedded openembedded/conf/machine/nslu2.conf:
        ${MAKE} MT/revision
        [ -e openembedded/conf/machine/nslu2.conf ] || monotone co -b org.openembedded.nslu2-linux openembedded
 
+.PHONY: setup-unslung
+setup-unslung unslung/Makefile:
+       ${MAKE} MT/revision downloads
+       [ -d unslung ]                   || ( mkdir -p unslung )
+       [ ! -f unslung/Makefile ]        || ( cd unslung ; mv Makefile Makefile.delete-me)
+       [ -e unslung/Makefile ]          || ( cd unslung ; ln -s ../common/openembedded.mk Makefile )
+       [ ! -f unslung/setup-env ]       || ( cd unslung ; mv setup-env setup-env.delete-me )
+       [ -e unslung/setup-env ]         || ( cd unslung ; ln -s ../common/setup-env . )
+       [ -e unslung/downloads ]         || ( cd unslung ; ln -s ../downloads . )
+       [ -e unslung/bitbake ]           || ( cd unslung ; ln -s ../bitbake . )
+       [ -e unslung/openembedded ]      || ( cd unslung ; ln -s ../openembedded . )
+       [ -d unslung/conf ]              || ( mkdir -p unslung/conf )
+       [ ! -f unslung/conf/local.conf ] || ( cd unslung/conf ; mv local.conf local.conf.delete-me )
+       [ -e unslung/conf/site.conf ]    || ( cd unslung/conf ; ln -s ../../common/conf/site.conf . )
+       rm -rf unslung/tmp/cache
+
+.PHONY: setup-openslug
+setup-openslug openslug/Makefile:
+       ${MAKE} MT/revision downloads
+       [ -d openslug ]                   || ( mkdir -p openslug )
+       [ ! -f openslug/Makefile ]        || ( cd openslug ; mv Makefile Makefile.delete-me)
+       [ -e openslug/Makefile ]          || ( cd openslug ; ln -s ../common/openembedded.mk Makefile )
+       [ ! -f openslug/setup-env ]       || ( cd openslug ; mv setup-env setup-env.delete-me )
+       [ -e openslug/setup-env ]         || ( cd openslug ; ln -s ../common/setup-env . )
+       [ -e openslug/downloads ]         || ( cd openslug ; ln -s ../downloads . )
+       [ -e openslug/bitbake ]           || ( cd openslug ; ln -s ../bitbake . )
+       [ -e openslug/openembedded ]      || ( cd openslug ; ln -s ../openembedded . )
+       [ -d openslug/conf ]              || ( mkdir -p openslug/conf )
+       [ ! -f openslug/conf/local.conf ] || ( cd openslug/conf ; mv local.conf local.conf.delete-me )
+       [ -e openslug/conf/site.conf ]    || ( cd openslug/conf ; ln -s ../../common/conf/site.conf . )
+       rm -rf openslug/tmp/cache
+
+.PHONY: setup-ucslugc
+setup-ucslugc ucslugc/Makefile:
+       ${MAKE} MT/revision downloads
+       [ -d ucslugc ]                   || ( mkdir -p ucslugc )
+       [ ! -f ucslugc/Makefile ]        || ( cd ucslugc ; mv Makefile Makefile.delete-me)
+       [ -e ucslugc/Makefile ]          || ( cd ucslugc ; ln -s ../common/openembedded.mk Makefile )
+       [ ! -f ucslugc/setup-env ]       || ( cd ucslugc ; mv setup-env setup-env.delete-me )
+       [ -e ucslugc/setup-env ]         || ( cd ucslugc ; ln -s ../common/setup-env . )
+       [ -e ucslugc/downloads ]         || ( cd ucslugc ; ln -s ../downloads . )
+       [ -e ucslugc/bitbake ]           || ( cd ucslugc ; ln -s ../bitbake . )
+       [ -e ucslugc/openembedded ]      || ( cd ucslugc ; ln -s ../openembedded . )
+       [ -d ucslugc/conf ]              || ( mkdir -p ucslugc/conf )
+       [ ! -f ucslugc/conf/local.conf ] || ( cd ucslugc/conf ; mv local.conf local.conf.delete-me )
+       [ -e ucslugc/conf/site.conf ]    || ( cd ucslugc/conf ; ln -s ../../common/conf/site.conf . )
+       rm -rf ucslugc/tmp/cache
+
 .PHONY: setup-openslug-2.3-beta
-setup-openslug-2.3-beta releases/OpenSlug-2.3-beta/Makefile: downloads
+setup-openslug-2.3-beta releases/OpenSlug-2.3-beta/Makefile:
+       ${MAKE} downloads
        [ ! -e releases/OpenSlug-2.3-beta ] || mkdir -p releases
        svn checkout svn://svn.berlios.de/openslug/releases/OpenSlug-2.3-beta releases/OpenSlug-2.3-beta
        cd releases/OpenSlug-2.3-beta && ${MAKE} conf/local.conf setup-env
        ln -s ../../downloads releases/OpenSlug-2.3-beta/
 
-.PHONY: setup-ucslugc
-setup-ucslugc ucslugc/Makefile:
-       ${MAKE} MT/revision
-       [ -d ucslugc ]                || ( mkdir -p ucslugc )
-       [ -e ucslugc/Makefile ]       || ( cd ucslugc ; ln -s ../common/openembedded.mk Makefile )
-       [ -e ucslugc/setup-env ]      || ( cd ucslugc ; ln -s ../common/setup-env . )
-       [ -e ucslugc/downloads ]      || ( cd ucslugc ; ln -s ../downloads . )
-       [ -e ucslugc/bitbake ]        || ( cd ucslugc ; ln -s ../bitbake . )
-       [ -e ucslugc/openembedded ]   || ( cd ucslugc ; ln -s ../openembedded . )
-       [ -d ucslugc/conf ]           || ( mkdir -p ucslugc/conf )
-       [ -e ucslugc/conf/site.conf ] || ( cd ucslugc/conf ; ln -s ../../common/conf/site.conf . )
-
 .PHONY: setup-optware
 setup-optware optware/Makefile:
        ${MAKE} downloads
diff --git a/openslug/.mt-ignore b/openslug/.mt-ignore
deleted file mode 100644 (file)
index dd5df82..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-downloads
-openslug-source.tar.gz
-setup-env
-tmp
index 657ed27..88a1439 100644 (file)
@@ -1,49 +1,57 @@
-# Makefile for OpenSlug
+# Makefile for UcSlugC
 # Licensed under the GPL v2 or later
+#
 
-openslug-firmware: setup-env conf/local.conf
-       . ./setup-env ; bitbake openslug-packages
-
-# This does the same thing but with a clean environment
-# The HOME setting prevents user environment settings
-# from changing the build.  CCACHE_DIR is necessary to
-# prevent ccache (if installed) attempting to use a
-# .cache in the home directory.
-openslug-firmware-safe: setup-env conf/local.conf
-       env -i CCACHE_DISABLE=1 CCACHE_DIR="`pwd`/tmp/ccache" HOME=/dev/null \
-               sh -c '. ./setup-env; bitbake openslug-packages'
-
-setup-env:
-       [ -e bitbake ]      || ln -s ../bitbake .
-       [ -e downloads ]    || ln -s ../downloads .
-       [ -e openembedded ] || ln -s ../openembedded .
-       echo 'OEROOT='`pwd` > setup-env
-       echo 'OESYS=$$OEROOT/bitbake/' >> setup-env
-       echo 'OEBUILD=$$OEROOT' >> setup-env
-       echo 'PKGDIR=$$OEROOT/openembedded/' >> setup-env
-       echo 'export PYTHONPATH=$$OESYS/lib' >>setup-env
-       echo 'export BBPATH=$$OEBUILD:$$PKGDIR:$$OESYS' >> setup-env
-       echo 'export PATH=$$OESYS/bin/:$$PATH' >> setup-env
-       echo 'export LD_LIBRARY_PATH=' >> setup-env
-       echo 'export LANG=C' >> setup-env
-       echo 'unset LC_CTYPE' >> setup-env
-       echo 'unset CC' >> setup-env
-       echo 'unset CXX' >> setup-env
-       echo 'unset MFLAGS' >> setup-env
-       echo 'unset MAKEFLAGS' >> setup-env
-       echo 'alias bb=bitbake' >> setup-env
-       echo 'echo Environment set up for OpenSlug development.' >> setup-env
-
-conf/local.conf:
-       sed -e "s|%%%OEROOT%%%|`pwd`|" conf/local.conf.template > conf/local.conf
+BUILD_DIRS = downloads
+REQUIRED_DIRS = bitbake openembedded
+FIRMWARE_DEPS = create-topdir $(BUILD_DIRS) $(REQUIRED_DIRS)
 
+# The default rule is to build the firmware in an unprotected environment.
+firmware: $(FIRMWARE_DEPS)
+       . ./setup-env; exec bitbake $${MAKE_TARGET}
+
+# This rule clobbers the environment (note that ccache uses '$HOME' by
+# default, so the cache will end up there).
+firmware-safe:
+       env -i HOME="$${HOME}" PATH="$${PATH}" $(MAKE) firmware
+
+# topdir.conf is re-created automatically if the directory is
+# moved - this will cause a full bitbake reparse
+.PHONY: create-topdir
+create-topdir: conf/topdir.conf
+       . conf/topdir.conf && test "`pwd`" = "$$TOPDIR" || echo "TOPDIR='`pwd`'" > conf/topdir.conf
+
+conf/topdir.conf:
+       echo "TOPDIR='`pwd`'" >$@
+
+# rules for directories - if a symlink exists and the target does not
+# exist something will go wrong in the build, therefore cause a failure
+# here by the mkdir.
+$(BUILD_DIRS):
+       test -d $@ || if test -d ../$@; then ln -s ../$@ .; else mkdir $@; fi
+
+# these directories must already exist - either in TOPDIR (here) or in ..
+$(REQUIRED_DIRS):
+       test -d $@ || if test -d ../$@; then ln -s ../$@ .; else exit 1; fi
+
+.PHONY: clobber
 clobber:
        rm -rf tmp
 
-openslug-source:
-       tar zcf openslug-source.tar.gz --exclude=MT Makefile bitbake conf openembedded
+.PHONY: source
+source: $(REQUIRED_DIRS)
+       tar zcf $${DISTRO}.tar.gz --exclude=MT Makefile setup-env conf/site.conf conf/auto.conf \
+               conf/local.conf.sample $(REQUIRED_DIRS:=/.)
 
+# This target probably isn't important any longer, because the -source
+# target above does the right thing
+.PHONY:
 distclean: clobber
-       rm -rf setup-env conf/local.conf bitbake downloads openembedded
-
-# End of Makefile
+       rm -rf conf/topdir.conf conf/local.conf $(BUILD_DIRS)
+
+# This target is mainly for testing - it is intended to put the disto directory
+# back to its original state, it will destroy a source-tarball system (because
+# it removes directories from the tarball).
+.PHONY:
+really-clean: distclean
+       rm -rf $(REQUIRED_DIRS) $${DISTRO}-source.tar.gz
diff --git a/unslung/.mt-ignore b/unslung/.mt-ignore
deleted file mode 100644 (file)
index 2cf465f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-downloads
-unslung-source.tar.gz
-setup-env
-tmp
index 7016538..88a1439 100644 (file)
@@ -1,49 +1,57 @@
-# Makefile for Unslung
+# Makefile for UcSlugC
 # Licensed under the GPL v2 or later
+#
 
-unslung-firmware: setup-env conf/local.conf
-       . ./setup-env ; bitbake unslung-packages
-
-# This does the same thing but with a clean environment
-# The HOME setting prevents user environment settings
-# from changing the build.  CCACHE_DIR is necessary to
-# prevent ccache (if installed) attempting to use a
-# .cache in the home directory.
-unslung-firmware-safe: setup-env conf/local.conf
-       env -i CCACHE_DISABLE=1 CCACHE_DIR="`pwd`/tmp/ccache" HOME=/dev/null \
-               sh -c '. ./setup-env; bitbake unslung-packages'
-
-setup-env:
-       [ -e bitbake ]      || ln -s ../bitbake .
-       [ -e downloads ]    || ln -s ../downloads .
-       [ -e openembedded ] || ln -s ../openembedded .
-       echo 'OEROOT='`pwd` > setup-env
-       echo 'OESYS=$$OEROOT/bitbake/' >> setup-env
-       echo 'OEBUILD=$$OEROOT' >> setup-env
-       echo 'PKGDIR=$$OEROOT/openembedded/' >> setup-env
-       echo 'export PYTHONPATH=$$OESYS/lib' >>setup-env
-       echo 'export BBPATH=$$OEBUILD:$$PKGDIR:$$OESYS' >> setup-env
-       echo 'export PATH=$$OESYS/bin/:$$PATH' >> setup-env
-       echo 'export LD_LIBRARY_PATH=' >> setup-env
-       echo 'export LANG=C' >> setup-env
-       echo 'unset LC_CTYPE' >> setup-env
-       echo 'unset CC' >> setup-env
-       echo 'unset CXX' >> setup-env
-       echo 'unset MFLAGS' >> setup-env
-       echo 'unset MAKEFLAGS' >> setup-env
-       echo 'alias bb=bitbake' >> setup-env
-       echo 'echo Environment set up for Unslung development.' >> setup-env
-
-conf/local.conf:
-       sed -e "s|%%%OEROOT%%%|`pwd`|" conf/local.conf.template > conf/local.conf
+BUILD_DIRS = downloads
+REQUIRED_DIRS = bitbake openembedded
+FIRMWARE_DEPS = create-topdir $(BUILD_DIRS) $(REQUIRED_DIRS)
 
+# The default rule is to build the firmware in an unprotected environment.
+firmware: $(FIRMWARE_DEPS)
+       . ./setup-env; exec bitbake $${MAKE_TARGET}
+
+# This rule clobbers the environment (note that ccache uses '$HOME' by
+# default, so the cache will end up there).
+firmware-safe:
+       env -i HOME="$${HOME}" PATH="$${PATH}" $(MAKE) firmware
+
+# topdir.conf is re-created automatically if the directory is
+# moved - this will cause a full bitbake reparse
+.PHONY: create-topdir
+create-topdir: conf/topdir.conf
+       . conf/topdir.conf && test "`pwd`" = "$$TOPDIR" || echo "TOPDIR='`pwd`'" > conf/topdir.conf
+
+conf/topdir.conf:
+       echo "TOPDIR='`pwd`'" >$@
+
+# rules for directories - if a symlink exists and the target does not
+# exist something will go wrong in the build, therefore cause a failure
+# here by the mkdir.
+$(BUILD_DIRS):
+       test -d $@ || if test -d ../$@; then ln -s ../$@ .; else mkdir $@; fi
+
+# these directories must already exist - either in TOPDIR (here) or in ..
+$(REQUIRED_DIRS):
+       test -d $@ || if test -d ../$@; then ln -s ../$@ .; else exit 1; fi
+
+.PHONY: clobber
 clobber:
        rm -rf tmp
 
-unslung-source:
-       tar zcf unslung-source.tar.gz --exclude=MT Makefile bitbake conf openembedded
+.PHONY: source
+source: $(REQUIRED_DIRS)
+       tar zcf $${DISTRO}.tar.gz --exclude=MT Makefile setup-env conf/site.conf conf/auto.conf \
+               conf/local.conf.sample $(REQUIRED_DIRS:=/.)
 
+# This target probably isn't important any longer, because the -source
+# target above does the right thing
+.PHONY:
 distclean: clobber
-       rm -f setup-env conf/local.conf bitbake downloads openembedded
-
-# End of Makefile
+       rm -rf conf/topdir.conf conf/local.conf $(BUILD_DIRS)
+
+# This target is mainly for testing - it is intended to put the disto directory
+# back to its original state, it will destroy a source-tarball system (because
+# it removes directories from the tarball).
+.PHONY:
+really-clean: distclean
+       rm -rf $(REQUIRED_DIRS) $${DISTRO}-source.tar.gz
diff --git a/unslung/conf/.mt-ignore b/unslung/conf/.mt-ignore
deleted file mode 100644 (file)
index f21e1b2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-local.conf