-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 933 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
########################################
# cfs
########################################
ORG_PATH:=github.com/c-fs
REPO_PATH:=$(ORG_PATH)/cfs
$(eval TEST := $(shell cd ../../.. && find $(REPO_PATH) -name '*_test.go' | xargs -L 1 dirname | uniq | sort))
.PHONY: build
# TODO
.PHONY: test
test: go-vet build
go test -p 8 -race $(TEST)
.PHONY: go-vet
go-vet:
@find . -name '*.go' | xargs -L 1 go tool vet
.PHONY: proto
proto:
protoc -I proto proto/*.proto --go_out=plugins=grpc:proto
.PHONY: docker
docker:
# Static binary built here may fail to call os/user/lookup functions due to library
# conflict. (http://stackoverflow.com/questions/8140439/why-would-it-be-impossible-to-fully-statically-link-an-application)
# Because cfs doesn't use these functions, it is ok to ignore the error.
go build -a -tags netgo -installsuffix netgo --ldflags '-extldflags "-static"' -o cfs ${REPO_PATH}/server
docker build -t c-fs/cfs .