diff options
author | Tharre <tharre3@gmail.com> | 2015-01-03 03:46:07 +0100 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2015-01-03 03:49:30 +0100 |
commit | 05e19981beb0ee018e71450d78592cd0bc629d81 (patch) | |
tree | 0deb4c9c1af7f4f9d66818aa25b33e346349f39f | |
parent | 74ec249cc047a5ea6ced84fb301de638f55c6e2c (diff) | |
download | redo-05e19981beb0ee018e71450d78592cd0bc629d81.tar.gz redo-05e19981beb0ee018e71450d78592cd0bc629d81.tar.xz redo-05e19981beb0ee018e71450d78592cd0bc629d81.zip |
Add support for local config files (config.local)
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | build.sh | 5 | ||||
-rw-r--r-- | out/config.sh | 9 |
3 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,5 @@ +config.local + # ignore output out/*.o out/redo @@ -1,5 +1,10 @@ #!/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 diff --git a/out/config.sh b/out/config.sh index b38fbd9..9b45b5f 100644 --- a/out/config.sh +++ b/out/config.sh @@ -6,3 +6,12 @@ fi CC=${CC-$PREF} CFLAGS="-g -Wall -Wextra -std=c99 -pedantic -Wno-gnu-statement-expression $CFLAGS" LDFLAGS="$LDFLAGS" + +if [ ! -n "$SH_BUILD" ]; then + if [ -f "../config.local" ]; then + redo-ifchange ../config.local + . ../config.local + else + redo-ifcreate ../config.local + fi +fi |