加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 911 Bytes
一键复制 编辑 原始数据 按行查看 历史
Lingfei Kong 提交于 2017-12-03 17:54 . first commit
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化