forked from ouqiang/gocron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.cross-compiles
35 lines (21 loc) · 1.07 KB
/
makefile.cross-compiles
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
LDFLAGS = -w -s -X main.AppVersion=${VERSION}
default: build
.PHONY: build
build: gocron node
.PHONY: gocron
gocron:
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./gocron_darwin_amd64/gocron ./cmd/gocron
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./gocron_linux_amd64/gocron ./cmd/gocron
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./gocron_windows_amd64/gocron.exe ./cmd/gocron
.PHONY: node
node:
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./gocron-node_darwin_amd64/gocron-node ./cmd/node
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./gocron-node_linux_amd64/gocron-node ./cmd/node
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./gocron-node_windows_amd64/gocron-node.exe ./cmd/node
clean:
rm -rf gocron_darwin_amd64
rm -rf gocron_linux_amd64
rm -rf gocron_windows_amd64
rm -rf gocron-node_darwin_amd64
rm -rf gocron-node_linux_amd64
rm -rf gocron-node_windows_amd64