-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (39 loc) · 2.92 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
MAKEFLAGS += --no-print-directory
CLI_NAME=datex
build:
ifeq ($(OS),Windows_NT)
@$(MAKE) build/batch
else
@$(MAKE) build/bash
endif
build/all:
ifeq ($(OS),Windows_NT)
@$(MAKE) build/all/batch
else
@$(MAKE) build/all/bash
endif
# PLATFORM SPECIFIC
build/batch:
set CGO_ENABLED=0&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}.exe ./main.go \
build/bash:
CGO_ENABLED=0 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME} ./main.go; \
build/all/batch:
set CGO_ENABLED=0&& set GOOS=linux&& set GOARCH=386&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_386 ./main.go
set CGO_ENABLED=0&& set GOOS=linux&& set GOARCH=amd64&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_amd64 ./main.go
set CGO_ENABLED=0&& set GOOS=linux&& set GOARCH=arm&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_arm ./main.go
set CGO_ENABLED=0&& set GOOS=linux&& set GOARCH=arm64&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_arm64 ./main.go
set CGO_ENABLED=0&& set GOOS=darwin&& set GOARCH=amd64&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_darwin_amd64 ./main.go
set CGO_ENABLED=0&& set GOOS=darwin&& set GOARCH=arm64&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_darwin_arm64 ./main.go
set CGO_ENABLED=0&& set GOOS=windows&& set GOARCH=386&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_windows_386.exe ./main.go
set CGO_ENABLED=0&& set GOOS=windows&& set GOARCH=amd64&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_windows_amd64.exe ./main.go
set CGO_ENABLED=0&& set GOOS=windows&& set GOARCH=arm&& go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_windows_arm.exe ./main.go \
build/all/bash:
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_386 ./main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_amd64 ./main.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_arm ./main.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_linux_arm64 ./main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_darwin_amd64 ./main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_darwin_arm64 ./main.go
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_windows_386.exe ./main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_windows_amd64.exe ./main.go
CGO_ENABLED=0 GOOS=windows GOARCH=arm go build -ldflags="-s -w" -installsuffix cgo -o ./bin/${CLI_NAME}_windows_arm.exe ./main.go \