aboutsummaryrefslogtreecommitdiffstats
path: root/chapter8/ninja.sh
blob: e778780e51049a795054ce67fe5d5f0642731269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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