make: check submodules before configuring

CMakePresets.json includes the gin toolchain presets, so configuring
fails with a bare "File not found" when the submodules are missing or a
git submodule update is in flight. Report the missing path and the fix
instead.
This commit is contained in:
Armin 2026-10-03 17:49:24 +02:00
commit 70c2b83798

View file

@ -3,7 +3,7 @@
# bundles into ~/Library/Audio/Plug-Ins and the factory resources into # bundles into ~/Library/Audio/Plug-Ins and the factory resources into
# /Library/Audio/Presets (see the PRESET_ROOT note below). # /Library/Audio/Presets (see the PRESET_ROOT note below).
.PHONY: all configure build clean install uninstall uninstall-system pkg .PHONY: all configure check-submodules build clean install uninstall uninstall-system pkg
PRESET ?= $(shell \ PRESET ?= $(shell \
if command -v xcodebuild >/dev/null 2>&1 && xcodebuild -version >/dev/null 2>&1; then \ if command -v xcodebuild >/dev/null 2>&1 && xcodebuild -version >/dev/null 2>&1; then \
@ -21,6 +21,14 @@ CACHE = $(BUILD_DIR)/CMakeCache.txt
ARTEFACTS = $(BUILD_DIR)/$(PLUGIN)_artefacts/$(CONFIG) ARTEFACTS = $(BUILD_DIR)/$(PLUGIN)_artefacts/$(CONFIG)
STAGE = $(BUILD_DIR)/install-stage STAGE = $(BUILD_DIR)/install-stage
SUBMODULE_FILES = modules/gin/ci/toolchains/base.json \
modules/gin/ci/toolchains/xcode.json \
modules/juce/CMakeLists.txt
# CMakePresets.json includes the gin toolchain presets, so configuring dies with
# a bare "File not found" if the submodules are missing or mid-update.
SUBMODULE_GUARD = for f in $(SUBMODULE_FILES); do test -e "$$f" || { echo "Missing $$f"; echo "Run: git submodule update --init --recursive"; exit 1; }; done
# Bundles go in the user directory so no sudo is needed and hosts prefer them. # Bundles go in the user directory so no sudo is needed and hosts prefer them.
PLUGIN_ROOT = $(HOME)/Library/Audio/Plug-Ins PLUGIN_ROOT = $(HOME)/Library/Audio/Plug-Ins
@ -34,7 +42,12 @@ all: build
configure: $(CACHE) configure: $(CACHE)
check-submodules:
@$(SUBMODULE_GUARD)
@echo "Submodules look complete."
$(CACHE): $(CACHE):
@$(SUBMODULE_GUARD)
cmake --preset $(PRESET) cmake --preset $(PRESET)
build: $(CACHE) build: $(CACHE)