aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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..0972555
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+.POSIX:
+
+MAKEFLAGS = -j8
+
+CFLAGS = -O3 -march=native -mtune=native -pipe -Wall -Wextra -Wpedantic
+
+target = pinocchio
+objs = src/lexer.o src/main.o src/parser.o
+
+all: $(target)
+$(target): $(objs)
+ $(CC) $(CFLAGS) -o $@ $(objs)
+
+src/lexer.o: src/lexer.c src/lexer.h src/parser.h
+src/main.o: src/main.c src/lexer.h src/parser.h src/pinocchio.h
+src/parser.o: src/parser.c src/lexer.h src/parser.h src/pinocchio.h
+
+src/lexer.c src/lexer.h: src/lexer.l
+ flex --header-file=src/lexer.h -o src/lexer.c $<
+
+src/parser.c src/parser.h: src/parser.y
+ bison -dvo src/parser.c $<
+
+clean:
+ rm -f $$(git ls-files -oi --exclude-standard)