-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 1 KB
/
Makefile
File metadata and controls
35 lines (28 loc) · 1 KB
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
MAIN_VERSION:=$(shell git describe --abbrev=0 --tags || echo "0.1")
VERSION:=${MAIN_VERSION}\#$(shell git log -n 1 --pretty=format:"%h")
PACKAGES:=$(shell go list ./... | sed -n '1!p' | grep -v /vendor/)
LDFLAGS:=-ldflags "-X github.com/b3bas/b3bas-up/src/config.Version=${VERSION}"
default: run
depends:
@echo "Install and/or update dependencies..."
@dep ensure -v
@echo "Dependencies updated... [DONE]"
test:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES), \
go test -p=1 -cover -covermode=count -coverprofile=coverage.out ${pkg}; \
tail -n +2 coverage.out >> coverage-all.out;)
cover: test
@echo "Running b3bas-up (test)..."
@go tool cover -html=coverage-all.out
run:
@echo "Running b3bas-up..."
@rm -rf banner.text
@ln -sf ./bin/banner.txt ./banner.txt
@go run ${LDFLAGS} app.go
build: clean
@go build ${LDFLAGS} -a -o ./bin/b3bas-up app.go
@echo "Build binary... [DONE]"
clean:
@rm -rf ./bin/b3bas-up coverage.out coverage-all.out
@echo "Cleanup binary... [DONE]"