-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (52 loc) · 1.5 KB
/
Makefile
File metadata and controls
62 lines (52 loc) · 1.5 KB
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
53
54
55
56
57
58
59
60
61
62
.PHONY: build clean generate run test
# Variables
BINARY_NAME=pkl-docgen
OUTPUT_DIR=./docs
STATIC_DIR=./web
MAIN_PATH=./cmd/pkl-docgen
# Default target
all: clean generate build
# Generate templ code
generate:
@echo "Generating templ code..."
templ generate
# Build the binary
build: generate
@echo "Building $(BINARY_NAME)..."
go build -o $(BINARY_NAME) $(MAIN_PATH)
# Clean build artifacts
clean:
@echo "Cleaning..."
rm -f $(BINARY_NAME)
rm -rf $(OUTPUT_DIR)
# Run the tool with a sample module
run: build
@echo "Running $(BINARY_NAME)..."
./$(BINARY_NAME) -output-dir=$(OUTPUT_DIR) -static-dir=$(STATIC_DIR) $(MODULE_PATH)
# Install dependencies
deps:
@echo "Installing dependencies..."
go get github.com/apple/pkl-go/pkl@v0.10.0
go get github.com/a-h/templ
# Run tests
test:
@echo "Running tests..."
go test ./...
# Install the binary
install: build
@echo "Installing $(BINARY_NAME)..."
go install $(MAIN_PATH)
# Help command
help:
@echo "Available commands:"
@echo " make - Build the project (clean, generate, build)"
@echo " make generate - Generate templ code"
@echo " make build - Build the binary"
@echo " make clean - Clean build artifacts"
@echo " make run - Run the tool (requires MODULE_PATH=path/to/module.pkl)"
@echo " make deps - Install dependencies"
@echo " make test - Run tests"
@echo " make install - Install the binary"
@echo ""
@echo "Example usage:"
@echo " make run MODULE_PATH=./examples/config.pkl"