summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rwxr-xr-xwatch.sh14
3 files changed, 16 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index d7756c2..68e2fb3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
a.out
*.o
+out.pdf
diff --git a/Makefile b/Makefile
index 1130156..6e6b8c9 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ debug: ${EXE}
${GDB} -ex start --args ./${EXE} ${RUNARGS}
clean:
- rm -fv ${EXE} ${OBJ}
+ rm -fv ${EXE} ${OBJ} out.pdf
${EXE}: ${OBJ}
${CC} ${LDFLAGS} ${OBJ} -o ${EXE} ${LDLIBS}
diff --git a/watch.sh b/watch.sh
new file mode 100755
index 0000000..896473d
--- /dev/null
+++ b/watch.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+gen() {
+ tcc ir.c lex.c impl.c peephole.c proc.c -run main.c test.lang\
+ | dot -Tpdf -o out.pdf
+}
+
+gen
+mupdf out.pdf &
+while true; do
+ inotifywait -e modify -r .
+ gen
+ killall -SIGHUP mupdf
+done