-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 921 Bytes
/
Makefile
File metadata and controls
40 lines (31 loc) · 921 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
BINARY_DIR := bin
AGENT_BINARY := $(BINARY_DIR)/agent
CTL_BINARY := $(BINARY_DIR)/vpnctl
TUI_BINARY := $(BINARY_DIR)/vpn-tui
GO := go
GOFLAGS := -trimpath
LDFLAGS := -s -w
.PHONY: all build-agent build-ctl build-tui test fmt lint clean
all: build-agent build-ctl build-tui
build-agent:
@mkdir -p $(BINARY_DIR)
$(GO) build $(GOFLAGS) -ldflags '$(LDFLAGS)' -o $(AGENT_BINARY) ./cmd/agent
build-ctl:
@mkdir -p $(BINARY_DIR)
$(GO) build $(GOFLAGS) -ldflags '$(LDFLAGS)' -o $(CTL_BINARY) ./cmd/ctl
build-tui:
@mkdir -p $(BINARY_DIR)
$(GO) build $(GOFLAGS) -ldflags '$(LDFLAGS)' -o $(TUI_BINARY) ./cmd/tui
test:
$(GO) test -v -race -count=1 ./...
fmt:
$(GO) fmt ./...
lint:
$(GO) vet ./...
@if command -v staticcheck >/dev/null 2>&1; then \
staticcheck ./...; \
else \
echo "staticcheck not installed, skipping (go install honnef.co/go/tools/cmd/staticcheck@latest)"; \
fi
clean:
rm -rf $(BINARY_DIR)