-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.build
34 lines (29 loc) · 1.25 KB
/
Makefile.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
BIN_DIR = bin
LDFLAGS ?=
BUILD_TAGS ?= "unit integration heavy_mock_integration"
##@ Building
.PHONY: build
build: ## build all applications
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/migrate cmd/migrate/*.go
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/block-explorer cmd/block-explorer/*.go
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/api cmd/api/*.go
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/exporter-api cmd/exporter-api/*.go
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/loadtest_migrate cmd/loadtest_migrate/*.go
.PHONY: generate
generate: ## generate mocks
GOFLAGS="" go generate ./...
.PHONY: generate-protobuf
generate-protobuf: ## generate protobuf structs
@ if ! which protoc > /dev/null; then \
echo "error: protoc not installed" >&2; \
exit 1; \
fi
protoc -I./ -I$(GOPATH)/src --gogoslick_out=plugins=grpc:./ test/heavymock/import_records.proto
protoc -I./ -I$(GOPATH)/src --gogoslick_out=plugins=grpc:./ etl/exporter/pulse_exporter.proto
protoc -I./ -I$(GOPATH)/src --gogoslick_out=plugins=grpc:./ etl/exporter/record_exporter.proto
.PHONY: install-dev
install-dev:
go get github.com/gogo/protobuf
.PHONY: compile-tests
compile-tests: ## compile all tests
go list -tags=$(BUILD_TAGS) ./... | xargs -n 1 go test -tags=$(BUILD_TAGS) -c