-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (35 loc) · 991 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
43
44
45
FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH)))
OS ?= $(shell uname -s | tr '[A-Z]' '[a-z]')
ARCH ?= $(shell uname -m)
GOARCH ?= $(shell go env GOARCH)
BIN_NAME ?= warp-speed-debugging-demo
TMP_DIR := $(shell pwd)/tmp
BIN_DIR ?= $(TMP_DIR)/bin
$(TMP_DIR):
mkdir -p $(TMP_DIR)
$(BIN_DIR):
mkdir -p $(BIN_DIR)
$(BIN_NAME): deps main.go $(wildcard *.go) $(wildcard */*.go)
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(GOARCH) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -a -ldflags '-s -w' -o $(BIN_NAME) .
.PHONY: deps
deps: go.mod go.sum
go mod tidy
go mod download all
go mod verify
.PHONY: build
build: $(BIN_NAME)
.PHONY: container-test
container-test: build
@docker build \
-f Dockerfile \
-t warp-speed-debugging .
.PHONY: test-interactive
test-interactive: container-test
@rm -rf e2e_*
CGO_ENABLED=1 GO111MODULE=on go test -v -test.timeout=9999m ./test
.PHONY: clean
clean:
-rm -rf tmp/bin
-rm -rf tmp/src
-rm -rf test/e2e_*
-rm $(BIN_NAME)