-
Notifications
You must be signed in to change notification settings - Fork 5
/
makefile
38 lines (32 loc) · 824 Bytes
/
makefile
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
35
36
37
38
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOFMT=$(GOCMD) fmt
BUILD_DIR=./build
# indy build-tests package
PACKAGE_NAME_BUILD=root
BINARY_NAME_BUILD=$(BUILD_DIR)/indy-test
# other indy package
build:
# build indy-build-tests command
$(GOBUILD) -trimpath -o $(BINARY_NAME_BUILD) -v ./cmd/$(PACKAGE_NAME_BUILD)
# build other commands
# $(GOBUILD) -trimpath -o $(BINARY_NAME_OTHER) -v ./cmd/$(PACKAGE_NAME_OTHER)
.PHONY: build
format:
$(GOFMT) ./...
.PHONY: format
test:
$(GOTEST) -v ./...
.PHONY: test
clean:
$(GOCLEAN) ./...
rm -rf $(BUILD_DIR)
.PHONY: clean
# Cross compilation
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -o $(BINARY_NAME_BUILD)-linux -v ./cmd/$(PACKAGE_NAME_BUILD)
.PHONY: build-linux