-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
27 lines (22 loc) · 1.03 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
LDFLAGS := -X "github.com/dragonchain/dragonchain-installer/internal/configuration.Version=$(shell cat .version)-$(shell git rev-parse --short HEAD)"
BINARY := dc-installer
UNIXPLATFORMS := linux darwin
os = $(word 1, $@)
.PHONY: $(UNIXPLATFORMS)
$(UNIXPLATFORMS):
mkdir -p release
GOOS=$(os) GOARCH=amd64 go build -v -ldflags '-s -w $(LDFLAGS)' -o release/$(BINARY)-$(os)-amd64 github.com/dragonchain/dragonchain-installer/cmd/dc-installer
.PHONY: windows
windows:
mkdir -p release
cp windows/windows_amd64.syso cmd/dc-installer/windows_amd64.syso
GOOS=$(os) GOARCH=amd64 go build -v -ldflags '-s -w $(LDFLAGS)' -o release/$(BINARY)-$(os)-amd64.exe github.com/dragonchain/dragonchain-installer/cmd/dc-installer
rm cmd/dc-installer/windows_amd64.syso
.PHONY: linux-arm64
linux-arm64:
mkdir -p release
GOOS=linux GOARCH=arm64 go build -v -ldflags '-s -w $(LDFLAGS)' -o release/$(BINARY)-linux-arm64 github.com/dragonchain/dragonchain-installer/cmd/dc-installer
.PHONY: release
release: linux linux-arm64 darwin windows
clean:
rm -rf release