diff options
author | Cem Keylan <cem@ckyln.com> | 2021-08-30 11:30:24 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2021-08-30 11:30:24 +0300 |
commit | c6b37618f5edb567d307a95a07da2a042bc17f02 (patch) | |
tree | 1e58bea088dbcc669ef8d58bb3bc0babad73d2c5 /extra/samurai/build | |
parent | 5b1b23a780a490317faea7f7ae2c29d649a12a8f (diff) | |
download | repository-c6b37618f5edb567d307a95a07da2a042bc17f02.tar.gz |
samurai: use ninja if available
Diffstat (limited to 'extra/samurai/build')
-rwxr-xr-x | extra/samurai/build | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/extra/samurai/build b/extra/samurai/build index 547d1464..8503932d 100755 --- a/extra/samurai/build +++ b/extra/samurai/build @@ -1,7 +1,21 @@ #!/bin/sh -e -make PREFIX=/usr LDFLAGS="$LDFLAGS -static" -make PREFIX=/usr DESTDIR="$1" install +export LDFLAGS="$LDFLAGS -static" + +# Samurai is faster than make, so we prefer using it instead if available +if cpt l -q samurai; then + cat - ninja.in <<EOF> build.ninja +destdir = $1 +cc = ${CC:-cc} +cflags = -std=c99 -Wall -Wextra -Wpedantic -Wno-unused-parameter $CFLAGS +ldflags = -static $LDFLAGS +EOF + ninja + ninja install +else + make PREFIX=/usr LDFLAGS="$LDFLAGS" + make PREFIX=/usr DESTDIR="$1" install +fi ln -s samu "$1/usr/bin/ninja" ln -s samu.1 "$1/usr/share/man/man1/ninja.1" |