]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script: have run-make.sh honor BUILD_DIR like do_cmake.sh does
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 6 Oct 2022 17:43:41 +0000 (13:43 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 18 Feb 2025 22:58:08 +0000 (17:58 -0500)
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 <jmulligan@redhat.com>
(cherry picked from commit 974effaa95ddbc9816a37e382a96e691f4e3cbdd)

src/script/run-make.sh

index c746cf752b7e8fe0acddd21ee021d4bf26329431..d2ccf1fbf4d54701ac4301cd5542032758999951 100755 (executable)
@@ -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