1#!/bin/bash 2 3# Version of ninja to build -- can be any git revision 4VERSION="v1.7.1" 5 6set -ev 7 8SCRIPT_HASH=$(sha1sum ${BASH_SOURCE[0]} | awk '{print $1}') 9 10cd ~ 11if [[ -d ninjabin && "$SCRIPT_HASH" == "$(cat ninjabin/script_hash)" ]]; then 12 exit 0 13fi 14 15git clone https://github.com/martine/ninja 16cd ninja 17./configure.py --bootstrap 18 19mkdir -p ../ninjabin 20rm -f ../ninjabin/ninja 21echo -n $SCRIPT_HASH >../ninjabin/script_hash 22mv ninja ../ninjabin/ 23