-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.22 KB
/
Makefile
File metadata and controls
43 lines (34 loc) · 1.22 KB
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
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X github.com/rgcr/iproute-mac/internal/version.Version=$(VERSION)"
.PHONY: build install test test-integration clean lint completions
build:
go build $(LDFLAGS) -o bin/ip ./cmd/ip
go build $(LDFLAGS) -o bin/bridge ./cmd/bridge
go build $(LDFLAGS) -o bin/ss ./cmd/ss
@$(MAKE) completions
install:
go install $(LDFLAGS) ./cmd/ip
go install $(LDFLAGS) ./cmd/bridge
go install $(LDFLAGS) ./cmd/ss
test:
go test ./...
test-integration:
go test -tags integration ./...
clean:
rm -rf bin/
lint:
golangci-lint run ./...
completions:
@mkdir -p completions/bash completions/zsh completions/fish
@bin/ip completion bash > completions/bash/ip
@bin/ip completion zsh > completions/zsh/_ip
@bin/ip completion fish > completions/fish/ip.fish
@bin/bridge completion bash > completions/bash/bridge
@bin/bridge completion zsh > completions/zsh/_bridge
@bin/bridge completion fish > completions/fish/bridge.fish
@bin/ss completion bash > completions/bash/ss
@bin/ss completion zsh > completions/zsh/_ss
@bin/ss completion fish > completions/fish/ss.fish
man:
go run tools/gendoc.go docs/man
@echo "Man pages generated in docs/man/"