-
-
Notifications
You must be signed in to change notification settings - Fork 103
/
Makefile
59 lines (42 loc) · 1.63 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This works because `go list ./...` excludes vendor directories by default in modern versions of Go (1.11+).
# No need for grep or additional filtering.
TEST ?= $$(go list ./...)
SHELL := /bin/bash
#GOOS=darwin
#GOOS=linux
#GOARCH=amd64
VERSION=test
# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/targets.md
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
## Lint terraform code
lint:
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
get:
go get
build: build-default
version: version-default
build-linux: GOOS=linux
build-linux: build-default
build-default: get
@echo "Building atmos $(if $(GOOS),GOOS=$(GOOS)) $(if $(GOARCH),GOARCH=$(GOARCH))"
env $(if $(GOOS),GOOS=$(GOOS)) $(if $(GOARCH),GOARCH=$(GOARCH)) go build -o build/atmos -v -ldflags "-X 'github.com/cloudposse/atmos/pkg/version.Version=$(VERSION)'"
build-windows: GOOS=windows
build-windows: get
@echo "Building atmos for $(GOOS) ($(GOARCH))"
go build -o build/atmos.exe -v -ldflags "-X github.com/cloudposse/atmos/pkg/version.Version=$(VERSION)"
build-macos: GOOS=darwin
build-macos: build-default
version-linux: version-default
version-macos: version-default
version-default:
chmod +x ./build/atmos
./build/atmos version
version-windows: build-windows
./build/atmos.exe version
deps:
go mod download
# Run acceptance tests
testacc: get
go test $(TEST) -v $(TESTARGS) -timeout 2m
.PHONY: lint get build version build-linux build-windows build-macos deps version-linux version-windows version-macos testacc