Revamped the ucslugc setup process, file structure and Makefile.
authorRod Whitby <rod@whitby.id.au>
Sat, 30 Jul 2005 05:07:19 +0000 (05:07 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Sat, 30 Jul 2005 05:07:19 +0000 (05:07 +0000)
Makefile
common/conf/site.conf
common/openembedded.mk [moved from common/Make.rules with 65% similarity]
common/setup-openembedded [moved from common/env with 89% similarity]
ucslugc/Makefile [deleted file]
ucslugc/conf/auto.conf
ucslugc/setup-env [deleted file]

index 169bbd6..6e36e75 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,13 +64,13 @@ setup-monotone monotone/nslu2-linux.db:
 downloads:
        [ -e $@ ] || mkdir -p $@
 
-unslung/Makefile openslug/Makefile ucslugc/Makefile common/Make.rules MT/revision:
+unslung/Makefile openslug/Makefile common/openembedded.mk common/setup-openembedded 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 . )
 
 .PHONY: setup-master
-setup-master: setup-monotone unslung/Makefile openslug/Makefile
+setup-master: setup-monotone unslung/Makefile openslug/Makefile ucslugc/Makefile
        [ -e unslung/downloads ]  || ( cd unslung  ; ln -s ../downloads . )
        [ -e openslug/downloads ] || ( cd openslug ; ln -s ../downloads . )
 
@@ -84,11 +84,6 @@ 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-optware
-setup-optware optware/Makefile:
-       ${MAKE} downloads
-       [ -e optware/Makefile ] || ( cvs -q -d :pserver:anonymous@cvs.sf.net:/cvsroot/nslu co -d optware unslung )
-
 .PHONY: setup-openslug-2.3-beta
 setup-openslug-2.3-beta releases/OpenSlug-2.3-beta/Makefile: downloads
        [ ! -e releases/OpenSlug-2.3-beta ] || mkdir -p releases
@@ -96,6 +91,23 @@ setup-openslug-2.3-beta releases/OpenSlug-2.3-beta/Makefile: downloads
        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-openembedded ] || ( cd ucslugc ; ln -s ../common/setup-openembedded . )
+       [ -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
+       [ -e optware/Makefile ] || ( cvs -q -d :pserver:anonymous@cvs.sf.net:/cvsroot/nslu co -d optware unslung )
+
 optware/nslu2/Makefile:
        ${MAKE} optware/Makefile
        [ -e optware/nslu2/Makefile ]  || ( \
index 4545125..f40ae58 100644 (file)
@@ -6,7 +6,7 @@
 #
 # Each DISTRO must create a appropriate topdir file containing
 # (just) the definition of TOPDIR
-include topdir.conf
+include conf/topdir.conf
 
 # These definitions should be the same for every DISTRO - if
 # a change is necessary make it in the DISTRO auto.conf.  The
similarity index 65%
rename from common/Make.rules
rename to common/openembedded.mk
index 1a32b36..e826f6e 100644 (file)
@@ -1,28 +1,27 @@
 # Makefile for UcSlugC
 # Licensed under the GPL v2 or later
 #
-# Define DISTRO and TARGET before including this in Makefile
 
-BUILD_DIRS = downloads home
-REQUIRED_DIRS = bitbake openembedded common
+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.
-$(DISTRO)-firmware: $(FIRMWARE_DEPS)
-       . common/env; exec bitbake $(TARGET)
+firmware: $(FIRMWARE_DEPS)
+       . ./setup-openembedded; exec bitbake $${MAKE_TARGET}
 
 # This rule clobbers the environment (note that ccache uses '$HOME' by
 # default, so the cache will end up there).
-$(DISTRO)-safe:
-       env -i HOME="`pwd`/home" PATH="$${PATH}" $(MAKE) $(DISTRO)-firmware
+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: topdir.conf
-       . topdir.conf && test "`pwd`" = "$$TOPDIR" || echo "TOPDIR='`pwd`'" >topdir.conf
+create-topdir: conf/topdir.conf
+       . conf/topdir.conf && test "`pwd`" = "$$TOPDIR" || echo "TOPDIR='`pwd`'" > conf/topdir.conf
 
-topdir.conf:
+conf/topdir.conf:
        echo "TOPDIR='`pwd`'" >$@
 
 # rules for directories - if a symlink exists and the target does not
@@ -39,19 +38,20 @@ $(REQUIRED_DIRS):
 clobber:
        rm -rf tmp
 
-.PHONY: $(DISTRO)-source
-$(DISTRO)-source: $(REQUIRED_DIRS)
-       tar zcf $@.tar.gz --exclude=MT Makefile conf/auto.conf conf/local.conf.sample $(REQUIRED_DIRS:=/.)
+.PHONY: source
+source: $(REQUIRED_DIRS)
+       tar zcf $${DISTRO}.tar.gz --exclude=MT Makefile setup-openembedded 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 topdir.conf conf/local.conf common/conf/local.conf $(BUILD_DIRS)
+       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
+       rm -rf $(REQUIRED_DIRS) $${DISTRO}-source.tar.gz
similarity index 89%
rename from common/env
rename to common/setup-openembedded
index 9cf757a..46151e5 100644 (file)
@@ -6,15 +6,20 @@
 #
 # topdir must exist in the directory and define TOPDIR to
 # the full path name of the working directory
-. ./topdir.conf
+. ./conf/topdir.conf
 test -n "$TOPDIR" -a -d "$TOPDIR" || {
        echo "environment: TOPDIR not defined" >&2
        exit 1
 }
+
+. ./conf/auto.conf
+export DISTRO
+export MAKE_TARGET
+
 #
 # the following must match the definitions in common/conf/site.conf
 export PYTHONPATH="${TOPDIR}/bitbake/lib"
-export BBPATH="${TOPDIR}:${TOPDIR}/common:${TOPDIR}/openembedded:${TOPDIR}/bitbake"
+export BBPATH="${TOPDIR}:${TOPDIR}/openembedded:${TOPDIR}/bitbake"
 export PATH="${TOPDIR}/bitbake/bin:${PATH}"
 export LD_LIBRARY_PATH=
 export LANG=C
diff --git a/ucslugc/Makefile b/ucslugc/Makefile
deleted file mode 100644 (file)
index fdaab6f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Makefile for UcSlugC
-# Licensed under the GPL v2 or later
-DISTRO=ucslugc
-TARGET=openslug-packages
-
-include common/Make.rules
-
-# The following is required for bootstrapping
-common/Make.rules:
-       $(MAKE) -f ../common/Make.rules common
index 0c584f4..b6a4399 100644 (file)
@@ -1,3 +1,4 @@
 # UcSlugC bitbake configuration
 DISTRO="ucslugc"
 MACHINE="nslu2"
+MAKE_TARGET="openslug-packages"
\ No newline at end of file
diff --git a/ucslugc/setup-env b/ucslugc/setup-env
deleted file mode 100644 (file)
index 56f39fb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# set up an environment for building UcSlugC
-# (it is sufficient to source common/env to do this, this
-# script, which should be sourced, exists to mirror the old
-# method).
-test -d common || {
-       test -d ../common && ln -s ../common ./common
-}
-if test -r common/env
-then
-       . common/env
-       echo 'Environment set up for UcSlugC development.'
-else
-       echo "setup-env: 'common/env' script not found" >&2
-fi