forked from uptrace/uptrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.46 KB
/
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
46
47
48
49
50
51
52
VERSION=$(shell git describe --always --match "v[0-9]*" HEAD)
BUILD_INFO_IMPORT_PATH=github.com/uptrace/uptrace/pkg/internal/version
BUILD_INFO=-ldflags "-X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION)"
GO_BUILD_TAGS=""
.PHONY: gomoddownload
gomoddownload:
go mod download
.PHONY: uptrace
uptrace:
GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ./bin/uptrace_$(GOOS)_$(GOARCH)$(EXTENSION) \
$(BUILD_INFO) -tags $(GO_BUILD_TAGS) ./cmd/uptrace
.PHONY: uptrace-all-sys
uptrace-all-sys: uptrace-darwin_amd64 uptrace-darwin_arm64 uptrace-linux_amd64 uptrace-linux_arm64 uptrace-windows_amd64
.PHONY: uptrace-darwin_amd64
uptrace-darwin_amd64:
GOOS=darwin GOARCH=amd64 $(MAKE) uptrace
.PHONY: uptrace-darwin_arm64
uptrace-darwin_arm64:
GOOS=darwin GOARCH=arm64 $(MAKE) uptrace
.PHONY: uptrace-linux_amd64
uptrace-linux_amd64:
GOOS=linux GOARCH=amd64 $(MAKE) uptrace
.PHONY: uptrace-linux_arm64
uptrace-linux_arm64:
GOOS=linux GOARCH=arm64 $(MAKE) uptrace
.PHONY: uptrace-windows_amd64
uptrace-windows_amd64:
GOOS=windows GOARCH=amd64 EXTENSION=.exe $(MAKE) uptrace
.PHONY: docker-uptrace
docker-uptrace:
GOOS=linux GOARCH=amd64 $(MAKE) uptrace
cp ./bin/uptrace_linux_amd64 ./cmd/uptrace/uptrace
docker build -t uptrace ./cmd/uptrace/
rm ./cmd/uptrace/uptrace
TOOLS_MOD_DIR := ./pkg/internal/tools
.PHONY: install-tools
install-tools:
cd $(TOOLS_MOD_DIR) && go install github.com/tcnksm/ghr
.PHONY: clean-repo
clean-repo:
git filter-repo --path vue/dist --invert-paths