-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (16 loc) · 738 Bytes
/
Makefile
File metadata and controls
24 lines (16 loc) · 738 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
VERSION := $(shell git describe --tags --always)
COMMIT := $(shell git rev-parse --short HEAD)
LDFLAGS := -X main.build_version=$(VERSION) -X main.build_commit=$(COMMIT)
default:
go build -ldflags "$(LDFLAGS)"
all: linux_amd64 linux_arm64 win_amd64 win_arm64 darwin_arm64
linux_amd64:
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o note_linux_amd64
linux_arm64:
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o note_linux_arm64
win_amd64:
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o note_win_amd64.exe
win_arm64:
GOOS=windows GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o note_win_arm64.exe
darwin_arm64:
GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o note_darwin_arm64.exe