-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (34 loc) · 880 Bytes
/
Makefile
File metadata and controls
42 lines (34 loc) · 880 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
GOOS = $(shell go env GOOS)
GOARCH = $(shell go env GOARCH)
BUILD_DIR = dist/${GOOS}_${GOARCH}
GENERATED_CONF = pkg/config/conf.gen.go
ifeq ($(GOOS),windows)
OUTPUT_PATH = ${BUILD_DIR}/baton-cloudflare-zero-trust.exe
else
OUTPUT_PATH = ${BUILD_DIR}/baton-cloudflare-zero-trust
endif
# Set the build tag conditionally based on BATON_LAMBDA_SUPPORT
ifdef BATON_LAMBDA_SUPPORT
BUILD_TAGS=-tags baton_lambda_support
else
BUILD_TAGS=
endif
.PHONY: build
build: $(GENERATED_CONF)
go build ${BUILD_TAGS} -o ${OUTPUT_PATH} ./cmd/baton-cloudflare-zero-trust
$(GENERATED_CONF): pkg/config/config.go go.mod
@echo "Generating $(GENERATED_CONF)..."
go generate ./pkg/config
generate: $(GENERATED_CONF)
.PHONY: update-deps
update-deps:
go get -d -u ./...
go mod tidy -v
go mod vendor
.PHONY: add-dep
add-dep:
go mod tidy -v
go mod vendor
.PHONY: lint
lint:
golangci-lint run