From 3277c4ce083434a991c67d7f280be7e3f3881677 Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Fri, 13 Dec 2024 11:38:34 +0100 Subject: [PATCH] moved BUILD_BIN/DATA_DIR and made extra non-exclusive --- templates/android-make/Makefile | 6 +++--- templates/android-make/vars.mk | 7 +++++-- templates/cmd-make/Makefile | 6 +++--- templates/cmd-make/vars.mk | 7 +++++-- templates/daisy-seed-make/vars.mk | 7 +++++-- templates/ios-make/vars.mk | 7 +++++-- templates/lv2-make/Makefile | 10 +++++----- templates/lv2-make/vars.mk | 7 +++++-- templates/vst3-make/Makefile | 27 ++++++++++++++++++--------- templates/vst3-make/vars.mk | 7 +++++-- templates/web-make/Makefile | 6 +++--- templates/web-make/vars.mk | 7 +++++-- 12 files changed, 67 insertions(+), 37 deletions(-) diff --git a/templates/android-make/Makefile b/templates/android-make/Makefile index 5e20dd0..a931717 100644 --- a/templates/android-make/Makefile +++ b/templates/android-make/Makefile @@ -28,6 +28,9 @@ PLUGIN_DIR ?= src API_DIR ?= $(PLUGIN_DIR) MKINC_DIR ?= $(COMMON_DIR) +BUILD_BIN_DIR := build/apk/lib/armeabi-v7a +BUILD_DATA_DIR := build/assets/index.html + include $(MKINC_DIR)/vars-pre.mk ifeq ($(HAS_MIDI_IN), yes) @@ -99,9 +102,6 @@ CXX_OBJS := $(addprefix build/obj/, $(notdir $(CXX_SRCS:.cpp=.o))) ALL := build/$(BUNDLE_NAME).apk -BUILD_BIN_DIR := build/apk/lib/armeabi-v7a -BUILD_DATA_DIR := build/assets/index.html - -include $(MKINC_DIR)/vars-extra.mk all: $(ALL) diff --git a/templates/android-make/vars.mk b/templates/android-make/vars.mk index 037e72f..e182240 100644 --- a/templates/android-make/vars.mk +++ b/templates/android-make/vars.mk @@ -39,6 +39,9 @@ MKINC_DIR := {{=it.android_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} HAS_MIDI_IN := {{=it.product.buses.filter(x => x.type == "midi" && x.direction == "input").length > 0 ? "yes" : "no"}} -{{?(it.android_make?.extra || it.make?.extra)}} -{{=it.android_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.android_make?.extra}} +{{=it.android_make.extra}} {{?}} diff --git a/templates/cmd-make/Makefile b/templates/cmd-make/Makefile index 964139d..ebd31b6 100644 --- a/templates/cmd-make/Makefile +++ b/templates/cmd-make/Makefile @@ -28,6 +28,9 @@ PLUGIN_DIR ?= src API_DIR ?= $(PLUGIN_DIR) MKINC_DIR ?= $(COMMON_DIR) +BUILD_BIN_DIR := build +BUILD_DATA_DIR := build + -include $(MKINC_DIR)/vars-pre.mk ifeq ($(OS), Windows_NT) @@ -73,9 +76,6 @@ CXX_OBJS := $(addprefix build/obj/, $(notdir $(CXX_SRCS:.cpp=.o))) ALL := build/$(PROGRAM) -BUILD_BIN_DIR := build -BUILD_DATA_DIR := build - -include $(MKINC_DIR)/vars-extra.mk all: $(ALL) diff --git a/templates/cmd-make/vars.mk b/templates/cmd-make/vars.mk index c15e687..6826aa0 100644 --- a/templates/cmd-make/vars.mk +++ b/templates/cmd-make/vars.mk @@ -38,6 +38,9 @@ MKINC_DIR := {{=it.cmd_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} HAS_MIDI_IN := {{=it.product.buses.filter(x => x.type == "midi" && x.direction == "input").length > 0 ? "yes" : "no"}} -{{?(it.cmd_make?.extra || it.make?.extra)}} -{{=it.cmd_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.cmd_make?.extra}} +{{=it.cmd_make.extra}} {{?}} diff --git a/templates/daisy-seed-make/vars.mk b/templates/daisy-seed-make/vars.mk index 8df9611..c370909 100644 --- a/templates/daisy-seed-make/vars.mk +++ b/templates/daisy-seed-make/vars.mk @@ -36,6 +36,9 @@ API_DIR := {{=it.daisy_seed_make?.apiDir ?? (it.make?.apiDir ?? "")}} MKINC_DIR := {{=it.daisy_seed_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} {{?}} -{{?(it.daisy_seed_make?.extra || it.make?.extra)}} -{{=it.daisy_seed_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.daisy_seed_make?.extra}} +{{=it.daisy_seed_make.extra}} {{?}} diff --git a/templates/ios-make/vars.mk b/templates/ios-make/vars.mk index 10c0c2a..e86b059 100644 --- a/templates/ios-make/vars.mk +++ b/templates/ios-make/vars.mk @@ -36,6 +36,9 @@ API_DIR := {{=it.ios_make?.apiDir ?? (it.make?.apiDir ?? "")}} MKINC_DIR := {{=it.ios_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} {{?}} -{{?(it.ios_make?.extra || it.make?.extra)}} -{{=it.ios_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.ios_make?.extra}} +{{=it.ios_make.extra}} {{?}} diff --git a/templates/lv2-make/Makefile b/templates/lv2-make/Makefile index a344a07..68f23f1 100644 --- a/templates/lv2-make/Makefile +++ b/templates/lv2-make/Makefile @@ -28,6 +28,11 @@ PLUGIN_DIR ?= src API_DIR ?= $(PLUGIN_DIR) MKINC_DIR ?= $(COMMON_DIR) +BUNDLE_DIR := $(BUNDLE_NAME).lv2 + +BUILD_BIN_DIR := build/$(BUNDLE_DIR) +BUILD_DATA_DIR := build/$(BUNDLE_DIR) + -include $(MKINC_DIR)/vars-pre.mk ifeq ($(OS), Windows_NT) @@ -72,8 +77,6 @@ ifeq ($(UNAME_S), Darwin) CXXFLAGS_ALL := $(CXXFLAGS_ALL) -arch arm64 -arch x86_64 endif -BUNDLE_DIR := $(BUNDLE_NAME).lv2 - DLL_FILE := $(BUNDLE_NAME)$(DLL_SUFFIX) C_SRCS := $(COMMON_DIR)/src/lv2.c $(C_SRCS_EXTRA) @@ -84,9 +87,6 @@ CXX_OBJS := $(addprefix build/obj/, $(notdir $(CXX_SRCS:.cpp=.o))) ALL := build/$(BUNDLE_DIR)/manifest.ttl build/$(BUNDLE_DIR)/$(DLL_FILE) -BUILD_BIN_DIR := build/$(BUNDLE_DIR) -BUILD_DATA_DIR := build/$(BUNDLE_DIR) - -include $(MKINC_DIR)/vars-extra.mk all: $(ALL) diff --git a/templates/lv2-make/vars.mk b/templates/lv2-make/vars.mk index 716725c..8e3d17b 100644 --- a/templates/lv2-make/vars.mk +++ b/templates/lv2-make/vars.mk @@ -36,6 +36,9 @@ API_DIR := {{=it.lv2_make?.apiDir ?? (it.make?.apiDir ?? "")}} MKINC_DIR := {{=it.lv2_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} {{?}} -{{?(it.lv2_make?.extra || it.make?.extra)}} -{{=it.lv2_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.lv2_make?.extra}} +{{=it.lv2_make.extra}} {{?}} diff --git a/templates/vst3-make/Makefile b/templates/vst3-make/Makefile index 071c709..0e6f3fa 100644 --- a/templates/vst3-make/Makefile +++ b/templates/vst3-make/Makefile @@ -28,11 +28,27 @@ PLUGIN_DIR ?= src API_DIR ?= $(PLUGIN_DIR) MKINC_DIR ?= $(COMMON_DIR) +BUNDLE_DIR := $(BUNDLE_NAME).vst3 + +ifeq ($(OS), Windows_NT) + PLATFORM := x86_64-win +else + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S), Darwin) + PLATFORM := MacOS + else + PLATFORM := $(shell uname -m)-linux + endif +endif +DLL_DIR := Contents/$(PLATFORM) + +BUILD_BIN_DIR := build/$(BUNDLE_DIR)/$(DLL_DIR) +BUILD_DATA_DIR := build/$(BUNDLE_DIR)/Contents/Resources + -include $(MKINC_DIR)/vars-pre.mk ifeq ($(OS), Windows_NT) DLL_SUFFIX := .vst3 - PLATFORM := x86_64-win VST3DIR := $(shell echo '$(COMMONPROGRAMFILES)' | sed 's:\\:/:g')/VST3 VST3DIR_USER := $(shell echo '$(LOCALAPPDATA)' | sed 's:\\:/:g')/Programs/Common/VST3 CC := gcc @@ -41,14 +57,12 @@ else UNAME_S := $(shell uname -s) ifeq ($(UNAME_S), Darwin) DLL_SUFFIX := - PLATFORM := MacOS VST3DIR := /Library/Audio/Plug-Ins/VST3 VST3DIR_USER := $(HOME)/Library/Audio/Plug-Ins/VST3 CC := clang CXX := clang++ else DLL_SUFFIX := .so - PLATFORM := $(shell uname -m)-linux VST3DIR := /usr/local/lib/vst3 VST3DIR_USER := $(HOME)/.vst3 CC := gcc @@ -84,9 +98,7 @@ ifeq ($(UNAME_S), Linux) endif endif -BUNDLE_DIR := $(BUNDLE_NAME).vst3 -DLL_DIR := Contents/$(PLATFORM) DLL_FILE := $(DLL_DIR)/$(BUNDLE_NAME)$(DLL_SUFFIX) C_SRCS := $(COMMON_DIR)/src/vst3.c $(C_SRCS_EXTRA) @@ -101,9 +113,6 @@ ifeq ($(UNAME_S), Darwin) ALL := $(ALL) build/$(BUNDLE_DIR)/Contents/Info.plist build/$(BUNDLE_DIR)/Contents/PkgInfo endif -BUILD_BIN_DIR := build/$(BUNDLE_DIR)/$(DLL_DIR) -BUILD_DATA_DIR := build/$(BUNDLE_DIR)/Contents/Resources - -include $(MKINC_DIR)/vars-extra.mk all: $(ALL) @@ -124,7 +133,7 @@ build/$(BUNDLE_DIR)/Contents/%: $(COMMON_DIR)/data/% | build/$(BUNDLE_DIR)/Conte cp $^ $@ endif -build/$(BUNDLE_DIR)/Contents build/$(BUNDLE_DIR)/$(DLL_DIR) build/obj: +build/$(BUNDLE_DIR)/Contents build/$(BUNDLE_DIR)/$(DLL_DIR) $(BUILD_DATA_DIR) build/obj: mkdir -p $@ clean: diff --git a/templates/vst3-make/vars.mk b/templates/vst3-make/vars.mk index 97d14b2..a633d87 100644 --- a/templates/vst3-make/vars.mk +++ b/templates/vst3-make/vars.mk @@ -38,6 +38,9 @@ MKINC_DIR := {{=it.vst3_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} HAS_UI := {{=it.product.ui ? "yes" : "no"}} -{{?(it.vst3_make?.extra || it.make?.extra)}} -{{=it.vst3_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.vst3_make?.extra}} +{{=it.vst3_make.extra}} {{?}} diff --git a/templates/web-make/Makefile b/templates/web-make/Makefile index 5cfbbab..1aeeae9 100644 --- a/templates/web-make/Makefile +++ b/templates/web-make/Makefile @@ -28,6 +28,9 @@ PLUGIN_DIR ?= src API_DIR ?= $(PLUGIN_DIR) MKINC_DIR ?= $(COMMON_DIR) +BUILD_BIN_DIR := build/web +BUILD_DATA_DIR := build/web + -include $(MKINC_DIR)/vars-pre.mk CC := clang @@ -80,9 +83,6 @@ endif ALL := build/web/$(BUNDLE_NAME)/module.wasm build/web/$(BUNDLE_NAME)/processor.js build/web/$(BUNDLE_NAME)/module.js -BUILD_BIN_DIR := build/web -BUILD_DATA_DIR := build/web - -include $(MKINC_DIR)/vars-extra.mk all: $(ALL) diff --git a/templates/web-make/vars.mk b/templates/web-make/vars.mk index 39ee24f..a62dc09 100644 --- a/templates/web-make/vars.mk +++ b/templates/web-make/vars.mk @@ -38,6 +38,9 @@ MKINC_DIR := {{=it.web_make?.mkincDir ?? (it.make?.mkincDir ?? "")}} HAS_MIDI_IN := {{=it.product.buses.filter(x => x.type == "midi" && x.direction == "input").length > 0 ? "yes" : "no"}} -{{?(it.web_make?.extra || it.make?.extra)}} -{{=it.web_make?.extra ?? (it.make?.extra ?? "")}} +{{?it.make?.extra}} +{{=it.make.extra}} +{{?}} +{{?it.web_make?.extra}} +{{=it.web_make.extra}} {{?}}