Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. GOPATH ?= $(shell go env GOPATH)
  2. ifneq ($(OS),Windows_NT)
  3. EXE =
  4. else
  5. EXE = .exe
  6. endif
  7. PKG = $(shell go env GOOS)_$(shell go env GOARCH)
  8. TAGS ?=
  9. all: ${GOPATH}/bin/hercules${EXE}
  10. test: all
  11. go test gopkg.in/src-d/hercules.v10
  12. ${GOPATH}/bin/protoc-gen-gogo${EXE}:
  13. go get -v github.com/gogo/protobuf/protoc-gen-gogo
  14. ifneq ($(OS),Windows_NT)
  15. internal/pb/pb.pb.go: internal/pb/pb.proto ${GOPATH}/bin/protoc-gen-gogo
  16. PATH=${PATH}:${GOPATH}/bin protoc --gogo_out=internal/pb --proto_path=internal/pb internal/pb/pb.proto
  17. else
  18. internal/pb/pb.pb.go: internal/pb/pb.proto ${GOPATH}/bin/protoc-gen-gogo.exe
  19. export PATH="${PATH};${GOPATH}\bin" && \
  20. protoc --gogo_out=internal/pb --proto_path=internal/pb internal/pb/pb.proto
  21. endif
  22. python/labours/pb_pb2.py: internal/pb/pb.proto
  23. protoc --python_out python/hercules --proto_path=internal/pb internal/pb/pb.proto
  24. cmd/hercules/plugin_template_source.go: cmd/hercules/plugin.template
  25. cd cmd/hercules && go generate
  26. vendor:
  27. dep ensure -v
  28. ${GOPATH}/bin/hercules${EXE}: vendor *.go */*.go */*/*.go */*/*/*.go internal/pb/pb.pb.go python/labours/pb_pb2.py cmd/hercules/plugin_template_source.go
  29. go get -tags "$(TAGS)" -ldflags "-X gopkg.in/src-d/hercules.v10.BinaryGitHash=$(shell git rev-parse HEAD)" gopkg.in/src-d/hercules.v10/cmd/hercules