记录编译工具代码 Makefile
替换binary路径使用
BINARY={Path} GOARCH=amd64 VERSION?=? BUILD=`date +%FT%T%z`LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}".PHONY: help build linux darwin windows clean versionhelp: @echo "usage: make <option>" @echo "options and effects:" @echo " help : Show help" @echo " build : Build the binary of this project for current platform" @echo " linux : Build the linux binary of this project" @echo " darwin : Build the darwin binary of this project" @echo " windows: Build the windows binary of this project" @echo " clean : Remove binaries" @echo " version: Display Go version"build: @go build ${LDFLAGS} -o ${BINARY}linux: @GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY}-linux-${GOARCH}darwin: @GOOS=darwin GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY}-darwin-${GOARCH}windows: @GOOS=windows GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY}-windows-${GOARCH}.execlean: @rm -f ${BINARY} @rm -f ${BINARY}-*version: @go version%
记录上传测试环境工具代码
#!/usr/bin/env bashmake linux rsync -avzrC Go-linux-amd64 config/test.yaml axdict@127.0.0.1:/home/axdict/go/
替换本地ip为远端ip 和 要同步的文件
作者:保儿洁
链接:https://www.jianshu.com/p/30379df1554a
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦