aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a615f2c..65004bb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,20 @@
PROG := calc
+GO := go
+GOFILES := $(wildcard *.go)
+YYFILES := $(wildcard *.y)
+AUTOGEN := $(YYFILES:.y=.go)
-$(PROG): $(wildcard *.go) $(PROG).go
- go build
+$(PROG): $(GOFILES) $(AUTOGEN)
+ $(GO) build
%.go: %.y
- go tool yacc -o $@ $<
+ $(GO) tool yacc -o $@ $<
clean:
- $(RM) $(PROG) $(PROG).go y.output
+ $(GO) clean
+ $(RM) $(AUTOGEN) y.output
+
+install:
+ $(GO) install
.PHONY: clean