summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-20 21:59:28 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-20 21:59:28 +0100
commit5eeb355805e0d5d91981dbe7eacb078f41da0437 (patch)
treed4d2a76e7988cf63aa9438d2b42d0a4a4656ee42 /Makefile
init commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2dc8a02
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+LEX = flex
+YACC = bison
+CC = gcc -g
+CFLAGS = -DYYDEBUG=1
+LIBS = -lreadline -lfl -lm
+
+lisp: lisp.c lisp.tab.o lex.yy.o
+ $(CC) $(CFLAGS) -o $@ lisp.c lisp.tab.o lex.yy.o $(LIBS)
+
+lisp.tab.c lisp.tab.h: lisp.y
+ $(YACC) -d lisp.y
+
+lex.yy.c: lisp.l lisp.tab.h
+ $(LEX) --header-file=lex.yy.h lisp.l
+
+lisp.tab.o: lisp.tab.c
+ $(CC) $(CFLAGS) -c lisp.tab.c
+
+lex.yy.o: lex.yy.c
+ $(CC) $(CFLAGS) -c lex.yy.c
+
+clean:
+ rm -f *.o lisp lisp.tab.c lisp.tab.h lex.yy.c lex.yy.h
+
+.PHONY: clean