]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: make use of BUILDDIR if it is set 6349/head
authorLennart Poettering <lennart@poettering.net>
Wed, 12 Jul 2017 17:58:53 +0000 (19:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Jul 2017 16:56:12 +0000 (18:56 +0200)
This way, the new "mkosi.builddir" support proposed in PR:

https://github.com/systemd/mkosi/pull/114

will be made use of automatically.

.gitignore
mkosi.build

index cd289d65380b115bbb2bfea69dba931f9d6950ef..aa20b8060220f63c320926222bcfd4e6685d7fbe 100644 (file)
@@ -49,6 +49,8 @@
 /localectl
 /loginctl
 /machinectl
+/mkosi.builddir/
+/mkosi.cache/
 /mtd_probe
 /networkctl
 /scsi_id
index 2231118da5f489b80a0de59ef58c7b226b70db6a..a36460c6f5aec3d288430b8967201e686a0b2472 100755 (executable)
 # 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)