summaryrefslogtreecommitdiff
path: root/mkosi.build
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-07-12 19:58:53 +0200
committerLennart Poettering <lennart@poettering.net>2017-07-17 18:56:12 +0200
commit70e760e3a73bf7b39fceb6a4c3ed09d055b591b5 (patch)
tree06b0e7975ea5dd5a1f4c0cfed2a673d3b8ee373b /mkosi.build
parentc387cc49d98bcf58c881fffbd54f5eb57a8bc329 (diff)
downloadsystemd-70e760e3a73bf7b39fceb6a4c3ed09d055b591b5.tar.gz
mkosi: make use of BUILDDIR if it is set
This way, the new "mkosi.builddir" support proposed in PR: https://github.com/systemd/mkosi/pull/114 will be made use of automatically.
Diffstat (limited to 'mkosi.build')
-rwxr-xr-xmkosi.build16
1 files changed, 10 insertions, 6 deletions
diff --git a/mkosi.build b/mkosi.build
index 2231118da5..a36460c6f5 100755
--- a/mkosi.build
+++ b/mkosi.build
@@ -20,15 +20,19 @@
# This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi).
# Simply invoke "mkosi" in the project directory to build an OS image.
+# If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it
+# as out-of-tree build dir. Otherwise, let's make up our own builddir.
+[ -z "$BUILDDIR" ] && BUILDDIR=build
+
export LC_CTYPE=C.UTF-8
-meson build
-ninja -C build all
-ninja -C build test
-ninja -C build install
+test -f "$BUILDDIR"/build.ninja || meson "$BUILDDIR"
+ninja -C "$BUILDDIR" all
+ninja -C "$BUILDDIR" test
+ninja -C "$BUILDDIR" install
-mkdir -p $DESTDIR/etc
+mkdir -p "$DESTDIR"/etc
-cat > $DESTDIR/etc/issue <<EOF
+cat > "$DESTDIR"/etc/issue <<EOF
\S (built from systemd tree)
Kernel \r on an \m (\l)