From 9ef12f76bb6f9a17de5c9e8347cb712710e7dcd4 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Fri, 5 Jun 2020 10:18:27 +0000 Subject: [PATCH] Use a private name for MAKEFLAGS in jhalfs, so that it does not propagate to top make, when ticking "Run the makefile" --- common/common-functions | 2 ++ jhalfs | 2 +- optimize/opt_config.d/noOpt | 3 --- optimize/optimize_functions | 9 ++++----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/common/common-functions b/common/common-functions index ee0c93a..020dc34 100644 --- a/common/common-functions +++ b/common/common-functions @@ -36,8 +36,10 @@ run_make() { # # Build the system if [ -e "$MKFILE" ] ; then echo -ne "Building the system...\n" + if { echo try tty; tty; }; then cd "$JHALFSDIR" && make echo -ne "done\n" + else echo there is no terminal!!; fi fi fi } diff --git a/jhalfs b/jhalfs index 2c01ac3..660729d 100755 --- a/jhalfs +++ b/jhalfs @@ -368,7 +368,7 @@ if [[ "$OPTIMIZE" != "0" ]]; then load_file optimize/opt_config 'Loading optimization config' # The number of parallel jobs is taken from configuration now # shellcheck disable=SC2034 - MAKEFLAGS="-j${N_PARALLEL}" + JH_MAKEFLAGS="-j${N_PARALLEL}" # Validate optimize settings, if required validate_opt_settings fi diff --git a/optimize/opt_config.d/noOpt b/optimize/opt_config.d/noOpt index 39abdb3..168d46f 100644 --- a/optimize/opt_config.d/noOpt +++ b/optimize/opt_config.d/noOpt @@ -9,9 +9,6 @@ # doing. By default, this is set to disable optimization # of packages known to have build or runtime failure. # -# Also, if you what to use MAKEFLAGS but no build -# optimizations, set this mode in DEF_OPT_MODE -# # Usage: - Apply optimization string to each variable # - "unset" will cause the variable to be not set # instead of being just set to null. diff --git a/optimize/optimize_functions b/optimize/optimize_functions index eeeb432..22ccde1 100644 --- a/optimize/optimize_functions +++ b/optimize/optimize_functions @@ -18,9 +18,8 @@ validate_opt_settings() { # Show optimize setting and wait user agreeme echo -e "expected, please rebuild without optimizations before" echo -e "asking for support.${OFF}\n" - echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${MAKEFLAGS}${OFF}${R_arrow}" - [[ "$MAKEFLAGS" = "unset" ]] && echo - [[ "$MAKEFLAGS" != "unset" ]] && \ + echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${JH_MAKEFLAGS}${OFF}${R_arrow}" + [ -n "$JH_MAKEFLAGS" ] && \ echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n" echo -e "DEF_OPT_MODE: ${L_arrow}${BOLD}${DEF_OPT_MODE}${OFF}${R_arrow}\n" @@ -78,13 +77,13 @@ wrt_makeflags() { # Apply MAKEFLAGS to build if [[ "$BLACK_LIST" =~ ${pkg} ]]; then MKF=unset else - MKF=$MAKEFLAGS + MKF=$JH_MAKEFLAGS fi if [[ "$MKF" != "unset" ]]; then ( cat << EOF - @echo "export MAKEFLAGS=\"$MAKEFLAGS\"" >> envars + @echo "export MAKEFLAGS=\"$JH_MAKEFLAGS\"" >> envars EOF ) >> $MKFILE.tmp fi