hwt/Makefile

29 lines
914 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
${GOPATH}/bin/hwtd: $(call rwildcard,,*.go) hwt.go vendor
2018-01-16 21:18:38 -08:00
@go install -v mcquay.me/hwt/cmd/hwtd
2018-01-16 20:57:04 -08:00
${GOPATH}/bin/hwtc: $(call rwildcard,,*.go) hwt.go vendor
2018-01-16 21:18:38 -08:00
@go install -v mcquay.me/hwt/cmd/hwtc
2018-01-16 20:57:04 -08:00
hwt.go: rpc/hwt/service.twirp.go rpc/hwt/service.pb.go
2018-01-16 21:04:29 -08:00
rpc/hwt/service.twirp.go: rpc/hwt/service.proto
2018-01-16 21:18:38 -08:00
@echo "generating twirp file"
@protoc --proto_path=${GOPATH}/src:. --twirp_out=. --go_out=. rpc/hwt/service.proto
2018-01-16 20:57:04 -08:00
rpc/hwt/service.pb.go: rpc/hwt/service.proto
2018-01-16 21:18:38 -08:00
@echo "generating pb file"
@protoc --proto_path=${GOPATH}/src:. --twirp_out=. --go_out=. rpc/hwt/service.proto
2018-01-16 21:14:00 -08:00
vendor: Gopkg.toml Gopkg.lock
2018-01-16 21:14:00 -08:00
dep ensure
2018-01-16 21:14:09 -08:00
.PHONY: clean
clean:
@rm -f rpc/hwt/service.{twirp,pb}.go
2018-01-16 21:14:09 -08:00
@rm -rf vendor