diff options
author | crupest <crupest@outlook.com> | 2021-11-24 20:43:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-11-24 20:43:52 +0800 |
commit | 04cfc657115bb0f9b26b1b59fcb956fe3abb83d7 (patch) | |
tree | 78fe10fb9db60952b89e889aef056c706620322d /compile-principle-experiment/3/makefile | |
parent | d08a3a340a42bbd9616ea910fbad020d7aac212d (diff) | |
download | life-04cfc657115bb0f9b26b1b59fcb956fe3abb83d7.tar.gz life-04cfc657115bb0f9b26b1b59fcb956fe3abb83d7.tar.bz2 life-04cfc657115bb0f9b26b1b59fcb956fe3abb83d7.zip |
Add compile principle experiment 3.
Diffstat (limited to 'compile-principle-experiment/3/makefile')
-rw-r--r-- | compile-principle-experiment/3/makefile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compile-principle-experiment/3/makefile b/compile-principle-experiment/3/makefile new file mode 100644 index 0000000..cf6333c --- /dev/null +++ b/compile-principle-experiment/3/makefile @@ -0,0 +1,22 @@ +main: main.o lex.o syn.o + cc lex.o syn.o main.o -o main + +main.o: main.c main.h syn.h + cc -c -o main.o main.c + +lex.c: lex.l + flex -o lex.c lex.l + +lex.o: lex.c syn.h main.h + cc -c -o lex.o lex.c + +syn.c syn.h: syn.y + bison syn.y -d -o syn.c + +syn.o: syn.c syn.h main.h + cc -c -o syn.o syn.c + +PHONY: clean + +clean: + rm -f *.o lex.c syn.c syn.h main |