-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
45 lines (34 loc) · 981 Bytes
/
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
44
45
# Makefile
MyBuildNumber=$(shell date +%y%j)
MyVersion=0.9.$(MyBuildNumber)
Packages=\
./vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive\
./vendor/github.com/billziss-gh/objfs.pkg/objio/dropbox
ifeq ($(OS),Windows_NT)
PathSep=\$(strip)
else
PathSep=/
endif
.PHONY: default
default: build
.PHONY: generate
generate:
go generate ./...
.PHONY: build
build: registry.go
go build -ldflags "-s -w -X \"main.MyVersion=$(MyVersion)\""
.PHONY: racy
racy: registry.go
go build -race -ldflags "-s -w -X \"main.MyVersion=$(MyVersion)-racy\""
.PHONY: debug
debug: registry.go
go build -race -tags debug -gcflags all="-N -l"
registry.go: registry.go.in Makefile
go run _tools/listtool.go registry.go.in $(Packages) > registry.go
.PHONY: manpage
manpage: $(patsubst %.1.asciidoc,%.1,$(wildcard *.1.asciidoc))
%.1: %.1.asciidoc
asciidoctor -b manpage *.1.asciidoc
.PHONY: test
test:
_tools$(PathSep)run-tests -count=1 ./... ./vendor/github.com/billziss-gh/objfs.pkg/...