forked from junyu-w/corgi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (22 loc) · 945 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
.PHONY: all clean dep build build-darwin build-linux
VERSION := $(shell git describe --tags --abbrev=0)
all: dep clean build sha256-checksum
dep:
dep ensure
prep-build:
mkdir -p build
build-darwin: main.go dep prep-build
cd build; mkdir -p corgi_$(VERSION)_macOS_64-bit
env GOOS=darwin GOARCH=amd64 go build -o build/corgi_$(VERSION)_macOS_64-bit/corgi
cd build; tar -czf corgi_$(VERSION)_macOS_64-bit.tar.gz corgi_$(VERSION)_macOS_64-bit
cd build; rm -rf corgi_$(VERSION)_macOS_64-bit
build-linux: main.go dep prep-build
cd build; mkdir -p corgi_$(VERSION)_linux_64-bit
env GOOS=linux GOARCH=amd64 go build -o build/corgi_$(VERSION)_linux_64-bit/corgi
cd build; tar -czf corgi_$(VERSION)_linux_64-bit.tar.gz corgi_$(VERSION)_linux_64-bit
cd build; rm -rf corgi_$(VERSION)_linux_64-bit
sha256-checksum: build-darwin
shasum -a256 build/corgi_$(VERSION)_macOS_64-bit.tar.gz
clean:
rm -rf build
build: build-darwin build-linux