aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-04 01:37:29 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-04 01:37:29 +0200
commit60493a315417e996238f24f4375ecef945898fea (patch)
treed0ea371e8130cbcebf24e090bfd27d3178eb7616 /Makefile
Genesis commit
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)