aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-07-14 14:36:53 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-07-14 14:36:53 -0400
commitcaecc4c8a174d136e66fafe6fa5d6b63285b2a1a (patch)
treeb3116a698c828bc4556861fa096f01a59655e6f8
parentb7d1fec244848a42f4cd1d7c62356511de48dc2b (diff)
Add makefile
-rw-r--r--makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..71ae3fc
--- /dev/null
+++ b/makefile
@@ -0,0 +1,34 @@
+CC = gcc
+FLAGS = -g
+YACC = yacc
+LEX = lex
+
+mypc: y.tab.o lex.yy.o tree.o hash.o node.o pc.o
+ $(CC) $(FLAGS) -o mypc mypc.o tree.o hash.o node.o y.tab.o lex.yy.o -lfl -ly
+
+pc.o: mypc.c pc.h
+ $(CC) $(FLAGS) -c mypc.c
+
+tree.o: tree.c tree.h
+ $(CC) $(FLAGS) -c tree.c
+
+hash.o: hash.c hash.h
+ $(CC) $(FLAGS) -c hash.c
+
+node.o: node.c node.h
+ $(CC) $(FLAGS) -c node.c
+
+y.tab.o: y.tab.c
+ $(CC) $(FLAGS) -c y.tab.c
+
+lex.yy.o: lex.yy.c
+ $(CC) $(FLAGS) -c lex.yy.c
+
+y.tab.c: pc.y
+ $(YACC) -y -dv pc.y
+
+lex.yy.c: pc.l
+ $(LEX) -l pc.l
+
+clean:
+ rm -f mypc *.o y.tab.* lex.yy.*