-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (31 loc) · 930 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
BINARY = giterm
BUILD_DIR = $(shell pwd)
GO_VERSION = $(shell go version | cut -d ' ' -f 3 | sed -e 's/go//')
LDFLAGS = -ldflags="-s -w"
all: clean test build
# Test all packages.
test:
@go test -v ./... -covermode=count -coverprofile=coverage.out
.PHONY: test
# Build linux binaries.
linux:
GOOS=linux GOARCH=amd64 go build -o ${BINARY}_linux_amd64 ${LDFLAGS} ./cmd/giterm;
.PHONY: linux
linux-386:
GOOS=linux GOARCH=386 go build -o ${BINARY}_linux_386 ${LDFLAGS} ./cmd/giterm;
.PHONY: linux-386
# Build mac binaries.
darwin:
GOOS=darwin GOARCH=amd64 go build -o ${BINARY}_darwin_amd64 ${LDFLAGS} ./cmd/giterm;
.PHONY: darwin
darwin-386:
GOOS=darwin GOARCH=386 go build -o ${BINARY}_darwin_386 ${LDFLAGS} ./cmd/giterm;
.PHONY: darwin-386
# Build release binaries.
build: linux linux-386 darwin darwin-386
.PHONY: build
# Clean build artifacts.
clean:
@rm -f ${BINARY}_linux*
@rm -f ${BINARY}_darwin*
.PHONY: clean