-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 889 Bytes
/
Makefile
File metadata and controls
44 lines (33 loc) · 889 Bytes
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
.PHONY: proto build clean run-meta run-datanode run-client test fmt lint
BINARY_DIR=bin
PROTO_DIR=proto
GO=go
# Build all binaries
build: proto
$(GO) build -o $(BINARY_DIR)/metaserver ./cmd/metaserver
$(GO) build -o $(BINARY_DIR)/datanode ./cmd/datanode
$(GO) build -o $(BINARY_DIR)/sentinelfs ./cmd/client
# Generate protobuf code
proto:
protoc --go_out=. --go-grpc_out=. $(PROTO_DIR)/sentinelfs.proto
# Run components
run-meta:
$(GO) run ./cmd/metaserver --port 9000
run-datanode:
$(GO) run ./cmd/datanode --meta-addr localhost:9000 --port 9001 --data-dir ./data/node1
run-client:
$(GO) run ./cmd/client
# Testing
test:
$(GO) test ./... -v -count=1
test-cover:
$(GO) test ./... -coverprofile=coverage.out
$(GO) tool cover -html=coverage.out
# Code quality
fmt:
$(GO) fmt ./...
lint:
golangci-lint run ./...
# Cleanup
clean:
rm -rf $(BINARY_DIR) data/ coverage.out