-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (22 loc) · 996 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
26
27
28
29
30
31
# ref: https://vic.demuzere.be/articles/golang-makefile-crosscompile/
BIN_DIR := build
BIN_NAME := fireDorks
default: clean linux darwin windows pack 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)-darwin64'
GOOS=windows GOARCH=386 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-darwin32'
linux:
GOOS=linux GOARCH=amd64 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-linux64'
GOOS=linux GOARCH=386 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-linux32'
windows:
GOOS=windows GOARCH=amd64 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-windows64.exe'
GOOS=windows GOARCH=386 go build -ldflags="$(LD_FLAGS)" -o '$(BIN_DIR)/$(BIN_NAME)-windows32.exe'
pack:
cd $(BIN_DIR) && upx $(BIN_NAME)-linux32 $(BIN_NAME)-linux64 $(BIN_NAME)-windows32.exe $(BIN_NAME)-windows64.exe
integrity:
cd $(BIN_DIR) && shasum *