star-sf

Set of surface and volume scattering functions
git clone git://git.meso-star.fr/star-sf.git
Log | Files | Refs | README | LICENSE

commit 4bd447c28eb09db1db0a32b4c9fc9291e9abae55
parent b8bd92ebab26b7bbc6d93af293969676fa3f5386
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  9 Oct 2023 21:20:02 +0200

Make the make.sh script independent of the make utility

This was true, except for the config_simd function, which relies on the
make command to obtain the values of macros defined in the config.mk
file. The value of the MAKE Makefile macro must be used, even in the
shell script. To this end, we have passed its value as an argument to
the config_simd function, which can then use the correct make command.

Until this correction, the build process failed when using the NetBSD
bmake command with the -j option.

Diffstat:
MMakefile | 2+-
Mmake.sh | 11++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile @@ -80,7 +80,7 @@ $(LIBNAME_STATIC): $(OBJ) @echo "config done" > $@ .simd: make.sh config.mk - @$(SHELL) make.sh config_simd > $@ + @$(SHELL) make.sh config_simd $(MAKE) > $@ .SUFFIXES: .c .d .o .c.d: diff --git a/make.sh b/make.sh @@ -21,14 +21,15 @@ # Print the value of a variable in config.mk showvar() { + make="$1" # To avoid messages from Make being displayed instead of the value of the # queried variable, we redirect its output to /dev/null and open a new file # descriptor to stdout to print the variable -<< EOF make -f 3>&1 1>/dev/null 2>&1 - || kill -HUP $$ +<< EOF "${make}" -f 3>&1 1>/dev/null 2>&1 - || kill -HUP $$ .POSIX: include config.mk showvar: - @1>&3 echo \$(${1}) + @1>&3 echo \$($2) EOF exec 3<&- # Close file descriptor 3 } @@ -44,8 +45,9 @@ check_cpuflag() ################################################################################ config_simd() { - simd_width="$(showvar SIMD_WIDTH)" - pkg_config="$(showvar PKG_CONFIG)" + make="$1" + simd_width="$(showvar "${make}" SIMD_WIDTH)" + pkg_config="$(showvar "${make}" PKG_CONFIG)" avx="$(check_cpuflag avx)" if [ -z "${simd_width}" ]; then if ! ${pkg_config} --exists rsimd; then @@ -83,7 +85,6 @@ check() fi } - run_test() { for i in "$@"; do