1
0
basics/clap/Makefile
2025-07-01 11:55:12 +01:00

52 lines
1.6 KiB
Makefile

.PHONY: build build-emscripten emsdk
PROJECT := plugins
PLUGIN := basics
CMAKE_PARAMS := -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=.. -G Xcode # -DCMAKE_BUILD_TYPE=Release
mac-installer: mac-installer-$(PLUGIN)
clean:
rm -rf out
build:
cmake . -B out/build $(CMAKE_PARAMS)
release-%: build
cmake --build out/build --target $* --config Release
mac-installer-%: release-%_vst3 release-%_clap emscripten-%_wclap
../stfx/front-end/clap/mac/make-pkg-installer.sh out/$*.pkg $* uk.co.signalsmith.installer.stfx.$* out/Release/$*
####### Emscripten #######
# based on https://stunlock.gg/posts/emscripten_with_cmake/
CURRENT_DIR := $(shell pwd)
EMSDK ?= $(CURRENT_DIR)/emsdk
EMSDK_ENV = unset CMAKE_TOOLCHAIN_FILE; EMSDK_QUIET=1 . "$(EMSDK)/emsdk_env.sh";
emsdk:
@ if ! test -d "$(EMSDK)" ;\
then \
echo "SDK not found - cloning from Github" ;\
git clone https://github.com/emscripten-core/emsdk.git "$(EMSDK)" ;\
cd "$(EMSDK)" && git pull && ./emsdk install latest && ./emsdk activate latest ;\
$(EMSDK_ENV) emcc --check && python3 --version && cmake --version ;\
fi
build-emscripten: emsdk
$(EMSDK_ENV) emcmake cmake . -B out/build-emscripten -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../Release -DCMAKE_BUILD_TYPE=Release
emscripten-%: build-emscripten
$(EMSDK_ENV) cmake --build out/build-emscripten --target $* --config Release
####### Dev stuff #######
format:
find source -iname \*.cpp -o -iname \*.h | xargs clang-format -i
dev: release-$(PLUGIN)_clap
/Applications/REAPER.app/Contents/MacOS/REAPER REAPER/$(PLUGIN)/$(PLUGIN).RPP
wclap: emscripten-$(PLUGIN)_wclap
./wclap-tar.sh out/Release/$(PLUGIN).wclap out/