aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.*