-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (43 loc) · 1.47 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Program version
VERSION := $(shell grep "const Version " version.go | sed -E 's/.*"(.+)"$$/\1/')
# Binary name for beepi
BIN_NAME=$(shell basename $(abspath ./))
# Project owner for beepi
OWNER=kientv
# Project name for beepi
PROJECT_NAME=$(shell basename $(abspath ./))
# Project url used for builds
# examples: github.com, bitbucket.org
REPO_HOST_URL=bitbucket.org
# Grab the current commit
GIT_COMMIT="$(shell git rev-parse HEAD)"
# Check if there are uncommited changes
GIT_DIRTY="$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
# Add the godep path to the GOPATH
#GOPATH=$(shell godep path):$(shell echo $$GOPATH)
install:
go get -v github.com/astaxie/beego
go get -v github.com/astaxie/beego/orm
go get -v github.com/astaxie/beego/validation
go get -v github.com/astaxie/beego/logs
go get -v github.com/astaxie/beego/config
go get -v github.com/beego/i18n
go get -v github.com/beego/bee
go get -v github.com/go-sql-driver/mysql
go get -v github.com/smartystreets/goconvey/convey
go get -v github.com/Shopify/sarama
release:
@echo "building ${OWNER} ${BIN_NAME} ${VERSION}"
@echo "GOPATH=${GOPATH}"
#godep get && \
go build -ldflags "-X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY}" -o bin/${BIN_NAME}
build: clean
@echo "building ${OWNER} ${BIN_NAME} ${VERSION}"
@go build -o ./${BIN_NAME}
clean:
@test ! -e ./${BIN_NAME} || rm ./${BIN_NAME}
test:
go test -v ./...
run:
@bee run watchall true
.PHONY: build dist clean test release run install