-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 884 Bytes
/
Copy pathMakefile
File metadata and controls
47 lines (36 loc) · 884 Bytes
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
SHELL=/usr/bin/env bash
NAME=tfctl
BIN_PATH ?= dist/$(NAME)
ifeq ($(GOARCH), arm64)
GOARCH = arm64
else ifeq ($(GOARCH), s390x)
GOARCH = s390x
else
GOARCH = amd64
endif
default: $(BIN_PATH)
.PHONY: linux
linux:
GOOS=linux GOARCH=$(GOARCH) $(MAKE) bin
.PHONY: docker
docker: linux
docker build --build-arg BUILD_DIRECTORY="dist" -t hashicorp/$(NAME):latest .
.PHONY: bin
bin: $(BIN_PATH)
.PHONY: $(BIN_PATH)
$(BIN_PATH):
CGO_ENABLED=0 go build -o $(BIN_PATH) -trimpath -buildvcs=false ./cmd/$(NAME)
.PHONY: clean
clean:
rm -rf $(CURDIR)/$(dir $(BIN_PATH))
.PHONY: gen/screenshot
gen/screenshot: go/install ## Create a screenshot of the tfctl CLI
@go run github.com/homeport/termshot/cmd/termshot@v0.6.1 -c -f assets/tfctl.png -- tfctl
.PHONY: go/build
go/build: bin
.PHONY: go/install
go/install:
@go install ./cmd/tfctl
.PHONY: go/lint
go/lint:
@golangci-lint run