-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 753 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 753 Bytes
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
VERSION := $(shell git describe --tags)
BUILD_DIR?=$(shell pwd)/build
NAME=rabbitio
DIRECTORIES=./ ./cmd ./rmq ./file
all: tools deps test
tools:
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/mitchellh/gox
deps:
dep ensure
test:
go vet ${DIRECTORIES}
GOCACHE=off go test -v -race -cover ${DIRECTORIES}
build:
go build -o ${NAME} -ldflags "-X main.version=${VERSION}" main.go
build-all:
mkdir -p ${BUILD_DIR}/
gox -verbose -ldflags "-X main.version=${VERSION}" \
-osarch="linux/amd64 darwin/amd64 windows/amd64 freebsd/amd64" \
-output="${BUILD_DIR}/${NAME}-${VERSION}-{{.OS}}-{{.Arch}}"
compress:
gzip -f -v ${BUILD_DIR}/*
clean:
rm -rf ./build
rm -rf ./vendor
.PHONY: tools deps build-all compress build clean