diff --git a/Makefile.base.mk b/Makefile.base.mk index 7d4e3c78..86f5fdf7 100644 --- a/Makefile.base.mk +++ b/Makefile.base.mk @@ -331,6 +331,10 @@ BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden CXXFLAGS += -fvisibility-inlines-hidden endif +ifeq ($(WASM),true) +LINK_OPTS += -sALLOW_MEMORY_GROWTH +endif + ifeq ($(WITH_LTO),true) BASE_FLAGS += -fno-strict-aliasing -flto LINK_OPTS += -fno-strict-aliasing -flto -Werror=odr @@ -698,7 +702,7 @@ endif # Set app extension ifeq ($(WASM),true) -APP_EXT = .html +APP_EXT = .js else ifeq ($(WINDOWS),true) APP_EXT = .exe endif diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk index 48a8d50c..e0e63111 100644 --- a/Makefile.plugins.mk +++ b/Makefile.plugins.mk @@ -398,6 +398,10 @@ vst3files += $(BUNDLE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst3/Contents/%) clapfiles += $(BUNDLE_RESOURCES:%=$(TARGET_DIR)/$(NAME).clap/Contents/%) endif +ifeq ($(WASM),true) +jackfiles += $(TARGET_DIR)/$(NAME).html +endif + ifneq ($(HAVE_DGL),true) dssi_ui = lv2_ui = @@ -851,6 +855,8 @@ endif # --------------------------------------------------------------------------------------------------------------------- # macOS files +ifeq ($(MACOS),true) + $(TARGET_DIR)/%.app/Contents/Info.plist: $(DPF_PATH)/utils/plugin.app/Contents/Info.plist -@mkdir -p $(shell dirname $@) $(SILENT)sed -e "s/@INFO_PLIST_PROJECT_NAME@/$(NAME)/" $< > $@ @@ -867,8 +873,21 @@ $(TARGET_DIR)/%/Resources/empty.lproj: $(DPF_PATH)/utils/plugin.bundle/Contents/ -@mkdir -p $(shell dirname $@) $(SILENT)cp $< $@ +endif + +# --------------------------------------------------------------------------------------------------------------------- +# wasm files + +ifeq ($(WASM),true) + +$(TARGET_DIR)/$(NAME).html: $(DPF_PATH)/utils/emscripten.html.in + -@mkdir -p $(shell dirname $@) + $(SILENT)sed -e 's|@NAME@|$(NAME)|g' $< > $@ + +endif + # --------------------------------------------------------------------------------------------------------------------- -# format-specific files +# auto-generated format-specific files $(TARGET_DIR)/$(NAME).component/Contents/Info.plist: $(BUILD_DIR)/export$(APP_EXT) -@mkdir -p $(shell dirname $@)