Makefile 656 Bytes
Newer Older
1
2
3
4
5
GO_EXECUTABLE ?= go
PACKAGE_DIRS := $(shell glide nv)
VERSION := $(shell git describe --tags --dirty --always)
DIST_DIRS := find * -type d -exec

6
all: test build dist
7

8
9
build:
	mkdir -p dist/linux-amd64
10
	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ${GO_EXECUTABLE} build -o dist/linux-amd64/jwt-tokenissuer -ldflags "-X main.version=${VERSION}"
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

test:
	${GO_EXECUTABLE} test --short $(PACKAGE_DIRS)

clean:
	rm -f ./jwt-tokenissuer.test
	rm -f ./jwt-tokenissuer
	rm -rf ./dist

dist: build
	cd dist && \
	$(DIST_DIRS) cp ../LICENSE {} \; && \
	$(DIST_DIRS) cp ../README.md {} \; && \
	$(DIST_DIRS) tar -zcf jwt-tokenissuer-${VERSION}-{}.tar.gz {} \; && \
	cd ..