-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (37 loc) · 835 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
# Variables
BINARY_NAME = zk-graph
CMD_DIR = ./cmd/zk-graph
PKG_DIR = ./pkg
OUTPUT_DIR = ./out
# Default target
.PHONY: all
all: build
# Build the project
.PHONY: build
build:
@echo "Building the project..."
go build -o $(BINARY_NAME) $(CMD_DIR)
# Run tests
.PHONY: test
test:
@echo "Running tests..."
go test ./...
# Clean up generated files and binary
.PHONY: clean
clean:
@echo "Cleaning up..."
rm -f $(BINARY_NAME)
find $(OUTPUT_DIR) -type f -name '*.html' -delete
# Build and then run tests
.PHONY: build-and-test
build-and-test: build test
# Install the project binary (optional)
.PHONY: install
install: build
@echo "Installing binary..."
mv $(BINARY_NAME) /usr/local/bin/
# Remove installed binary (if installed)
.PHONY: uninstall
uninstall:
@echo "Uninstalling binary..."
rm -f /usr/local/bin/$(BINARY_NAME)