From cd0f59d82098ec2008c8a657542a8574721ecb94 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Sun, 31 Jul 2005 23:29:37 +0000 Subject: [PATCH] Sufficient structure to make a buildable ucslugc (only ucslugc-safe tested so far). --- common/.mtn2git_empty | 0 common/Make.rules | 57 +++++++++++++++++++++++++++++++++++++ common/conf/.mtn2git_empty | 0 common/conf/site.conf | 43 ++++++++++++++++++++++++++++ common/env | 42 +++++++++++++++++++++++++++ ucslugc/.mtn2git_empty | 0 ucslugc/Makefile | 10 +++++++ ucslugc/conf/.mtn2git_empty | 0 ucslugc/conf/auto.conf | 3 ++ 9 files changed, 155 insertions(+) create mode 100644 common/.mtn2git_empty create mode 100644 common/Make.rules create mode 100644 common/conf/.mtn2git_empty create mode 100644 common/conf/site.conf create mode 100644 common/env create mode 100644 ucslugc/.mtn2git_empty create mode 100644 ucslugc/Makefile create mode 100644 ucslugc/conf/.mtn2git_empty create mode 100644 ucslugc/conf/auto.conf diff --git a/common/.mtn2git_empty b/common/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/common/Make.rules b/common/Make.rules new file mode 100644 index 0000000000..8a5940af56 --- /dev/null +++ b/common/Make.rules @@ -0,0 +1,57 @@ +# 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 $(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 $(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/.mtn2git_empty b/common/conf/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/common/conf/site.conf b/common/conf/site.conf new file mode 100644 index 0000000000..45451253e7 --- /dev/null +++ b/common/conf/site.conf @@ -0,0 +1,43 @@ +# NSLU2 master makefile bitbake site configuration +# It should not be necessary to alter this file! +# +# This configuration defines the location of the directories +# bitbake requires to build a particular distribution (DISTRO) +# +# Each DISTRO must create a appropriate topdir file containing +# (just) the definition of TOPDIR +include topdir.conf + +# These definitions should be the same for every DISTRO - if +# a change is necessary make it in the DISTRO auto.conf. The +# rvalues are evaluated here for safety (i.e. to prevent accidents +# if something else defines TOPDIR). +TMPDIR := "${TOPDIR}/tmp" +CACHE := "${TMPDIR}/cache" +DL_DIR := "${TOPDIR}/downloads" + +# The following is not defined or used by the standard bitbake +# configuration files, however it must be defined here for 'freeze' +# and 'unfreeze' to work correctly +PKGDIR := "${TOPDIR}/openembedded" + +# BBFILES is the list of all the .bb files bitbake looks at when +# working out how to build a package. By default this value is +# overridden later in the ${DISTRO}.conf file (when it includes +# conf/distro/freeze.conf). +BBFILES := "${PKGDIR}/packages/*/*.bb" + +# The distro must create the following directories - either by +# populating them with the required files or, in the master makefile +# environment, by symbolic links to the relevant shared directories +# (which are directories of the same name in ..) +# +# common - contains conf/site.conf - this file +# bitbake - the directory containing the bitbake program +# downloads - contains the source files downloaded from the network +# openembedded - the directory containing the OE source +# +# All these directories may be shared between multiple distros. +# The 'tmp' directory may not be shared, however bitbake will create +# it automatically when required. The 'downloads' directory will also +# be created if required by bitbake. diff --git a/common/env b/common/env new file mode 100644 index 0000000000..b41e1f4bc5 --- /dev/null +++ b/common/env @@ -0,0 +1,42 @@ +# 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="env -i \ + CCACHE_DISABLE='${CCACHE_DISABLE}' \ + CCACHE_DIR='${CCACHE_DIR}' \ + PYTHONPATH='${PYTHONPATH}' \ + BBPATH='${BBPATH}' \ + PATH='${PATH}' \ + LD_LIBRARY_PATH='${LD_LIBRARY_PATH}' \ + LANG='${LANG}' \ + '${TOPDIR}/bitbake/bin/bitbake'" +# +# remove TOPDIR - not required +unset TOPDIR diff --git a/ucslugc/.mtn2git_empty b/ucslugc/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ucslugc/Makefile b/ucslugc/Makefile new file mode 100644 index 0000000000..d210721ee2 --- /dev/null +++ b/ucslugc/Makefile @@ -0,0 +1,10 @@ +# 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 diff --git a/ucslugc/conf/.mtn2git_empty b/ucslugc/conf/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ucslugc/conf/auto.conf b/ucslugc/conf/auto.conf new file mode 100644 index 0000000000..0c584f449e --- /dev/null +++ b/ucslugc/conf/auto.conf @@ -0,0 +1,3 @@ +# UcSlugC bitbake configuration +DISTRO="ucslugc" +MACHINE="nslu2" -- 2.39.5