diff options
author | Raimo Niskanen <[email protected]> | 2011-11-10 10:16:18 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2011-11-15 11:57:39 +0100 |
commit | 15a0f41dd37c2147d2dd5da14eb3707fdeb22855 (patch) | |
tree | b43f4c06ac42f05dd21bea630b91cd5f4a6d8ba7 | |
parent | ff305c1a15e34f1c8d4f923a8f0e532b4e946512 (diff) | |
download | otp-15a0f41dd37c2147d2dd5da14eb3707fdeb22855.tar.gz otp-15a0f41dd37c2147d2dd5da14eb3707fdeb22855.tar.bz2 otp-15a0f41dd37c2147d2dd5da14eb3707fdeb22855.zip |
Cleanup the use of TARGET in toplevel and common make and build files
Common file target.mk now passes the TARGET value through config.sub
for canonification.
Toplevel Makefile now calls target.mk so it handles TARGET like
all sub-makefiles.
Build script otp_build no longer creates a target specific directory
that a long time ago was used for target specific configure cache file.
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | make/target.mk | 36 | ||||
-rwxr-xr-x | otp_build | 12 |
3 files changed, 39 insertions, 13 deletions
diff --git a/Makefile.in b/Makefile.in index 9ac516ca33..902c21fb52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -158,7 +158,9 @@ ERLANG_LIBDIR = $(DESTDIR)$(ERLANG_INST_LIBDIR) MAKE = @MAKE_PROG@ # This should be set to the target "arch-vendor-os" -export TARGET = @TARGET@ +TARGET := @TARGET@ +include $(ERL_TOP)/make/target.mk +export TARGET BOOTSTRAP_ONLY = @BOOTSTRAP_ONLY@ diff --git a/make/target.mk b/make/target.mk index 06e895df90..a6493e09a5 100644 --- a/make/target.mk +++ b/make/target.mk @@ -1,3 +1,24 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 1998-2011. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +# Ensure that the make variable TARGET is set +# + ifeq ($(OVERRIDE_TARGET),) ifeq ($(TARGET),) @@ -31,3 +52,18 @@ endif endif +ifneq ($(TARGET),) +ifneq ($(TARGET),win32) +ifneq ($(TARGET),vxworks) +override TARGET := $(shell $(ERL_TOP)/erts/autoconf/config.sub $(TARGET)) +else +endif +else +endif +else +endif + +ifeq ($(TARGET),) +$(error Neither TARGET nor OVERRIDE_TARGET can be determined!) +else +endif @@ -324,16 +324,6 @@ do_autoconf () fi } -mk_targetdir () -{ - if [ ! -d $ERL_TOP/$TARGET ]; then - echo "creating $ERL_TOP/$TARGET" - mkdir $ERL_TOP/$TARGET - else - echo "existing $ERL_TOP/$TARGET is used" - fi -} - run_configure () { cdir="$ERL_TOP" @@ -499,7 +489,6 @@ maybe_copy_static_cache () do_configure () { setup_make - mk_targetdir # Get `erl_build_tool_vars' . "$ERL_TOP/erl-build-tool-vars.sh" || exit 1 @@ -513,7 +502,6 @@ do_configure () hide_vars OVERRIDE_TARGET TARGET TARGET=$BUILDSYS export TARGET - mk_targetdir set_config_flags "$@" run_configure "$@" restore_vars OVERRIDE_TARGET TARGET;; |