From 16b9a7702bb6c77fad8169d6752ec3bc72600bce Mon Sep 17 00:00:00 2001 From: ouqiang Date: Sun, 22 Apr 2018 09:25:10 +0800 Subject: [PATCH] =?UTF-8?q?makefile=E6=9E=84=E5=BB=BA=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=AB=9E=E6=80=81=E6=9D=A1=E4=BB=B6=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +---- makefile | 35 ++++++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index cc931ff..d83dce9 100644 --- a/.gitignore +++ b/.gitignore @@ -31,11 +31,8 @@ conf profile/* public/resource/javascript/vue.js /gocron -gocron.exe /gocron-node -gocron-node.exe /bin /packages -node_modules -package.json \ No newline at end of file +node_modules \ No newline at end of file diff --git a/makefile b/makefile index 86cd418..ea23350 100644 --- a/makefile +++ b/makefile @@ -1,22 +1,43 @@ -default: build .PHONY: build build: gocron node +.PHONY: build-race +build-race: enable-race build + +.PHONY: run +run: build kill + ./bin/gocron-node & + ./bin/gocron web + +.PHONY: run-race +run-race: enable-race run + +.PHONY: kill +kill: + -killall gocron-node + .PHONY: gocron gocron: - - go build -o bin/gocron ./cmd/gocron - + go build $(RACE) -o bin/gocron ./cmd/gocron .PHONY: node node: + go build $(RACE) -o bin/gocron-node ./cmd/node - go build -o bin/gocron-node ./cmd/node +.PHONY: test +test: + go test $(RACE) ./... + +.PHONY: test-race +test-race: enable-race test + +.PHONY: enable-race +enable-race: + $(eval RACE = -race) .PHONY: clean clean: - rm bin/gocron - rm bin/gocron-node \ No newline at end of file + rm bin/gocron-node