forked from kellylg/grapehttp
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 911 Bytes
/
Makefile
File metadata and controls
30 lines (23 loc) · 911 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
SHELL := /bin/bash
VERSION = 1.0.0
CURDIR = $(shell pwd)
BASEDIR = ${CURDIR}
# build with verison infos
versionDir = "grapehttp/pkg/vinfo"
gitTag = $(shell if [ "`git describe --tags --abbrev=0`" != "" ];then git describe --tags --abbrev=0; else git log --pretty=format:'%h' -n 1; fi)
buildDate = $(shell TZ=Asia/Shanghai date +%FT%T%z)
gitCommit = $(shell git log --pretty=format:'%H' -n 1)
gitTreeState = $(shell if git status|grep -q 'clean';then echo clean; else echo dirty; fi)
LDFLAGS="-w -X ${versionDir}.gitTag=${gitTag} -X ${versionDir}.buildDate=${buildDate} -X ${versionDir}.gitCommit=${gitCommit} -X ${versionDir}.gitTreeState=${gitTreeState}"
all: gotool fctl server
server:
@go build -v -ldflags ${LDFLAGS}
fctl:
@make -C ${BASEDIR}/client
@echo binary file is: ${BASEDIR}/fctl
gotool:
@-gofmt -w .
@-go tool vet . |& grep -v vendor
clean:
rm -f grapehttp
.PHONY: gotool clean fctl