From b39506329fbb46c5da343f20a5de7e328729da8f Mon Sep 17 00:00:00 2001 From: Tharre Date: Tue, 20 Dec 2016 13:18:59 +0100 Subject: Replace the build.sh script with bootstrap.sh --- .travis.yml | 4 +++- bootstrap.sh | 31 +++++++++++++++++++++++++++++++ build.sh | 24 ------------------------ out/config.sh | 2 +- 4 files changed, 35 insertions(+), 26 deletions(-) create mode 100755 bootstrap.sh delete mode 100755 build.sh diff --git a/.travis.yml b/.travis.yml index d4bf599..914da73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,6 @@ language: c compiler: - gcc - clang -script: ./autogen.sh && ./configure && ./build.sh && redo tests/all +script: + - export PATH="$(pwd)/out:$PATH" + - ./autogen.sh && ./configure && ./bootstrap.sh && redo tests/all diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..5bf204d --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,31 @@ +#!/bin/sh -e +# Copyright (c) 2016 Tharre +# +# This software may be modified and distributed under the terms +# of the MIT license. See the LICENSE file for details. + +( +export BOOTSTRAP_BUILD=1 + +[ -f "./config.local" ] && . ./config.local + +. out/config.sh +$CC $CFLAGS -o out/util.o -c src/util.c +$CC $CFLAGS -o out/build.o -c src/build.c +$CC $CFLAGS -o out/filepath.o -c src/filepath.c +$CC $CFLAGS -o out/sha1.o -c src/sha1.c +$CC $CFLAGS -o out/DSV.o -c src/DSV.c +$CC $CFLAGS -o out/redo.o -c src/redo.c +$CC -o out/redo out/redo.o out/util.o out/build.o out/filepath.o out/sha1.o \ + out/DSV.o $LDFLAGS +) + +ln -sf redo out/redo-ifchange +ln -sf redo out/redo-ifcreate +ln -sf redo out/redo-always + +export PATH="$(pwd)/out:$PATH" + +redo + +echo "Finished bootstrapping." diff --git a/build.sh b/build.sh deleted file mode 100755 index f1e1cf0..0000000 --- a/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -ex - -export SH_BUILD=1 - -if [ -f "./config.local" ]; then - . ./config.local -fi -. out/config.sh -$CC $CFLAGS -o out/util.o -c src/util.c -$CC $CFLAGS -o out/build.o -c src/build.c -$CC $CFLAGS -o out/filepath.o -c src/filepath.c -$CC $CFLAGS -o out/sha1.o -c src/sha1.c -$CC $CFLAGS -o out/DSV.o -c src/DSV.c -$CC $CFLAGS -o out/redo.o -c src/redo.c -$CC -o out/redo out/redo.o out/util.o out/build.o out/filepath.o out/sha1.o \ - out/DSV.o $LDFLAGS - -# TODO: just for convenience, should be removed as soon as redo can build itself -sudo install out/redo /usr/local/bin -sudo ln -sf /usr/local/bin/redo /usr/local/bin/redo-ifchange -sudo ln -sf /usr/local/bin/redo /usr/local/bin/redo-ifcreate -sudo ln -sf /usr/local/bin/redo /usr/local/bin/redo-always - -echo "Finished compiling" diff --git a/out/config.sh b/out/config.sh index 9b45b5f..4f836d6 100644 --- a/out/config.sh +++ b/out/config.sh @@ -7,7 +7,7 @@ CC=${CC-$PREF} CFLAGS="-g -Wall -Wextra -std=c99 -pedantic -Wno-gnu-statement-expression $CFLAGS" LDFLAGS="$LDFLAGS" -if [ ! -n "$SH_BUILD" ]; then +if [ ! -n "$BOOTSTRAP_BUILD" ]; then if [ -f "../config.local" ]; then redo-ifchange ../config.local . ../config.local -- cgit v1.2.3-70-g09d2