From caecc4c8a174d136e66fafe6fa5d6b63285b2a1a Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 14 Jul 2019 14:36:53 -0400 Subject: Add makefile --- makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 makefile 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.* -- cgit v1.1