Skip to content

Commit

Permalink
test_target_script.sh: Use the value of $MAKE if available
Browse files Browse the repository at this point in the history
... instead of always using the hard-coded `make` command name.

[Why]
This is useful if GNU make is installed under another name (e.g.
`gmake`).

[How]
The correct name is passed through the `$MAKE` environment variable by
the parent make instance: use it.

The script defaults to `make` if the variable is unset.
  • Loading branch information
dumbbell committed Dec 9, 2024
1 parent b4a72b0 commit 6463837
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions make/test_target_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ EOM

release_erlang () {
local RELEASE_ROOT="${1}"
if ! (cd $ERL_TOP && make release TYPE= release_docs DOC_TARGETS=chunks RELEASE_ROOT="${RELEASE_ROOT}"); then
if ! (cd $ERL_TOP && ${MAKE:-make} release TYPE= release_docs DOC_TARGETS=chunks RELEASE_ROOT="${RELEASE_ROOT}"); then
return 1
fi
if ! (cd "$RELEASE_ROOT" && ./Install -minimal "`pwd`"); then
return 1
fi
## Need to release both TYPE= and TYPE=$TYPE for tests to work
if [ "$TYPE" != "" ]; then
if ! (cd $ERL_TOP && make release TYPE=$TYPE RELEASE_ROOT="${RELEASE_ROOT}"); then
if ! (cd $ERL_TOP && ${MAKE:-make} release TYPE=$TYPE RELEASE_ROOT="${RELEASE_ROOT}"); then
return 1
fi
fi
Expand Down Expand Up @@ -214,7 +214,7 @@ EOF
release_erlang "${RELEASE_ROOT}" > "${RELEASE_LOG}" 2>&1
if [ $? != 0 ]
then
print_highlighted_msg $RED "\"make release RELEASE_ROOT=${RELEASE_ROOT}\" failed.\nSee ${RELEASE_LOG} for full logs"
print_highlighted_msg $RED "\"${MAKE:-make} release RELEASE_ROOT=${RELEASE_ROOT}\" failed.\nSee ${RELEASE_LOG} for full logs"
tail -30 "${RELEASE_LOG}"
exit 1
fi
Expand All @@ -231,12 +231,12 @@ then
fi
fi

make RELEASE_PATH=$MAKE_TEST_DIR release_tests_spec > $RELEASE_TEST_SPEC_LOG 2>&1
${MAKE:-make} RELEASE_PATH=$MAKE_TEST_DIR release_tests_spec > $RELEASE_TEST_SPEC_LOG 2>&1

if [ $? != 0 ]
then
cat $RELEASE_TEST_SPEC_LOG
print_highlighted_msg $RED "\"make RELEASE_PATH="$MAKE_TEST_DIR" release_tests_spec\" failed."
print_highlighted_msg $RED "\"${MAKE:-make} RELEASE_PATH="$MAKE_TEST_DIR" release_tests_spec\" failed."
exit 1
fi
if [ -z "${ARGS}" ]
Expand Down Expand Up @@ -271,11 +271,11 @@ fi
# Compile test server and configure
if [ ! -f "$ERL_TOP/lib/common_test/test_server/variables" ]; then
cd "$ERL_TOP/lib/common_test/test_server"
( make && erl -noshell -eval "ts:install()." -s init stop ) > "$INSTALL_TEST_LOG" 2>&1
( ${MAKE:-make} && erl -noshell -eval "ts:install()." -s init stop ) > "$INSTALL_TEST_LOG" 2>&1
if [ $? != 0 ]
then
cat "$INSTALL_TEST_LOG"
print_highlighted_msg $RED "\"make && erl -eval 'ts:install()'\" in common_test/test_server failed."
print_highlighted_msg $RED "\"${MAKE:-make} && erl -eval 'ts:install()'\" in common_test/test_server failed."
exit 1
fi
fi
Expand Down

0 comments on commit 6463837

Please sign in to comment.