summaryrefslogtreecommitdiff
path: root/mk/lexyacc.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/lexyacc.mk')
-rw-r--r--mk/lexyacc.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/mk/lexyacc.mk b/mk/lexyacc.mk
new file mode 100644
index 0000000..8d104f6
--- /dev/null
+++ b/mk/lexyacc.mk
@@ -0,0 +1,9 @@
+NECFLAGS = $(subst -Werror,,$(subst -Wall,,$(CFLAGS)))
+
+%.o: %.y .deps
+ yacc -d -o$*.c $<
+ $(CC) -c $(NECFLAGS) $*.c
+
+%.o: %.l .deps
+ flex -o$*.c $<
+ $(CC) -c $(NECFLAGS) $*.c