From 895104240448a4c24fba972fd1d4d884f95aa136 Mon Sep 17 00:00:00 2001 From: Paolo Marrone Date: Fri, 26 Jul 2024 15:46:22 +0200 Subject: [PATCH] vst3 and lv2 makefiles native support for objc files --- templates/lv2-make/Makefile | 10 ++++++++-- templates/lv2-make/vars.mk | 16 +++++++++------- templates/vst3-make/Makefile | 10 ++++++++-- templates/vst3-make/vars.mk | 16 +++++++++------- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/templates/lv2-make/Makefile b/templates/lv2-make/Makefile index 562746b..08f8f75 100644 --- a/templates/lv2-make/Makefile +++ b/templates/lv2-make/Makefile @@ -73,6 +73,9 @@ DLL_FILE := $(BUNDLE_NAME)$(DLL_SUFFIX) C_SRCS := $(COMMON_DIR)/src/lv2.c $(C_SRCS_EXTRA) C_OBJS := $(addprefix build/obj/, $(notdir $(C_SRCS:.c=.o))) +M_SRCS := $(M_SRCS_EXTRA) +M_OBJS := $(addprefix build/obj/, $(notdir $(M_SRCS:.m=.o))) + CXX_SRCS := $(CXX_SRCS_EXTRA) CXX_OBJS := $(addprefix build/obj/, $(notdir $(CXX_SRCS:.cpp=.o))) @@ -86,10 +89,10 @@ build/$(BUNDLE_DIR)/manifest.ttl: $(DATA_DIR)/data/manifest.ttl.in | build/$(BUN cat $^ | sed s/@DLL_SUFFIX@/$(DLL_SUFFIX)/g | sed s/@UI_TYPE@/$(UI_TYPE)/g > $@ ifeq ($(CXX_OBJS),) -build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) | build/$(BUNDLE_DIR) +build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) $(M_OBJS) | build/$(BUNDLE_DIR) $(CC) $^ -o $@ $(CFLAGS_ALL) $(LDFLAGS_ALL) else -build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) $(CXX_OBJS) | build/$(BUNDLE_DIR) +build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) $(M_OBJS) $(CXX_OBJS) | build/$(BUNDLE_DIR) $(CXX) $^ -o $@ $(CFLAGS_ALL) $(CXXFLAGS_ALL) $(LDFLAGS_ALL) endif @@ -138,6 +141,9 @@ PERCENT := % $(C_OBJS): build/obj/%.o: $$(filter $$(PERCENT)/$$(basename $$(notdir $$@)).c,$$(C_SRCS)) | build/obj $(CC) $^ -o $@ -c $(CFLAGS_ALL) +$(M_OBJS): build/obj/%.o: $$(filter $$(PERCENT)/$$(basename $$(notdir $$@)).m,$$(M_SRCS)) | build/obj + $(CC) $^ -o $@ -c $(CFLAGS_ALL) + $(CXX_OBJS): build/obj/%.o: $$(filter $$(PERCENT)/$$(basename $$(notdir $$@)).cpp,$$(CXX_SRCS)) | build/obj $(CXX) $^ -o $@ -c $(CXXFLAGS_ALL) diff --git a/templates/lv2-make/vars.mk b/templates/lv2-make/vars.mk index 330f797..9da10b6 100644 --- a/templates/lv2-make/vars.mk +++ b/templates/lv2-make/vars.mk @@ -20,13 +20,15 @@ BUNDLE_NAME := {{=it.product.bundleName}} -CFLAGS_EXTRA := {{=it.make?.cflags ?? ""}} {{=it.lv2_make?.cflags ?? ""}} -CXXFLAGS_EXTRA := {{=it.make?.cxxflags ?? ""}} {{=it.lv2_make?.cxxflags ?? ""}} -LDFLAGS_EXTRA := {{=it.make?.ldflags ?? ""}} {{=it.lv2_make?.ldflags ?? ""}} - -C_SRCS_EXTRA := {{=it.make?.cSrcs ?? ""}} {{=it.lv2_make?.cSrcs ?? ""}} -CXX_SRCS_EXTRA := {{=it.make?.cxxSrcs ?? ""}} {{=it.lv2_make?.cxxSrcs ?? ""}} - COMMON_DIR := {{=it.lv2_make?.commonDir ?? (it.make?.commonDir ?? "")}} DATA_DIR := {{=it.lv2_make?.dataDir ?? (it.make?.dataDir ?? "")}} PLUGIN_DIR := {{=it.lv2_make?.pluginDir ?? (it.make?.pluginDir ?? "")}} + +C_SRCS_EXTRA := {{=it.make?.cSrcs ?? ""}} {{=it.lv2_make?.cSrcs ?? ""}} +M_SRCS_EXTRA := {{=it.make?.mSrcs ?? ""}} {{=it.lv2_make?.mSrcs ?? ""}} +CXX_SRCS_EXTRA := {{=it.make?.cxxSrcs ?? ""}} {{=it.lv2_make?.cxxSrcs ?? ""}} + +CFLAGS_EXTRA := {{=it.make?.cflags ?? ""}} {{=it.lv2_make?.cflags ?? ""}} +CXXFLAGS_EXTRA := {{=it.make?.cxxflags ?? ""}} {{=it.lv2_make?.cxxflags ?? ""}} + +LDFLAGS_EXTRA := {{=it.make?.ldflags ?? ""}} {{=it.lv2_make?.ldflags ?? ""}} diff --git a/templates/vst3-make/Makefile b/templates/vst3-make/Makefile index 09bf6ef..dbf28da 100644 --- a/templates/vst3-make/Makefile +++ b/templates/vst3-make/Makefile @@ -86,6 +86,9 @@ DLL_FILE := $(DLL_DIR)/$(BUNDLE_NAME)$(DLL_SUFFIX) C_SRCS := $(COMMON_DIR)/src/vst3.c $(C_SRCS_EXTRA) C_OBJS := $(addprefix build/obj/, $(notdir $(C_SRCS:.c=.o))) +M_SRCS := $(M_SRCS_EXTRA) +M_OBJS := $(addprefix build/obj/, $(notdir $(M_SRCS:.m=.o))) + CXX_SRCS := $(CXX_SRCS_EXTRA) CXX_OBJS := $(addprefix build/obj/, $(notdir $(CXX_SRCS:.cpp=.o))) @@ -100,10 +103,10 @@ endif all: $(ALL) ifeq ($(CXX_OBJS),) -build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) | build/$(BUNDLE_DIR)/$(DLL_DIR) +build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) $(M_OBJS) | build/$(BUNDLE_DIR)/$(DLL_DIR) $(CC) $^ -o $@ $(CFLAGS_ALL) $(LDFLAGS_ALL) else -build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) $(CXX_OBJS) | build/$(BUNDLE_DIR)/$(DLL_DIR) +build/$(BUNDLE_DIR)/$(DLL_FILE): $(C_OBJS) $(M_OBJS) $(CXX_OBJS) | build/$(BUNDLE_DIR)/$(DLL_DIR) $(CXX) $^ -o $@ $(CFLAGS_ALL) $(CXXFLAGS_ALL) $(LDFLAGS_ALL) endif @@ -157,6 +160,9 @@ PERCENT := % $(C_OBJS): build/obj/%.o: $$(filter $$(PERCENT)/$$(basename $$(notdir $$@)).c,$$(C_SRCS)) | build/obj $(CC) $^ -o $@ -c $(CFLAGS_ALL) +$(M_OBJS): build/obj/%.o: $$(filter $$(PERCENT)/$$(basename $$(notdir $$@)).m,$$(M_SRCS)) | build/obj + $(CC) $^ -o $@ -c $(CFLAGS_ALL) + $(CXX_OBJS): build/obj/%.o: $$(filter $$(PERCENT)/$$(basename $$(notdir $$@)).cpp,$$(CXX_SRCS)) | build/obj $(CXX) $^ -o $@ -c $(CXXFLAGS_ALL) diff --git a/templates/vst3-make/vars.mk b/templates/vst3-make/vars.mk index 4e49bba..6b98be5 100644 --- a/templates/vst3-make/vars.mk +++ b/templates/vst3-make/vars.mk @@ -20,15 +20,17 @@ BUNDLE_NAME := {{=it.product.bundleName}} -CFLAGS_EXTRA := {{=it.make?.cflags ?? ""}} {{=it.vst3_make?.cflags ?? ""}} -CXXFLAGS_EXTRA := {{=it.make?.cxxflags ?? ""}} {{=it.vst3_make?.cxxflags ?? ""}} -LDFLAGS_EXTRA := {{=it.make?.ldflags ?? ""}} {{=it.vst3_make?.ldflags ?? ""}} - -C_SRCS_EXTRA := {{=it.make?.cSrcs ?? ""}} {{=it.vst3_make?.cSrcs ?? ""}} -CXX_SRCS_EXTRA := {{=it.make?.cxxSrcs ?? ""}} {{=it.vst3_make?.cxxSrcs ?? ""}} - COMMON_DIR := {{=it.vst3_make?.commonDir ?? (it.make?.commonDir ?? "")}} DATA_DIR := {{=it.vst3_make?.dataDir ?? (it.make?.dataDir ?? "")}} PLUGIN_DIR := {{=it.vst3_make?.pluginDir ?? (it.make?.pluginDir ?? "")}} +C_SRCS_EXTRA := {{=it.make?.cSrcs ?? ""}} {{=it.vst3_make?.cSrcs ?? ""}} +M_SRCS_EXTRA := {{=it.make?.mSrcs ?? ""}} {{=it.vst3_make?.mSrcs ?? ""}} +CXX_SRCS_EXTRA := {{=it.make?.cxxSrcs ?? ""}} {{=it.vst3_make?.cxxSrcs ?? ""}} + +CFLAGS_EXTRA := {{=it.make?.cflags ?? ""}} {{=it.vst3_make?.cflags ?? ""}} +CXXFLAGS_EXTRA := {{=it.make?.cxxflags ?? ""}} {{=it.vst3_make?.cxxflags ?? ""}} + +LDFLAGS_EXTRA := {{=it.make?.ldflags ?? ""}} {{=it.vst3_make?.ldflags ?? ""}} + HAS_UI := {{=it.product.ui ? "yes" : "no"}}