-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (43 loc) · 986 Bytes
/
Makefile
File metadata and controls
52 lines (43 loc) · 986 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
45
46
47
48
49
50
51
52
SHELL := /bin/bash
APP_NAME := goolean
BIN_DIR := bin
ENTRY_PATH := .
PROTO_FILES = api/document.proto api/query.proto api/file.proto
.PHONY: deps
deps:
@echo "Installing dependencies..."
go mod tidy
.PHONY: test
test: deps
@echo "Running tests..."
go test ./... -v
.PHONY: run
run: fmt deps
@echo "Running the application..."
go run $(ENTRY_PATH)
.PHONY: proto
proto:
@echo "Compiling proto files..."
rm -rf internal/transport/*.pb.go
protoc \
--go_out=. \
--go_opt=module=github.com/CS80-Team/Goolean \
--go-grpc_out=. \
--go-grpc_opt=module=github.com/CS80-Team/Goolean \
$(PROTO_FILES)
.PHONY: build
build: proto clean deps fmt test
@echo "Building the application..."
go build -o $(BIN_DIR)/$(APP_NAME) $(ENTRY_PATH)
.PHONY: clean
clean:
@echo "Cleaning up..."
rm -rf $(BIN_DIR)
.PHONY: fmt
fmt:
@echo "Formatting code..."
gofmt -w .
.PHONY: run_service
run_service: build
@echo "Starting the service..."
$(BIN_DIR)/$(APP_NAME) -service $(IP):$(PORT)