-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
45 lines (35 loc) · 1.7 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
44
45
Version := $(shell git describe --tags --dirty)
GitCommit := $(shell git rev-parse HEAD)
SATELLITE_LDFLAGS := "-extldflags '-static' -s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit)"
DOCKERFUSE_LDFLAGS := "-s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit)"
.PHONY: test quality_test all dockerfuse_satellite clean interactive_test
all: dockerfuse_satellite dockerfuse
dockerfuse_satellite_amd64: cmd/satellite/main.go cmd/satellite/server/server.go pkg/rpccommon/rpc_types.go pkg/rpccommon/utils.go
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a \
--ldflags $(SATELLITE_LDFLAGS) \
-o dockerfuse_satellite_amd64 ./cmd/satellite/main.go
dockerfuse_satellite_arm64: cmd/satellite/main.go cmd/satellite/server/server.go pkg/rpccommon/rpc_types.go pkg/rpccommon/utils.go
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a \
--ldflags $(SATELLITE_LDFLAGS) \
-o dockerfuse_satellite_arm64 ./cmd/satellite/main.go
dockerfuse_satellite: dockerfuse_satellite_amd64 dockerfuse_satellite_arm64
dockerfuse: cmd/dockerfuse/main.go cmd/dockerfuse/client/client.go cmd/dockerfuse/client/dockerfuse_fs.go pkg/rpccommon/rpc_types.go pkg/rpccommon/utils.go
env CGO_ENABLED=0 go build -a \
--ldflags $(DOCKERFUSE_LDFLAGS) \
-o dockerfuse ./cmd/dockerfuse/main.go
clean:
rm -f dockerfuse_satellite_amd64 dockerfuse_satellite_arm64 dockerfuse
test:
go test ./...
quality_test:
go vet ./...
go test ./... -cover
golint ./...
gocyclo -top 10 -avg .
interactive_test: all
docker kill dockerfuse-test || true
docker run -d --rm --name dockerfuse-test alpine:latest sleep inf
umount tmp || true
./dockerfuse -i dockerfuse-test -m ./tmp
umount tmp || true
docker kill dockerfuse-test || true