1 Star 0 Fork 65

时间会苍白/jiacrontab

forked from iwannay/jiacrontab 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile 2.33 KB
一键复制 编辑 原始数据 按行查看 历史
iwannay 提交于 2020-10-14 22:06 . 合并冲突
# Go parameters
goCmd=go
goBuild=$(goCmd) build
goClean=$(goCmd) clean
goTest=$(goCmd) test
goGet=$(goCmd) get
sourceAdmDir=./app/jiacrontab_admin
sourceNodeDir=./app/jiacrontabd
binAdm=$(sourceAdmDir)/jiacrontab_admin
binNode=$(sourceNodeDir)/jiacrontabd
buildDir=./build
buildAdmDir=$(buildDir)/jiacrontab/jiacrontab_admin
buildNodeDir=$(buildDir)/jiacrontab/jiacrontabd
admCfg=$(sourceAdmDir)/jiacrontab_admin.ini
nodeCfg=$(sourceNodeDir)/jiacrontabd.ini
staticDir=./jiacrontab_admin/static/build
staticSourceDir=./jiacrontab_admin/static
workDir=$(shell pwd)
.PHONY: all build test clean build-linux build-windows
all: test build
build:
$(call checkStatic)
$(call init)
$(goBuild) -o $(binAdm) -v $(sourceAdmDir)
$(goBuild) -o $(binNode) -v $(sourceNodeDir)
mv $(binAdm) $(buildAdmDir)
mv $(binNode) $(buildNodeDir)
build2:
$(call init)
$(goBuild) -o $(binAdm) -v $(sourceAdmDir)
$(goBuild) -o $(binNode) -v $(sourceNodeDir)
mv $(binAdm) $(buildAdmDir)
mv $(binNode) $(buildNodeDir)
test:
$(goTest) -v -race -coverprofile=coverage.txt -covermode=atomic $(sourceAdmDir)
$(goTest) -v -race -coverprofile=coverage.txt -covermode=atomic $(sourceNodeDir)
clean:
rm -f $(binAdm)
rm -f $(binNode)
rm -rf $(buildDir)
# Cross compilation
build-linux:
$(call checkStatic)
$(call init)
GOOS=linux GOARCH=amd64 $(goBuild) -o $(binAdm) -v $(sourceAdmDir)
GOOS=linux GOARCH=amd64 $(goBuild) -o $(binNode) -v $(sourceNodeDir)
mv $(binAdm) $(buildAdmDir)
mv $(binNode) $(buildNodeDir)
build-windows:
$(call checkStatic)
$(call init)
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="x86_64-w64-mingw32-gcc -fno-stack-protector -D_FORTIFY_SOURCE=0 -lssp" $(goBuild) -o $(binAdm).exe -v $(sourceAdmDir)
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="x86_64-w64-mingw32-gcc -fno-stack-protector -D_FORTIFY_SOURCE=0 -lssp" $(goBuild) -o $(binNode).exe -v $(sourceNodeDir)
mv $(binAdm).exe $(buildAdmDir)
mv $(binNode).exe $(buildNodeDir)
define checkStatic
@if [ "$(assets)" = "" ]; then echo "no assets, see https://github.com/jiacrontab/jiacrontab-frontend"; exit -1;else echo "build release"; fi
go-bindata -pkg admin -prefix $(assets) -o jiacrontab_admin/bindata_gzip.go -fs $(assets)/...
endef
define init
rm -rf $(buildDir)
mkdir $(buildDir)
mkdir -p $(buildAdmDir)
mkdir -p $(buildNodeDir)
cp $(admCfg) $(buildAdmDir)
cp $(nodeCfg) $(buildNodeDir)
endef
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/cxmvc/jiacrontab.git
git@gitee.com:cxmvc/jiacrontab.git
cxmvc
jiacrontab
jiacrontab
master

搜索帮助