forked from sudip-mondal-2002/Amplitron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (50 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
63 lines (50 loc) · 1.84 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
# Makefile wrapper for Guitar Amp Simulator
# This wraps CMake for convenience. Use `make help` to see available targets.
BUILD_DIR := build
BUILD_TYPE ?= Release
CMAKE_FLAGS ?=
NPROC := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
.PHONY: all build clean rebuild install uninstall setup run help
all: build
setup:
@echo "=== Setting up dependencies ==="
@chmod +x scripts/setup_dependencies.sh 2>/dev/null || true
@scripts/setup_dependencies.sh
$(BUILD_DIR)/Makefile:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) $(CMAKE_FLAGS) ..
build: $(BUILD_DIR)/Makefile
@echo "=== Building Guitar Amp Simulator ($(BUILD_TYPE)) ==="
@cmake --build $(BUILD_DIR) --config $(BUILD_TYPE) -j$(NPROC)
@echo "=== Build complete ==="
@echo "Binary: $(BUILD_DIR)/amplitron"
clean:
@echo "=== Cleaning build directory ==="
@rm -rf $(BUILD_DIR)
rebuild: clean build
install: build
@echo "=== Installing ==="
@cmake --install $(BUILD_DIR) --prefix /usr/local
uninstall:
@echo "=== Uninstalling ==="
@rm -f /usr/local/bin/amplitron
run: build
@echo "=== Running Guitar Amp Simulator ==="
@./$(BUILD_DIR)/amplitron
debug:
@$(MAKE) BUILD_TYPE=Debug build
help:
@echo "Guitar Amp Simulator - Build Targets"
@echo "======================================"
@echo " make setup - Install dependencies (Linux/macOS)"
@echo " make build - Build the project (Release)"
@echo " make debug - Build the project (Debug)"
@echo " make clean - Remove build directory"
@echo " make rebuild - Clean + build"
@echo " make install - Install to /usr/local/bin"
@echo " make uninstall - Remove installed binary"
@echo " make run - Build and run"
@echo ""
@echo "Variables:"
@echo " BUILD_TYPE=Debug|Release (default: Release)"
@echo " CMAKE_FLAGS=... (extra CMake flags)"