-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
42 lines (32 loc) · 881 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
39
40
41
42
XC_OS="darwin"
#XC_OS="linux darwin"
XC_ARCH="arm64"
#XC_ARCH="amd64 arm64"
XC_PARALLEL="2"
BIN="dist"
SRC=$(shell find . -name "*.go")
ifeq (, $(shell which gox))
$(warning "could not find gox in $(PATH), run: go get github.com/mitchellh/gox")
endif
.PHONY: all build fmt test install_deps clean
default: all
all: fmt test build
build: install_deps
gox \
-os=$(XC_OS) \
-arch=$(XC_ARCH) \
-parallel=$(XC_PARALLEL) \
-output=$(BIN)/{{.Dir}}_{{.OS}}_{{.Arch}} \
;
fmt:
$(info ******************** checking formatting ********************)
@test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1)
terraform fmt -recursive
test: install_deps
$(info ******************** running tests ********************)
go test -v ./...
install_deps:
$(info ******************** downloading dependencies ********************)
go get -v ./...
clean:
rm -rf $(BIN)