aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-03-22 21:13:51 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-03-22 21:13:51 +0100
commitf4fd3e6deca964f82a4f35a69813209fc1db98f3 (patch)
treebe887b166fa6ebcd1ee4d64d7f0a3d0af8f0bdfa
parentbdfccac9aa6db0ebf91ef4a341f9b0c46a73305f (diff)
Add Makefile
-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