aboutsummaryrefslogtreecommitdiffstats
path: root/out
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2014-04-08 09:19:33 +0200
committerxRamses <tharre3@gmail.com>2014-04-08 09:19:33 +0200
commitc766f073e60c3aa51a3cc1555af87ded5823e5a0 (patch)
tree43595070e833b251b3f7ac7e94e5e992918194ef /out
downloadredo-c766f073e60c3aa51a3cc1555af87ded5823e5a0.tar.gz
redo-c766f073e60c3aa51a3cc1555af87ded5823e5a0.tar.xz
redo-c766f073e60c3aa51a3cc1555af87ded5823e5a0.zip
Initial codebase
Diffstat (limited to 'out')
-rw-r--r--out/CC.do12
-rw-r--r--out/config.sh8
-rw-r--r--out/default.o.do2
-rw-r--r--out/redo-ifchange.do5
-rw-r--r--out/redo.do5
5 files changed, 32 insertions, 0 deletions
diff --git a/out/CC.do b/out/CC.do
new file mode 100644
index 0000000..f18177a
--- /dev/null
+++ b/out/CC.do
@@ -0,0 +1,12 @@
+redo-ifchange config.sh
+. ./config.sh
+
+exec >$3
+cat <<-EOF
+ redo-ifchange \$SRCDIR/\$2.c
+ $CC $CFLAGS -MD -MF \$3.deps -o \$3 -c \$SRCDIR/\$2.c
+ read DEPS <\$3.deps
+ rm -f \$3.deps
+ redo-ifchange \${DEPS#*:}
+EOF
+chmod +x $3
diff --git a/out/config.sh b/out/config.sh
new file mode 100644
index 0000000..7a1f34c
--- /dev/null
+++ b/out/config.sh
@@ -0,0 +1,8 @@
+if type "clang" > /dev/null; then
+ PREF="clang"
+else
+ PREF="gcc"
+fi
+CC=${CC-$PREF}
+CFLAGS="-g -Wall -Wextra -std=c99 -pedantic"
+LDFLAGS=-lcrypto
diff --git a/out/default.o.do b/out/default.o.do
new file mode 100644
index 0000000..d48bdd1
--- /dev/null
+++ b/out/default.o.do
@@ -0,0 +1,2 @@
+redo-ifchange CC
+. ./CC "$@"
diff --git a/out/redo-ifchange.do b/out/redo-ifchange.do
new file mode 100644
index 0000000..84941ce
--- /dev/null
+++ b/out/redo-ifchange.do
@@ -0,0 +1,5 @@
+. ./config.sh
+
+DEPS="redo-ifchange.o build.o util.o"
+redo-ifchange $DEPS config.sh
+$CC -o $3 $DEPS $LDFLAGS
diff --git a/out/redo.do b/out/redo.do
new file mode 100644
index 0000000..dce65d4
--- /dev/null
+++ b/out/redo.do
@@ -0,0 +1,5 @@
+. ./config.sh
+
+DEPS="redo.o build.o util.o"
+redo-ifchange $DEPS config.sh
+$CC -o $3 $DEPS $LDFLAGS