aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2d563ed
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+GOFILES := $(wildcard *.go)
+YYFILES := $(wildcard *.y)
+AUTOGEN := $(YYFILES:.y=.go)
+GO := go
+
+build: $(GOFILES) $(AUTOGEN)
+ $(GO) $@
+
+run: $(GOFILES) $(AUTOGEN)
+ $(GO) $@ $^
+
+generate:
+ $(GO) $@
+
+clean:
+ $(GO) $@
+ $(RM) $(AUTOGEN) y.output
+
+install: build
+ $(GO) $@
+
+%.go: %.y
+ $(GO) tool yacc -o $@ $<
+
+.PHONY: clean