Allow compilation in an other directory on unix, keeping the source tree

clean, by setting the BUILD_WORK environment variable.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1333 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2004-02-27 14:09:13 +00:00
parent 164e5f3798
commit 2990805c14
9 changed files with 60 additions and 34 deletions
+7 -3
View File
@@ -350,11 +350,15 @@ EOF
# source, and the filename without .in as target.
# If a filename doesn't end on .in, that filename is used
# as target, and the filename with .in attached as source.
# $3 - A path to which the input file names are relative
# $4 - A path to which the output file names are relative
substitute_vars() {
local VARS VAR VALUE FILES FILE
local VARS VAR VALUE FILES FILE SRC_PATH DST_PATH
eval VARS=\"\$$1\"
eval FILES=\"\$$2\"
SRC_PATH="$3"
DST_PATH="$4"
for VAR in $VARS; do
# Escape all / in VAR so that we can use / as seperator char for sed
@@ -367,9 +371,9 @@ EOF
for FILE in $FILES; do
FILE="${FILE%.in}"
cp -p -- "$FILE".in "$FILE"
cp -p -- "$SRC_PATH/$FILE".in "$DST_PATH/$FILE"
# The copy is done so that the file modes are equal.
$SED -f "${TEMPFILE}.sed" < "$FILE".in > "$FILE"
$SED -f "${TEMPFILE}.sed" < "$SRC_PATH/$FILE".in > "$DST_PATH/$FILE"
done
rm -- "${TEMPFILE}.sed"
}