Platform-aware Makefile: nproc on Linux, xdg-open, VST3 install to ~/.vst3

This commit is contained in:
Armin 2026-07-13 21:59:59 +02:00
commit 6ab3fa5d88

View file

@ -6,15 +6,22 @@
# make rebuild — clean + build Release # make rebuild — clean + build Release
# make install — build + copy plugins to system dirs # make install — build + copy plugins to system dirs
# make run — build Standalone and launch # make run — build Standalone and launch
# make help — show help
BUILD_DIR := build BUILD_DIR := build
BUILD_TYPE := Release BUILD_TYPE := Release
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
JOBS := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 4) 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
# Artefact paths # Artefact paths
VST3 := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/VST3/ChromaFlock.vst3 VST3 := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/VST3/ChromaFlock.vst3
AU := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/au/ChromaFlock.component
APP := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/Standalone/ChromaFlock.app APP := $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/Standalone/ChromaFlock.app
.PHONY: all debug release clean rebuild configure install run help .PHONY: all debug release clean rebuild configure install run help
@ -40,21 +47,35 @@ clean:
rebuild: clean all rebuild: clean all
install: all install: all
ifeq ($(UNAME_S),Darwin)
@echo "Plugins were copied to system folders by CMAKE_COPY_PLUGIN_AFTER_BUILD." @echo "Plugins were copied to system folders by CMAKE_COPY_PLUGIN_AFTER_BUILD."
@echo "VST3: ~/Library/Audio/Plug-Ins/VST3/" @echo "VST3: ~/Library/Audio/Plug-Ins/VST3/"
@echo "AU: ~/Library/Audio/Plug-Ins/Components/" @echo "AU: ~/Library/Audio/Plug-Ins/Components/"
else ifeq ($(UNAME_S),Linux)
@echo "VST3: ~/.vst3/"
@echo "Standalone: $(APP)"
@mkdir -p ~/.vst3
@cp -r $(BUILD_DIR)/ChromaFlock_artefacts/$(BUILD_TYPE)/VST3/ChromaFlock.vst3 ~/.vst3/
@echo "Installed ChromaFlock.vst3 to ~/.vst3/"
else
@echo "Install paths unknown for this platform."
endif
run: $(APP) run: $(APP)
open $(APP) ifeq ($(UNAME_S),Darwin)
open "$(APP)"
else
xdg-open "$(APP)" 2>/dev/null || "$(APP)/Contents/Linux/ChromaFlock" &
endif
help: help:
@echo "ChromaFlock Makefile" @echo "ChromaFlock Makefile"
@echo "" @echo ""
@echo " make — Build Release (VST3/AU/Standalone)" @echo " make — Build Release (VST3/Standalone)"
@echo " make debug — Build Debug" @echo " make debug — Build Debug"
@echo " make clean — Remove build/" @echo " make clean — Remove build/"
@echo " make rebuild — Clean + Build Release" @echo " make rebuild — Clean + Build Release"
@echo " make configure — Run CMake configure only" @echo " make configure — Run CMake configure only"
@echo " make install — Show plugin install paths" @echo " make install — Install VST3 to system dir"
@echo " make run — Build and launch Standalone app" @echo " make run — Build and launch Standalone app"
@echo " make help — This message" @echo " make help — This message"