forked from liamg/darktile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (35 loc) · 1.5 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
SHELL := /bin/bash
BINARY := aminal
FONTPATH := ./gui/packed-fonts
.PHONY: build
build: test install-tools
packr -v
go build -ldflags "-X github.com/liamg/aminal/version.Version=`git describe --tags`"
.PHONY: test
test:
go test -v ./...
go vet -v
.PHONY: install
install: build install-tools
packr -v
go install -ldflags "-X github.com/liamg/aminal/version.Version=`git describe --tags`"
.PHONY: install-tools
install-tools:
which dep || curl -L https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
which packr || go get -u github.com/gobuffalo/packr/packr
.PHONY: update-fonts
update-fonts: install-tools
curl -L https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf -o "${FONTPATH}/Hack Regular Nerd Font Complete.ttf"
curl -L https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Bold/complete/Hack%20Bold%20Nerd%20Font%20Complete.ttf -o "${FONTPATH}/Hack Bold Nerd Font Complete.ttf"
packr -v
.PHONY: build-linux
build-linux:
mkdir -p bin/linux
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o bin/linux/${BINARY}-linux-amd64 -ldflags "-X github.com/liamg/aminal/version.Version=${CIRCLE_TAG}"
.PHONY: build-darwin
build-darwin:
mkdir -p bin/darwin
xgo -x -v -ldflags "-X github.com/liamg/aminal/version.Version=${CIRCLE_TAG}" --targets=darwin/amd64 -out bin/darwin/${BINARY} .
.PHONY: package-debian
package-debian: build-linux
./scripts/package-debian.sh "${CIRCLE_TAG}" bin/linux/${BINARY}-linux-amd64