-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (42 loc) · 1.44 KB
/
Makefile
File metadata and controls
50 lines (42 loc) · 1.44 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
# Define the output directory and binary name
OUTPUT_DIR := dist
BINARY_NAME := wow-build-tools
# Define the build command
build:
mkdir -p $(OUTPUT_DIR)
go build -o $(OUTPUT_DIR)/$(BINARY_NAME)
GOARCH=amd64 GOOS=windows go build -o $(OUTPUT_DIR)/$(BINARY_NAME).exe
# Define the clean command
clean:
rm -rf $(OUTPUT_DIR)
# Define the run command
run: build
./$(OUTPUT_DIR)/$(BINARY_NAME)
release:
@cp -f ./$(OUTPUT_DIR)/$(BINARY_NAME) ~/bin/$(BINARY_NAME)
@cp -f ./$(OUTPUT_DIR)/$(BINARY_NAME).exe /mnt/c/Users/robpa/bin/$(BINARY_NAME).exe
tools:
@echo "Installing Go tools..."
@cat go.tools | xargs -n1 go install -v
@echo "Checking for jq (required by scripts/test.sh)..."
@if command -v jq >/dev/null 2>&1; then \
echo "✓ jq is already installed"; \
echo "✓ Tools installed"; \
else \
echo "✗ jq not found on PATH."; \
echo " jq is required by scripts/test.sh."; \
echo " Please install jq using your package manager, for example:"; \
echo " macOS (Homebrew): brew install jq"; \
echo " Debian/Ubuntu: sudo apt-get update && sudo apt-get install -y jq"; \
echo " Fedora/RHEL/CentOS: sudo dnf install -y jq"; \
echo " Arch Linux: sudo pacman -S jq"; \
echo " Windows (choco): choco install jq"; \
echo " Windows (scoop): scoop install jq"; \
exit 1; \
fi
CC_THRESHOLD = 10
test:
@CC_THRESHOLD=$(CC_THRESHOLD) ./scripts/test.sh
# Define the default target
.PHONY: all
all: build