diff options
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" |