-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (35 loc) · 957 Bytes
/
Makefile
File metadata and controls
41 lines (35 loc) · 957 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
.PHONY: test run build clean validate
# Run tests
test:
@echo "Running tests..."
go test -v
# Run the program
run:
@echo "Running program..."
go run main.go
# Build the program
build:
@echo "Building program..."
go build -o bin/main main.go
# Clean build artifacts
clean:
@echo "Cleaning..."
rm -rf bin/
# Validate implementation (run tests and check if they pass)
validate:
@echo "Validating implementation..."
@if go test -v; then \
echo "✅ All tests passed! Implementation is correct."; \
else \
echo "❌ Some tests failed. Keep working on the implementation."; \
exit 1; \
fi
# Show help
help:
@echo "Available commands:"
@echo " make test - Run tests"
@echo " make run - Run the program"
@echo " make build - Build the program"
@echo " make clean - Clean build artifacts"
@echo " make validate - Validate implementation (run tests and check status)"
@echo " make help - Show this help message"