-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (25 loc) · 836 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
APP = vlookup
DATE = $(shell date +%FT%T%Z)
BUILD_DIR = build/bin
GIT_VER=$(shell git rev-parse HEAD)
LDFLAGS=-ldflags "-X github.com/frzifus/vlookup/pkg/version.hash=${GIT_VER} \
-X github.com/frzifus/vlookup/pkg/version.buildtimestamp=${DATE}"
.PHONY: test clean arm amd64 disclean mrproper
# Build the project
all: amd64 arm
build_deps:
go install golang.org/x/lint/golint@latest
amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o ${BUILD_DIR}/${APP}-linux-amd64 -v cmd/${APP}/*.go
arm:
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build ${LDFLAGS} -o ${BUILD_DIR}/${APP}-linux-arm -v cmd/${APP}/*.go
lint:
golint -set_exit_status ./pkg/... ./cmd/...
test:
go test -v ./...
clean:
-rm -f ${BUILD_DIR}/${BINARY}-*
distclean:
rm -rf ./build
mrproper: distclean
git ls-files --others | xargs rm -rf