aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2015-01-03 03:46:07 +0100
committerTharre <tharre3@gmail.com>2015-01-03 03:49:30 +0100
commit05e19981beb0ee018e71450d78592cd0bc629d81 (patch)
tree0deb4c9c1af7f4f9d66818aa25b33e346349f39f
parent74ec249cc047a5ea6ced84fb301de638f55c6e2c (diff)
downloadredo-05e19981beb0ee018e71450d78592cd0bc629d81.tar.gz
redo-05e19981beb0ee018e71450d78592cd0bc629d81.tar.xz
redo-05e19981beb0ee018e71450d78592cd0bc629d81.zip
Add support for local config files (config.local)
-rw-r--r--.gitignore2
-rwxr-xr-xbuild.sh5
-rw-r--r--out/config.sh9
3 files changed, 16 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 7fa7159..58c57e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+config.local
+
# ignore output
out/*.o
out/redo
diff --git a/build.sh b/build.sh
index 6a05260..c55c316 100755
--- a/build.sh
+++ b/build.sh
@@ -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