-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
25 lines (18 loc) · 612 Bytes
/
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
# ref: https://vic.demuzere.be/articles/golang-makefile-crosscompile/
LD_FLAGS := -s -w
BIN_DIR := build
BIN_NAME := go-out
default: clean darwin linux windows integrity
clean:
$(RM) $(BIN_DIR)/$(BIN_NAME)*
go clean -x
install:
go install
darwin:
GOOS=darwin GOARCH=amd64 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-darwin-amd64'
linux:
GOOS=linux GOARCH=amd64 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-linux-amd64'
windows:
GOOS=windows GOARCH=amd64 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-windows-amd64.exe'
integrity:
cd $(BIN_DIR) && shasum *