aboutsummaryrefslogtreecommitdiffstats
path: root/chapter8/ninja.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-12 12:49:29 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-12 12:49:29 -0500
commit99659c30e5369c3f02e286a4a6ec6fecd77f0416 (patch)
tree12110b15571365acae602ebd9c1348463a0d4710 /chapter8/ninja.sh
parent0e5288f8f3bee7276d561cde029ed492e2ea85e6 (diff)
parent13c6afd35cab1e3f4d96857d549e02cfd1e23acd (diff)
Merge branch 'chapter8'
Diffstat (limited to 'chapter8/ninja.sh')
-rw-r--r--chapter8/ninja.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/chapter8/ninja.sh b/chapter8/ninja.sh
new file mode 100644
index 0000000..744dffc
--- /dev/null
+++ b/chapter8/ninja.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+export NINJAJOBS=4
+
+# shellcheck disable=SC1004
+sed -i '/int Guess/a \
+ int j = 0;\
+ char* jobs = getenv( "NINJAJOBS" );\
+ if ( jobs != NULL ) j = atoi( jobs );\
+ if ( j > 0 ) return j;\
+' src/ninja.cc
+
+python3 configure.py --bootstrap
+
+install -vm755 ninja /usr/bin/
+install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
+install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja