Use a private name for MAKEFLAGS in jhalfs, so that it does not propagate

to top make, when ticking "Run the makefile"
This commit is contained in:
Pierre Labastie 2020-06-05 10:18:27 +00:00
parent 7e0a1b8018
commit 9ef12f76bb
4 changed files with 7 additions and 9 deletions

View file

@ -36,8 +36,10 @@ run_make() { #
# Build the system # Build the system
if [ -e "$MKFILE" ] ; then if [ -e "$MKFILE" ] ; then
echo -ne "Building the system...\n" echo -ne "Building the system...\n"
if { echo try tty; tty; }; then
cd "$JHALFSDIR" && make cd "$JHALFSDIR" && make
echo -ne "done\n" echo -ne "done\n"
else echo there is no terminal!!; fi
fi fi
fi fi
} }

2
jhalfs
View file

@ -368,7 +368,7 @@ if [[ "$OPTIMIZE" != "0" ]]; then
load_file optimize/opt_config 'Loading optimization config' load_file optimize/opt_config 'Loading optimization config'
# The number of parallel jobs is taken from configuration now # The number of parallel jobs is taken from configuration now
# shellcheck disable=SC2034 # shellcheck disable=SC2034
MAKEFLAGS="-j${N_PARALLEL}" JH_MAKEFLAGS="-j${N_PARALLEL}"
# Validate optimize settings, if required # Validate optimize settings, if required
validate_opt_settings validate_opt_settings
fi fi

View file

@ -9,9 +9,6 @@
# doing. By default, this is set to disable optimization # doing. By default, this is set to disable optimization
# of packages known to have build or runtime failure. # 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 # Usage: - Apply optimization string to each variable
# - "unset" will cause the variable to be not set # - "unset" will cause the variable to be not set
# instead of being just set to null. # instead of being just set to null.

View file

@ -18,9 +18,8 @@ validate_opt_settings() { # Show optimize setting and wait user agreeme
echo -e "expected, please rebuild without optimizations before" echo -e "expected, please rebuild without optimizations before"
echo -e "asking for support.${OFF}\n" echo -e "asking for support.${OFF}\n"
echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${MAKEFLAGS}${OFF}${R_arrow}" echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${JH_MAKEFLAGS}${OFF}${R_arrow}"
[[ "$MAKEFLAGS" = "unset" ]] && echo [ -n "$JH_MAKEFLAGS" ] && \
[[ "$MAKEFLAGS" != "unset" ]] && \
echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n" 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" 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 if [[ "$BLACK_LIST" =~ ${pkg} ]]; then
MKF=unset MKF=unset
else else
MKF=$MAKEFLAGS MKF=$JH_MAKEFLAGS
fi fi
if [[ "$MKF" != "unset" ]]; then if [[ "$MKF" != "unset" ]]; then
( (
cat << EOF cat << EOF
@echo "export MAKEFLAGS=\"$MAKEFLAGS\"" >> envars @echo "export MAKEFLAGS=\"$JH_MAKEFLAGS\"" >> envars
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
fi fi