-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# make command will take additional argument string as MKARGS
# e.g., make test-race MKARGS="-timeout 180s"
# folder name of the package of interest
PKGNAME = raft
MKARGS = -timeout 3600s
.PHONY: build final checkpoint all final-race checkpoint-race all-race clean docs
.SILENT: build final checkpoint all final-race checkpoint-race all-race clean docs
# compile the package
build:
cd src/$(PKGNAME); go build $(PKGNAME).go
# run tests on the package
final: build
cd src/$(PKGNAME); go test -v $(MKARGS) -run Final
checkpoint: build
cd src/$(PKGNAME); go test -v $(MKARGS) -run Checkpoint
Setup: build
cd src/$(PKGNAME); go test -v $(MKARGS) -run TestCheckpoint_Setup
all: build
cd src/$(PKGNAME); go test -v $(MKARGS)
final-race: build
cd src/$(PKGNAME); go test -v $(MKARGS) -race -run Final
checkpoint-race: build
cd src/$(PKGNAME); go test -v $(MKARGS) -race -run Checkpoint
all-race: build
cd src/$(PKGNAME); go test -v $(MKARGS) -race
# delete executable and docs, leaving only source
clean:
rm -rf src/$(PKGNAME)/$(PKGNAME) src/$(PKGNAME)/$(PKGNAME)-doc.txt
# generate documentation for the package
docs:
cd src/$(PKGNAME); go doc -u -all > $(PKGNAME)-doc.txt