Skip to content

Commit

Permalink
makefile构建增加竞态条件检测
Browse files Browse the repository at this point in the history
  • Loading branch information
ouqiang committed Apr 22, 2018
1 parent 2bae3cf commit 16b9a77
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
node_modules
35 changes: 28 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@

default: build

.PHONY: build
build: gocron node

.PHONY: gocron
gocron:
.PHONY: build-race
build-race: enable-race build

.PHONY: run
run: build kill
./bin/gocron-node &
./bin/gocron web

go build -o bin/gocron ./cmd/gocron
.PHONY: run-race
run-race: enable-race run

.PHONY: kill
kill:
-killall gocron-node

.PHONY: gocron
gocron:
go build $(RACE) -o bin/gocron ./cmd/gocron

.PHONY: node
node:
go build $(RACE) -o bin/gocron-node ./cmd/node

.PHONY: test
test:
go test $(RACE) ./...

go build -o bin/gocron-node ./cmd/node
.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
rm bin/gocron-node

0 comments on commit 16b9a77

Please sign in to comment.