diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ec2ef2..1188bb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build on: [push, pull_request] env: - CACHE_VERSION: 2 + CACHE_VERSION: 3 CARDINAL_UNDER_WINE: 1 CIBUILD: true EMSCRIPTEN_VERSION: 3.1.27 diff --git a/Makefile b/Makefile index d5b371b..23adb6f 100644 --- a/Makefile +++ b/Makefile @@ -4,17 +4,18 @@ # Created by falkTX # +ROOT = . +include $(ROOT)/Makefile.base.mk + +# ----------------------------------------------------------------------------- +# Set version + # also set in: # jucewrapper/CMakeLists.txt `project` # src/CardinalCommon.cpp `CARDINAL_VERSION` # src/CardinalPlugin.cpp `getVersion` VERSION = 23.04 -# -------------------------------------------------------------- -# Import base definitions - -include dpf/Makefile.base.mk - # -------------------------------------------------------------- # Build targets @@ -26,20 +27,6 @@ all: cardinal carla deps dgl plugins gen resources PREFIX ?= /usr/local DESTDIR ?= -ifeq ($(BSD),true) -SYSDEPS ?= true -else -SYSDEPS ?= false -endif - -ifeq ($(LINUX),true) -VST3_SUPPORTED = true -else ifeq ($(MACOS),true) -VST3_SUPPORTED = true -else ifeq ($(WINDOWS),true) -VST3_SUPPORTED = true -endif - # -------------------------------------------------------------- # Carla config @@ -56,17 +43,6 @@ ifneq ($(DEBUG),true) CARLA_EXTRA_ARGS += EXTERNAL_PLUGINS=true endif -# -------------------------------------------------------------- -# DGL config - -DGL_EXTRA_ARGS = \ - DISTRHO_NAMESPACE=CardinalDISTRHO \ - DGL_NAMESPACE=CardinalDGL \ - NVG_DISABLE_SKIPPING_WHITESPACE=true \ - NVG_FONT_TEXTURE_FLAGS=NVG_IMAGE_NEAREST \ - USE_NANOVG_FBO=true \ - WINDOWS_ICON_ID=401 - # -------------------------------------------------------------- # Check for required system-wide dependencies @@ -278,10 +254,10 @@ install: install -d $(DESTDIR)$(PREFIX)/lib/lv2/CardinalSynth.lv2 install -d $(DESTDIR)$(PREFIX)/lib/clap/Cardinal.clap install -d $(DESTDIR)$(PREFIX)/lib/vst/Cardinal.vst -ifeq ($(VST3_SUPPORTED),true) - install -d $(DESTDIR)$(PREFIX)/lib/vst3/Cardinal.vst3/Contents - install -d $(DESTDIR)$(PREFIX)/lib/vst3/CardinalFX.vst3/Contents - install -d $(DESTDIR)$(PREFIX)/lib/vst3/CardinalSynth.vst3/Contents +ifneq ($(VST3_BINARY_DIR),) + install -d $(DESTDIR)$(PREFIX)/lib/vst3/Cardinal.vst3/$(VST3_BINARY_DIR) + install -d $(DESTDIR)$(PREFIX)/lib/vst3/CardinalFX.vst3/$(VST3_BINARY_DIR) + install -d $(DESTDIR)$(PREFIX)/lib/vst3/CardinalSynth.vst3/$(VST3_BINARY_DIR) endif install -d $(DESTDIR)$(PREFIX)/share/cardinal install -d $(DESTDIR)$(PREFIX)/share/doc/cardinal/docs @@ -293,10 +269,10 @@ endif install -m 644 bin/Cardinal.clap/*.* $(DESTDIR)$(PREFIX)/lib/clap/Cardinal.clap/ install -m 644 bin/Cardinal.vst/*.* $(DESTDIR)$(PREFIX)/lib/vst/Cardinal.vst/ -ifeq ($(VST3_SUPPORTED),true) - cp -rL bin/Cardinal.vst3/Contents/*-* $(DESTDIR)$(PREFIX)/lib/vst3/Cardinal.vst3/Contents/ - cp -rL bin/CardinalFX.vst3/Contents/*-* $(DESTDIR)$(PREFIX)/lib/vst3/CardinalFX.vst3/Contents/ - cp -rL bin/CardinalSynth.vst3/Contents/*-* $(DESTDIR)$(PREFIX)/lib/vst3/CardinalSynth.vst3/Contents/ +ifneq ($(VST3_BINARY_DIR),) + install -m 644 bin/Cardinal.vst3/$(VST3_BINARY_DIR)/* $(DESTDIR)$(PREFIX)/lib/vst3/Cardinal.vst3/$(VST3_BINARY_DIR)/ + install -m 644 bin/CardinalFX.vst3/$(VST3_BINARY_DIR)/* $(DESTDIR)$(PREFIX)/lib/vst3/CardinalFX.vst3/$(VST3_BINARY_DIR)/ + install -m 644 bin/CardinalSynth.vst3/$(VST3_BINARY_DIR)/* $(DESTDIR)$(PREFIX)/lib/vst3/CardinalSynth.vst3/$(VST3_BINARY_DIR)/ endif install -m 755 bin/Cardinal$(APP_EXT) $(DESTDIR)$(PREFIX)/bin/ diff --git a/Makefile.base.mk b/Makefile.base.mk new file mode 100644 index 0000000..cfbdad8 --- /dev/null +++ b/Makefile.base.mk @@ -0,0 +1,47 @@ +#!/usr/bin/make -f +# Makefile for Cardinal # +# --------------------- # +# Created by falkTX +# + +ifeq ($(ROOT),) +$(error invalid usage) +endif + +# ----------------------------------------------------------------------------- +# Import base definitions + +DISTRHO_NAMESPACE = CardinalDISTRHO +DGL_NAMESPACE = CardinalDGL +NVG_DISABLE_SKIPPING_WHITESPACE = true +NVG_FONT_TEXTURE_FLAGS = NVG_IMAGE_NEAREST +USE_NANOVG_FBO = true +WASM_EXCEPTIONS = true +WINDOWS_ICON_ID = 401 +include $(ROOT)/dpf/Makefile.base.mk + +DGL_EXTRA_ARGS = \ + DISTRHO_NAMESPACE=$(DISTRHO_NAMESPACE) \ + DGL_NAMESPACE=$(DGL_NAMESPACE) \ + NVG_DISABLE_SKIPPING_WHITESPACE=$(NVG_DISABLE_SKIPPING_WHITESPACE) \ + NVG_FONT_TEXTURE_FLAGS=$(NVG_FONT_TEXTURE_FLAGS) \ + USE_NANOVG_FBO=$(USE_NANOVG_FBO) \ + WASM_EXCEPTIONS=$(WASM_EXCEPTIONS) \ + WINDOWS_ICON_ID=$(WINDOWS_ICON_ID) + +# ----------------------------------------------------------------------------- +# Build config + +ifeq ($(BSD),true) +SYSDEPS ?= true +else +SYSDEPS ?= false +endif + +ifeq ($(SYSDEPS),true) +RACK_DEP_PATH = $(abspath $(ROOT)/dep/sysroot) +else +RACK_DEP_PATH = $(abspath $(ROOT)/src/Rack/dep) +endif + +# ----------------------------------------------------------------------------- diff --git a/carla b/carla index cf11562..44c6615 160000 --- a/carla +++ b/carla @@ -1 +1 @@ -Subproject commit cf11562c505407f12a6e6d085ca448fefd7399ba +Subproject commit 44c6615f2a0c9c656d946b5f95a2502e72cc5f00 diff --git a/deps/Makefile b/deps/Makefile index 60f1155..ebe130c 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -4,29 +4,8 @@ # Created by falkTX # -# -------------------------------------------------------------- -# Import base definitions - -DISTRHO_NAMESPACE = CardinalDISTRHO -DGL_NAMESPACE = CardinalDGL -USE_NANOVG_FBO = true -WASM_EXCEPTIONS = true -include ../dpf/Makefile.base.mk - -# -------------------------------------------------------------- -# Build config - -ifeq ($(BSD),true) -SYSDEPS ?= true -else -SYSDEPS ?= false -endif - -ifeq ($(SYSDEPS),true) -DEP_PATH = $(abspath sysroot) -else -DEP_PATH = $(abspath ../src/Rack/dep) -endif +ROOT = .. +include $(ROOT)/Makefile.base.mk # -------------------------------------------------------------- # custom build flags @@ -110,7 +89,7 @@ SPACE += CMAKE = cmake CMAKE += -DCMAKE_INSTALL_LIBDIR=lib -CMAKE += -DCMAKE_INSTALL_PREFIX='$(DEP_PATH)' +CMAKE += -DCMAKE_INSTALL_PREFIX='$(RACK_DEP_PATH)' CMAKE += -DBUILD_SHARED_LIBS=OFF # make sure debug/release matches @@ -184,7 +163,7 @@ endif # Fix up configure CONFIGURE = ./configure -CONFIGURE += --prefix="$(DEP_PATH)" +CONFIGURE += --prefix="$(RACK_DEP_PATH)" CONFIGURE += --host=$(TARGET_MACHINE) CONFIGURE += --enable-static CONFIGURE += --disable-shared @@ -226,58 +205,58 @@ DEP_MAKE2 += CONFIGURE="$(ENV) $(CONFIGURE)" # -------------------------------------------------------------- # Rack internal dependencies target -$(DEP_PATH)/lib/%.a: - $(DEP_MAKE2) -C $(DEP_PATH) lib/$*.a +$(RACK_DEP_PATH)/lib/%.a: + $(DEP_MAKE2) -C $(RACK_DEP_PATH) lib/$*.a -$(DEP_PATH)/jansson-2.12: - $(DEP_MAKE2) -C $(DEP_PATH) jansson-2.12 +$(RACK_DEP_PATH)/jansson-2.12: + $(DEP_MAKE2) -C $(RACK_DEP_PATH) jansson-2.12 # libarchive: skip shared lib and ensure libzstd is enabled -$(DEP_PATH)/lib/libarchive.a: $(DEP_PATH)/lib/libzstd.a $(DEP_PATH)/libarchive-3.4.3/.stamp-patched +$(RACK_DEP_PATH)/lib/libarchive.a: $(RACK_DEP_PATH)/lib/libzstd.a $(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched -$(DEP_PATH)/lib/libarchive_static.a: $(DEP_PATH)/lib/libzstd.a $(DEP_PATH)/libarchive-3.4.3/.stamp-patched +$(RACK_DEP_PATH)/lib/libarchive_static.a: $(RACK_DEP_PATH)/lib/libzstd.a $(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched -$(DEP_PATH)/libarchive-3.4.3/.stamp-patched: - $(DEP_MAKE2) -C $(DEP_PATH) libarchive-3.4.3 - sed -i -e "618,625d" $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt - awk 'NR==616{print " SET(HAVE_LIBZSTD 1)"}1' $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt > $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2 - mv $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2 $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt - sed -i -e "238,243d" $(DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt - sed -i -e "s/TARGETS archive archive_static/TARGETS archive_static/" $(DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt +$(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched: + $(DEP_MAKE2) -C $(RACK_DEP_PATH) libarchive-3.4.3 + sed -i -e "618,625d" $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt + awk 'NR==616{print " SET(HAVE_LIBZSTD 1)"}1' $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt > $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2 + mv $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2 $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt + sed -i -e "238,243d" $(RACK_DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt + sed -i -e "s/TARGETS archive archive_static/TARGETS archive_static/" $(RACK_DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt touch $@ # libsamplerate: skip tests, fails to build in some systems and are not needed or wanted anyway -$(DEP_PATH)/lib/libsamplerate.a: $(DEP_PATH)/libsamplerate-0.1.9/.stamp-patched +$(RACK_DEP_PATH)/lib/libsamplerate.a: $(RACK_DEP_PATH)/libsamplerate-0.1.9/.stamp-patched -$(DEP_PATH)/libsamplerate-0.1.9/.stamp-patched: - $(DEP_MAKE2) -C $(DEP_PATH) libsamplerate-0.1.9 - sed -i -e "s/src doc examples tests/src/" $(DEP_PATH)/libsamplerate-0.1.9/Makefile.in +$(RACK_DEP_PATH)/libsamplerate-0.1.9/.stamp-patched: + $(DEP_MAKE2) -C $(RACK_DEP_PATH) libsamplerate-0.1.9 + sed -i -e "s/src doc examples tests/src/" $(RACK_DEP_PATH)/libsamplerate-0.1.9/Makefile.in touch $@ # libspeexdsp: hide symbols -$(DEP_PATH)/lib/libspeexdsp.a: $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched +$(RACK_DEP_PATH)/lib/libspeexdsp.a: $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched -$(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched: - $(DEP_MAKE2) -C $(DEP_PATH) speexdsp-SpeexDSP-1.2rc3 \ +$(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched: + $(DEP_MAKE2) -C $(RACK_DEP_PATH) speexdsp-SpeexDSP-1.2rc3 \ WGET="wget -c http://downloads.xiph.org/releases/speex/speexdsp-1.2rc3.tar.gz && mv speexdsp-1.2rc3.tar.gz speexdsp-SpeexDSP-1.2rc3.tgz #" \ SHA256SUM="true" \ - UNTAR="mkdir -p speexdsp-SpeexDSP-1.2rc3 && tar -x --strip-components=1 --directory=$(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 -f" - sed -i -e "s/#pragma GCC visibility push/#error we dont want this/" $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/configure + UNTAR="mkdir -p speexdsp-SpeexDSP-1.2rc3 && tar -x --strip-components=1 --directory=$(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 -f" + sed -i -e "s/#pragma GCC visibility push/#error we dont want this/" $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/configure touch $@ # custom zstd build for only building static libs -$(DEP_PATH)/lib/libzstd.a: $(DEP_PATH)/zstd-1.4.5/.stamp-patched - cd $(DEP_PATH)/zstd-1.4.5/build/cmake && $(CMAKE) -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_MULTITHREAD_SUPPORT=OFF . - $(DEP_MAKE2) -C $(DEP_PATH)/zstd-1.4.5/build/cmake - $(DEP_MAKE2) -C $(DEP_PATH)/zstd-1.4.5/build/cmake install +$(RACK_DEP_PATH)/lib/libzstd.a: $(RACK_DEP_PATH)/zstd-1.4.5/.stamp-patched + cd $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake && $(CMAKE) -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_MULTITHREAD_SUPPORT=OFF . + $(DEP_MAKE2) -C $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake + $(DEP_MAKE2) -C $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake install # zstd cmake is borked, see https://github.com/facebook/zstd/issues/1401 # zstd also fails to build on old systems, patch that too -$(DEP_PATH)/zstd-1.4.5/.stamp-patched: - $(DEP_MAKE2) -C $(DEP_PATH) zstd-1.4.5 - sed -i -e "56,66d" $(DEP_PATH)/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake - sed -i -e "146,175d" $(DEP_PATH)/zstd-1.4.5/programs/util.c - sed -i -e "142,144d" $(DEP_PATH)/zstd-1.4.5/programs/util.c +$(RACK_DEP_PATH)/zstd-1.4.5/.stamp-patched: + $(DEP_MAKE2) -C $(RACK_DEP_PATH) zstd-1.4.5 + sed -i -e "56,66d" $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake + sed -i -e "146,175d" $(RACK_DEP_PATH)/zstd-1.4.5/programs/util.c + sed -i -e "142,144d" $(RACK_DEP_PATH)/zstd-1.4.5/programs/util.c touch $@ # -------------------------------------------------------------- @@ -298,12 +277,12 @@ else ifeq ($(MACOS),true) QUICKJS_MAKE_FLAGS += CONFIG_DARWIN=y endif -$(DEP_PATH)/lib/libquickjs.a: +$(RACK_DEP_PATH)/lib/libquickjs.a: $(DEP_MAKE) $(QUICKJS_MAKE_FLAGS) -C $(CURDIR)/QuickJS - install -d $(DEP_PATH)/include - install -d $(DEP_PATH)/lib + install -d $(RACK_DEP_PATH)/include + install -d $(RACK_DEP_PATH)/lib install -m644 $(CURDIR)/QuickJS/libquickjs.a $@ - install -m644 $(CURDIR)/QuickJS/quickjs.h $(DEP_PATH)/include/quickjs.h + install -m644 $(CURDIR)/QuickJS/quickjs.h $(RACK_DEP_PATH)/include/quickjs.h # -------------------------------------------------------------- # SurgeXT target @@ -383,45 +362,45 @@ ifneq ($(NOPLUGINS),true) TARGETS += $(SURGE_LIB) endif -TARGETS += $(DEP_PATH)/lib/libjansson.a -TARGETS += $(DEP_PATH)/lib/libquickjs.a -TARGETS += $(DEP_PATH)/lib/libsamplerate.a -TARGETS += $(DEP_PATH)/lib/libspeexdsp.a +TARGETS += $(RACK_DEP_PATH)/lib/libjansson.a +TARGETS += $(RACK_DEP_PATH)/lib/libquickjs.a +TARGETS += $(RACK_DEP_PATH)/lib/libsamplerate.a +TARGETS += $(RACK_DEP_PATH)/lib/libspeexdsp.a ifeq ($(WINDOWS),true) -TARGETS += $(DEP_PATH)/lib/libarchive_static.a +TARGETS += $(RACK_DEP_PATH)/lib/libarchive_static.a else -TARGETS += $(DEP_PATH)/lib/libarchive.a +TARGETS += $(RACK_DEP_PATH)/lib/libarchive.a endif -TARGETS += $(DEP_PATH)/lib/libzstd.a +TARGETS += $(RACK_DEP_PATH)/lib/libzstd.a all: $(TARGETS) clean: $(DEP_MAKE) $(QUICKJS_MAKE_FLAGS) -C $(CURDIR)/QuickJS clean rm -f $(TARGETS) - rm -f $(DEP_PATH)/*.tgz - rm -f $(DEP_PATH)/*.tar.gz - rm -rf $(DEP_PATH)/bin - rm -rf $(DEP_PATH)/include - rm -rf $(DEP_PATH)/lib - rm -rf $(DEP_PATH)/share - rm -rf $(DEP_PATH)/jansson-2.12 - rm -rf $(DEP_PATH)/libarchive-3.4.3 - rm -rf $(DEP_PATH)/libsamplerate-0.1.9 - rm -rf $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 - rm -rf $(DEP_PATH)/zstd-1.4.5 + rm -f $(RACK_DEP_PATH)/*.tgz + rm -f $(RACK_DEP_PATH)/*.tar.gz + rm -rf $(RACK_DEP_PATH)/bin + rm -rf $(RACK_DEP_PATH)/include + rm -rf $(RACK_DEP_PATH)/lib + rm -rf $(RACK_DEP_PATH)/share + rm -rf $(RACK_DEP_PATH)/jansson-2.12 + rm -rf $(RACK_DEP_PATH)/libarchive-3.4.3 + rm -rf $(RACK_DEP_PATH)/libsamplerate-0.1.9 + rm -rf $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 + rm -rf $(RACK_DEP_PATH)/zstd-1.4.5 rm -rf $(SURGE_DEP_PATH) download: \ - $(DEP_PATH)/jansson-2.12 \ - $(DEP_PATH)/libarchive-3.4.3/.stamp-patched \ - $(DEP_PATH)/libsamplerate-0.1.9/.stamp-patched \ - $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched \ - $(DEP_PATH)/zstd-1.4.5/.stamp-patched + $(RACK_DEP_PATH)/jansson-2.12 \ + $(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched \ + $(RACK_DEP_PATH)/libsamplerate-0.1.9/.stamp-patched \ + $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched \ + $(RACK_DEP_PATH)/zstd-1.4.5/.stamp-patched -quickjs: $(DEP_PATH)/lib/libquickjs.a +quickjs: $(RACK_DEP_PATH)/lib/libquickjs.a surge: $(SURGE_LIB) # -------------------------------------------------------------- diff --git a/dpf b/dpf index 5b76705..dc6557a 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 5b7670584d16e76a27cf0d6575b8bf9921de2714 +Subproject commit dc6557a3c935ae4bb68f89d8bc698a805fff788e diff --git a/lv2export/Makefile b/lv2export/Makefile index 53ef3a1..9e0fe7c 100644 --- a/lv2export/Makefile +++ b/lv2export/Makefile @@ -59,7 +59,6 @@ ifeq ($(WINDOWS),true) BASE_FLAGS += -D_USE_MATH_DEFINES BASE_FLAGS += -DWIN32_LEAN_AND_MEAN BASE_FLAGS += -I../include/mingw-compat -BASE_FLAGS += -I../include/mingw-std-threads endif # -------------------------------------------------------------- diff --git a/plugins/Makefile b/plugins/Makefile index 68f56a6..3601ff6 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -4,23 +4,8 @@ # Created by falkTX # -# -------------------------------------------------------------- -# Import base definitions - -DISTRHO_NAMESPACE = CardinalDISTRHO -DGL_NAMESPACE = CardinalDGL -USE_NANOVG_FBO = true -WASM_EXCEPTIONS = true -include ../dpf/Makefile.base.mk - -# -------------------------------------------------------------- -# Build config - -ifeq ($(BSD),true) -SYSDEPS ?= true -else -SYSDEPS ?= false -endif +ROOT = .. +include $(ROOT)/Makefile.base.mk # -------------------------------------------------------------- # List of drwav functions, used in several modules diff --git a/src/CardinalRemote/Makefile b/src/CardinalRemote/Makefile index 3a4ee1f..8c89164 100644 --- a/src/CardinalRemote/Makefile +++ b/src/CardinalRemote/Makefile @@ -183,7 +183,6 @@ BASE_FLAGS += -D_USE_MATH_DEFINES BASE_FLAGS += -DWIN32_LEAN_AND_MEAN BASE_FLAGS += -D_WIN32_WINNT=0x0600 BASE_FLAGS += -I../../include/mingw-compat -BASE_FLAGS += -I../../include/mingw-std-threads endif ifeq ($(USE_GLES2),true) diff --git a/src/Makefile b/src/Makefile index c9e1d0d..bcee861 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,23 +4,8 @@ # Created by falkTX # -# -------------------------------------------------------------- -# Import base definitions - -DISTRHO_NAMESPACE = CardinalDISTRHO -DGL_NAMESPACE = CardinalDGL -USE_NANOVG_FBO = true -WASM_EXCEPTIONS = true -include ../dpf/Makefile.base.mk - -# -------------------------------------------------------------- -# Build config - -ifeq ($(BSD),true) -SYSDEPS ?= true -else -SYSDEPS ?= false -endif +ROOT = .. +include $(ROOT)/Makefile.base.mk # -------------------------------------------------------------- # Build setup diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index 5744af7..6683307 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -4,7 +4,15 @@ # Created by falkTX # -# Must have NAME defined +ROOT = ../.. +include $(ROOT)/Makefile.base.mk + +# ----------------------------------------------------------------------------- +# Set variant to build + +ifeq ($(NAME),) +$(error invalid usage) +endif ifeq ($(NAME),Cardinal) CARDINAL_VARIANT = main @@ -49,37 +57,11 @@ CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/zita-resample endif # STATIC_BUILD endif # CARDINAL_VARIANT mini -# -------------------------------------------------------------- -# Import base definitions - -DISTRHO_NAMESPACE = CardinalDISTRHO -DGL_NAMESPACE = CardinalDGL -NVG_DISABLE_SKIPPING_WHITESPACE = true -NVG_FONT_TEXTURE_FLAGS = NVG_IMAGE_NEAREST -USE_NANOVG_FBO = true -WASM_EXCEPTIONS = true - -ifeq ($(CARDINAL_VARIANT),main) -# main variant should not use rtaudio/sdl2 fallback (it has CV ports) -SKIP_NATIVE_AUDIO_FALLBACK = true -else ifneq ($(CARDINAL_VARIANT),mini) -# other variants should only use rtaudio/sdl2 fallbacks -FORCE_NATIVE_AUDIO_FALLBACK = true -endif - -include ../../dpf/Makefile.base.mk - # -------------------------------------------------------------- # Build config PREFIX ?= /usr/local -ifeq ($(BSD),true) -SYSDEPS ?= true -else -SYSDEPS ?= false -endif - ifeq ($(SYSDEPS),true) DEP_LIB_PATH = $(abspath ../../deps/sysroot/lib) else @@ -269,6 +251,14 @@ endif # -------------------------------------------------------------- # Do some magic +ifeq ($(CARDINAL_VARIANT),main) +# main variant should not use rtaudio/sdl2 fallback (it has CV ports) +SKIP_NATIVE_AUDIO_FALLBACK = true +else ifneq ($(CARDINAL_VARIANT),mini) +# other variants should only use rtaudio/sdl2 fallbacks +FORCE_NATIVE_AUDIO_FALLBACK = true +endif + USE_VST2_BUNDLE = true USE_CLAP_BUNDLE = true include ../../dpf/Makefile.plugins.mk