Prevent DISTRO, MAKE_TARGET and MACHINE getting into the environment.
authorJohn Bowler <jbowler@nslu2-linux.org>
Mon, 1 Aug 2005 17:49:55 +0000 (17:49 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Mon, 1 Aug 2005 17:49:55 +0000 (17:49 +0000)
common/openembedded.mk
common/setup-env

index 88a1439..c7eaa8e 100644 (file)
@@ -1,6 +1,17 @@
-# Makefile for UcSlugC
+#!/bin/make
+# Makefile for OpenEmbedded builds
 # Licensed under the GPL v2 or later
 #
+# conf/auto.conf must exist in the same directory as the Makefile (i.e.
+# the directory where Makefile is used - it may be a symbolic link to
+# this file).  conf/auto.conf defines:
+#
+# DISTRO - the OpenEmbedded 'distro' to build
+# MACHINE - the OpenEmbedded build target machine
+# MAKE_TARGET - the target to pass to bitbake
+#
+# All of these values are (should be, must be) quoted in double quotes
+include conf/auto.conf
 
 BUILD_DIRS = downloads
 REQUIRED_DIRS = bitbake openembedded
@@ -8,7 +19,7 @@ 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}
+       . ./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).
@@ -40,7 +51,7 @@ clobber:
 
 .PHONY: source
 source: $(REQUIRED_DIRS)
-       tar zcf $${DISTRO}.tar.gz --exclude=MT Makefile setup-env conf/site.conf conf/auto.conf \
+       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
@@ -54,4 +65,4 @@ distclean: clobber
 # 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
index 46151e5..a1e0d3f 100644 (file)
@@ -12,10 +12,6 @@ test -n "$TOPDIR" -a -d "$TOPDIR" || {
        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"
@@ -31,10 +27,13 @@ unset CC
 unset CXX
 unset MFLAGS
 unset MAKEFLAGS
+unset DISTRO
+unset MACHINE
+unset MAKE_TARGET
 #
 # make bb into a 'safe' bitbake
 alias bb-safe="env -i \
-       HOME='${TOPDIR}/home' \
+       HOME='${HOME}' \
        PYTHONPATH='${PYTHONPATH}' \
        BBPATH='${BBPATH}' \
        PATH='${PATH}' \