-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (105 loc) · 3.41 KB
/
Makefile
File metadata and controls
122 lines (105 loc) · 3.41 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# The Puzzle Pits - Unified Build System
# All builds delegate to the Zig build system for consistency
.PHONY: all sdl nosdl clean help setup download-data run test debug info
.DEFAULT_GOAL := help
# Default build (with SDL2 - requires Nix environment)
all: sdl
# Build with SDL2 support (requires Nix dev environment or system SDL2)
sdl:
@echo "Building with SDL2 support..."
zig build
# Build without SDL2 (stub mode - works anywhere)
nosdl:
@echo "Building without SDL2 (stub mode)..."
zig build -Dsdl=false
# Complete setup: download game data and build
setup:
@echo "Setting up complete environment..."
zig build setup
# Download game data from archive.org
download-data:
@echo "Downloading game data..."
zig build download-data
# Clean all build artifacts
clean:
@echo "Cleaning build artifacts..."
zig build clean
# Run the main game
run: sdl
@echo "Running The Puzzle Pits..."
zig build run-pits
# Run the demo
run-demo: sdl
@echo "Running demo..."
zig build run-demo
# Run debug tests
test:
@echo "Running tests..."
zig build test-run
# Run comprehensive debug tests
debug:
@echo "Running debug tests..."
zig build debug-test
# Show build configuration info
info:
@echo "Build system information:"
zig build info
# Development targets for Nix users
nix-sdl:
@echo "Building with Nix + SDL2..."
nix develop --command zig build
nix-run:
@echo "Running with Nix environment..."
nix develop --command zig build run-pits
# Package builds using Nix
nix-build-sdl:
@echo "Building SDL package with Nix..."
nix build .#puzzle-pits-sdl
nix-build-nosdl:
@echo "Building no-SDL package with Nix..."
nix build .#puzzle-pits-nosdl
# Show help
help:
@echo "The Puzzle Pits - Unified Build System"
@echo ""
@echo "RECOMMENDED USAGE:"
@echo " make setup - Download game data and build with SDL2"
@echo " make run - Build and run the game"
@echo ""
@echo "BUILD TARGETS:"
@echo " make sdl - Build with SDL2 (requires Nix or system SDL2)"
@echo " make nosdl - Build without SDL2 (stub mode, works anywhere)"
@echo " make setup - Download data and build everything"
@echo " make clean - Clean all build artifacts"
@echo ""
@echo "RUN TARGETS:"
@echo " make run - Run the main game"
@echo " make run-demo - Run the demo"
@echo " make test - Run tests"
@echo " make debug - Run debug tests"
@echo ""
@echo "NIX TARGETS (recommended):"
@echo " make nix-sdl - Build with Nix environment"
@echo " make nix-run - Run with Nix environment"
@echo " make nix-build-sdl - Build SDL package with Nix"
@echo ""
@echo "DEVELOPMENT:"
@echo " make download-data - Download game assets from archive.org"
@echo " make info - Show build configuration"
@echo " make help - Show this help"
@echo ""
@echo "REQUIREMENTS:"
@echo " - Zig compiler"
@echo " - For SDL builds: Nix environment (recommended) or system SDL2"
@echo " - curl and unzip (for downloading game data)"
@echo ""
@echo "QUICK START:"
@echo " 1. nix develop # Enter Nix environment (recommended)"
@echo " 2. make setup # Download data and build"
@echo " 3. make run # Play the game!"
@echo ""
@echo " OR without Nix:"
@echo " 1. make nosdl # Build stub version"
@echo " 2. make download-data # Get game assets"
@echo ""
@echo "All builds use the Zig build system for consistency."