hwt/Makefile

29 lines
833 B
Makefile
Raw Normal View History

2018-01-16 20:57:04 -08:00
# from http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
default: ${GOPATH}/bin/hwtd ${GOPATH}/bin/hwtc
2018-01-16 21:14:00 -08:00
${GOPATH}/bin/hwtd: vendor $(call rwildcard,,*.go) hwt.go
2018-01-16 21:18:38 -08:00
@go install -v mcquay.me/hwt/cmd/hwtd
2018-01-16 20:57:04 -08:00
2018-01-16 21:14:00 -08:00
${GOPATH}/bin/hwtc: vendor $(call rwildcard,,*.go) hwt.go
2018-01-16 21:18:38 -08:00
@go install -v mcquay.me/hwt/cmd/hwtc
2018-01-16 20:57:04 -08:00
2018-01-16 21:18:38 -08:00
hwt.go: hwt.twirp.go hwt.pb.go
2018-01-16 21:04:29 -08:00
2018-01-16 21:18:38 -08:00
hwt.twirp.go: hwt.proto
@echo "generating twirp file"
@protoc --proto_path=${GOPATH}/src:. --twirp_out=. --go_out=. ./hwt.proto
2018-01-16 20:57:04 -08:00
2018-01-16 21:18:38 -08:00
hwt.pb.go: hwt.proto
@echo "generating pb file"
@protoc --proto_path=${GOPATH}/src:. --twirp_out=. --go_out=. ./hwt.proto
2018-01-16 21:14:00 -08:00
2018-01-16 21:18:38 -08:00
vendor: Gopkg.toml Gopkg.lock hwt.twirp.go hwt.pb.go
2018-01-16 21:14:00 -08:00
dep ensure
2018-01-16 21:14:09 -08:00
.PHONY: clean
clean:
2018-01-16 21:18:38 -08:00
@rm -f hwt.{twirp,pb}.go
2018-01-16 21:14:09 -08:00
@rm -rf vendor