diff --git a/Makefile b/Makefile index f3d28fd..4401e80 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # bundles into ~/Library/Audio/Plug-Ins and the factory resources into # /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 \ 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) 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. PLUGIN_ROOT = $(HOME)/Library/Audio/Plug-Ins @@ -34,7 +42,12 @@ all: build configure: $(CACHE) +check-submodules: + @$(SUBMODULE_GUARD) + @echo "Submodules look complete." + $(CACHE): + @$(SUBMODULE_GUARD) cmake --preset $(PRESET) build: $(CACHE)