-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (27 loc) · 951 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
32
33
34
35
36
37
38
39
APP_NAME := get_unused_ip
VERSION ?= latest
BINARIES := \
bin/$(APP_NAME)-$(VERSION)-linux-amd64 \
bin/$(APP_NAME)-$(VERSION)-linux-arm64 \
bin/$(APP_NAME)-$(VERSION)-darwin-amd64 \
bin/$(APP_NAME)-$(VERSION)-darwin-arm64 \
bin/$(APP_NAME)-$(VERSION)-windows-amd64.exe \
bin/$(APP_NAME)-$(VERSION)-windows-arm64.exe
all: $(BINARIES)
bin/$(APP_NAME)-$(VERSION)-linux-amd64:
GOOS=linux GOARCH=amd64 go build -o $@
bin/$(APP_NAME)-$(VERSION)-linux-arm64:
GOOS=linux GOARCH=arm64 go build -o $@
bin/$(APP_NAME)-$(VERSION)-darwin-amd64:
GOOS=darwin GOARCH=amd64 go build -o $@
bin/$(APP_NAME)-$(VERSION)-darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -o $@
bin/$(APP_NAME)-$(VERSION)-windows-amd64.exe:
GOOS=windows GOARCH=amd64 go build -o $@
bin/$(APP_NAME)-$(VERSION)-windows-arm64.exe:
GOOS=windows GOARCH=arm64 go build -o $@
zip: all
zip -j bin/$(APP_NAME)-$(VERSION)-all.zip $(BINARIES)
clean:
rm -r bin
.PHONY: all clean