chromaflock/Makefile

85 lines
2.8 KiB
Makefile
Raw Permalink Normal View History

2026-07-13 20:57:38 +02:00
# ChromaFlock — Makefile wrapping CMake
# Usage:
# make — configure (if needed) + build Release
# make debug — configure + build Debug
# make clean — remove build directory
# make rebuild — clean + build Release
# make install — build + copy plugins to system dirs (make itself never installs)
2026-07-13 20:57:38 +02:00
# make run — build Standalone and launch
# make help — show help
2026-07-13 20:57:38 +02:00
BUILD_DIR := build
BUILD_TYPE := Release
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
UNAME_S := $(shell uname -s)
# Platform-aware CPU count
ifeq ($(UNAME_S),Darwin)
JOBS := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 4)
else
JOBS := $(shell nproc 2>/dev/null || echo 4)
endif
2026-07-13 20:57:38 +02:00
# Artefact paths
ifeq ($(UNAME_S),Darwin)
APP := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/Standalone/ChromaFlock.app
else
APP := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/Standalone/ChromaFlock
endif
2026-07-13 20:57:38 +02:00
.PHONY: all debug release clean rebuild configure install run help
all: release
release:
2026-07-13 20:57:38 +02:00
@cmake -B $(BUILD_DIR) $(CMAKE_FLAGS)
@cmake --build $(BUILD_DIR) --config $(BUILD_TYPE) -j$(JOBS)
debug:
@cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Debug
@cmake --build $(BUILD_DIR) --config Debug -j$(JOBS)
2026-07-13 20:57:38 +02:00
configure:
@cmake -B $(BUILD_DIR) $(CMAKE_FLAGS)
clean:
2026-07-14 13:56:34 +02:00
@rm -rvf $(BUILD_DIR)
2026-07-13 20:57:38 +02:00
rebuild: clean all
install: all
ifeq ($(UNAME_S),Darwin)
@mkdir -p "$(HOME)/Library/Audio/Plug-Ins/VST3" "$(HOME)/Library/Audio/Plug-Ins/Components"
@rm -rf "$(HOME)/Library/Audio/Plug-Ins/VST3/ChromaFlock.vst3"
@cp -R "$(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/VST3/ChromaFlock.vst3" "$(HOME)/Library/Audio/Plug-Ins/VST3/"
@rm -rf "$(HOME)/Library/Audio/Plug-Ins/Components/ChromaFlock.component"
@cp -R "$(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/AU/ChromaFlock.component" "$(HOME)/Library/Audio/Plug-Ins/Components/"
@echo "Installed VST3 to ~/Library/Audio/Plug-Ins/VST3/"
@echo "Installed AU to ~/Library/Audio/Plug-Ins/Components/"
else ifeq ($(UNAME_S),Linux)
@mkdir -p $(HOME)/.vst3
@rm -rf $(HOME)/.vst3/ChromaFlock.vst3
@cp -r $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/VST3/ChromaFlock.vst3 $(HOME)/.vst3/
@echo "Installed ChromaFlock.vst3 to ~/.vst3/"
else
@echo "Install paths unknown for this platform."
endif
2026-07-13 20:57:38 +02:00
run: release
ifeq ($(UNAME_S),Darwin)
open "$(APP)"
else
"$(APP)" &
endif
2026-07-13 20:57:38 +02:00
help:
@echo "ChromaFlock Makefile"
@echo ""
@echo " make — Build Release (VST3/Standalone)"
2026-07-13 20:57:38 +02:00
@echo " make debug — Build Debug"
@echo " make clean — Remove build/"
@echo " make rebuild — Clean + Build Release"
@echo " make configure — Run CMake configure only"
@echo " make install — Install VST3 + AU to system dirs"
2026-07-13 20:57:38 +02:00
@echo " make run — Build and launch Standalone app"
@echo " make help — This message"