From bdbfaad29772a37cdcad61885b8ab01d0828aa68 Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Sat, 30 Jul 2005 05:07:19 +0000 Subject: Revamped the ucslugc setup process, file structure and Makefile. --- common/Make.rules | 57 ----------------------------------------------- common/conf/site.conf | 2 +- common/env | 42 ---------------------------------- common/openembedded.mk | 57 +++++++++++++++++++++++++++++++++++++++++++++++ common/setup-openembedded | 47 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+), 100 deletions(-) delete mode 100644 common/Make.rules delete mode 100644 common/env create mode 100644 common/openembedded.mk create mode 100644 common/setup-openembedded (limited to 'common') diff --git a/common/Make.rules b/common/Make.rules deleted file mode 100644 index 1a32b364ba..0000000000 --- a/common/Make.rules +++ /dev/null @@ -1,57 +0,0 @@ -# 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 -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) - -# 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 - -# 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 - -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 - -.PHONY: $(DISTRO)-source -$(DISTRO)-source: $(REQUIRED_DIRS) - tar zcf $@.tar.gz --exclude=MT Makefile 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) - -# 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/common/conf/site.conf b/common/conf/site.conf index 45451253e7..f40ae58e3d 100644 --- a/common/conf/site.conf +++ b/common/conf/site.conf @@ -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 diff --git a/common/env b/common/env deleted file mode 100644 index 9cf757aa30..0000000000 --- a/common/env +++ /dev/null @@ -1,42 +0,0 @@ -# setup up the environment for a bitbake build. This is used -# by the makefile and may also be directly sourced from an -# interactive shell. The makefile uses 'env -i' to ensure -# no variables are inherited apart from CCACHE_DISABLE and -# CCACHE_DIR -# -# topdir must exist in the directory and define TOPDIR to -# the full path name of the working directory -. ./topdir.conf -test -n "$TOPDIR" -a -d "$TOPDIR" || { - echo "environment: TOPDIR not defined" >&2 - exit 1 -} -# -# 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 PATH="${TOPDIR}/bitbake/bin:${PATH}" -export LD_LIBRARY_PATH= -export LANG=C -#NOTE: if you add export definitions here add them below too! -# -# unset the following (unnecessary for the makefile, but safe) -unset LC_CTYPE -unset CC -unset CXX -unset MFLAGS -unset MAKEFLAGS -# -# make bb into a 'safe' bitbake -alias bb-safe="env -i \ - HOME='${TOPDIR}/home' \ - PYTHONPATH='${PYTHONPATH}' \ - BBPATH='${BBPATH}' \ - PATH='${PATH}' \ - LD_LIBRARY_PATH='${LD_LIBRARY_PATH}' \ - LANG='${LANG}' \ - '${TOPDIR}/bitbake/bin/bitbake'" -alias bb="'${TOPDIR}/bitbake/bin/bitbake'" -# -# remove TOPDIR - not required -unset TOPDIR diff --git a/common/openembedded.mk b/common/openembedded.mk new file mode 100644 index 0000000000..e826f6e305 --- /dev/null +++ b/common/openembedded.mk @@ -0,0 +1,57 @@ +# Makefile for UcSlugC +# Licensed under the GPL v2 or later +# + +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-openembedded; 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 + +.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 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/common/setup-openembedded b/common/setup-openembedded new file mode 100644 index 0000000000..46151e5774 --- /dev/null +++ b/common/setup-openembedded @@ -0,0 +1,47 @@ +# setup up the environment for a bitbake build. This is used +# by the makefile and may also be directly sourced from an +# interactive shell. The makefile uses 'env -i' to ensure +# no variables are inherited apart from CCACHE_DISABLE and +# CCACHE_DIR +# +# topdir must exist in the directory and define TOPDIR to +# the full path name of the working directory +. ./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}/openembedded:${TOPDIR}/bitbake" +export PATH="${TOPDIR}/bitbake/bin:${PATH}" +export LD_LIBRARY_PATH= +export LANG=C +#NOTE: if you add export definitions here add them below too! +# +# unset the following (unnecessary for the makefile, but safe) +unset LC_CTYPE +unset CC +unset CXX +unset MFLAGS +unset MAKEFLAGS +# +# make bb into a 'safe' bitbake +alias bb-safe="env -i \ + HOME='${TOPDIR}/home' \ + PYTHONPATH='${PYTHONPATH}' \ + BBPATH='${BBPATH}' \ + PATH='${PATH}' \ + LD_LIBRARY_PATH='${LD_LIBRARY_PATH}' \ + LANG='${LANG}' \ + '${TOPDIR}/bitbake/bin/bitbake'" +alias bb="'${TOPDIR}/bitbake/bin/bitbake'" +# +# remove TOPDIR - not required +unset TOPDIR -- cgit v1.2.3