From: John Mulligan Date: Thu, 6 Oct 2022 17:43:41 +0000 (-0400) Subject: script: have run-make.sh honor BUILD_DIR like do_cmake.sh does X-Git-Tag: v18.2.5~81^2~15 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3425674847f7e8500a5dadf6e2e55c9c1866197a;p=ceph.git script: have run-make.sh honor BUILD_DIR like do_cmake.sh does The BUILD_DIR environment variable is honored by do_cmake.sh in order to create multiple build output directories. Before this change run-make.sh did not support BUILD_DIR the same way as do_cmake.sh. This change makes it possible to use BUILD_DIR with run-make.sh. Signed-off-by: John Mulligan (cherry picked from commit 974effaa95ddbc9816a37e382a96e691f4e3cbdd) --- diff --git a/src/script/run-make.sh b/src/script/run-make.sh index c746cf752b7e8..d2ccf1fbf4d54 100755 --- a/src/script/run-make.sh +++ b/src/script/run-make.sh @@ -195,7 +195,11 @@ function build() { if test -n "$targets"; then targets="--target $targets" fi - $DRY_RUN cd build + local bdir=build + if [ "$BUILD_DIR" ]; then + bdir="$BUILD_DIR" + fi + $DRY_RUN cd "${bdir}" BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS} test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS" # older cmake does not support --parallel or -j, so pass it to underlying generator