NAME = {{name}}
{%- if meta.enable_modgui is sameas true %}
MODGUI_CLASS_NAME = hv_{{name}}
{%- endif %}
{%- if meta.enable_ui is sameas true %}
FILES_DSP = $(filter-out HeavyDPF_{{name}}_UI.cpp, $(wildcard *.cpp))
{%- else %}
FILES_DSP = $(wildcard *.cpp)
{%- endif %}
FILES_DSP += $(wildcard *.c)

{%- if meta.enable_ui is sameas true %}
FILES_UI = HeavyDPF_{{name}}_UI.cpp
FILES_UI += ../../{{dpf_path}}dpf-widgets/opengl/DearImGui.cpp
{%- endif %}

DPF_TARGET_DIR = ../../bin
DPF_BUILD_DIR = ../../build
DPF_PATH = ../../{{dpf_path}}dpf

include ../../{{dpf_path}}dpf/Makefile.plugins.mk

{%- if meta.enable_ui is sameas true %}
BUILD_CXX_FLAGS += -I ../../{{dpf_path}}dpf-widgets/generic
BUILD_CXX_FLAGS += -I ../../{{dpf_path}}dpf-widgets/opengl
{%- endif %}

{%- if meta.makefile_dep|length > 0 %}
	{%- for dependency in meta.makefile_dep %}
BUILD_CXX_FLAGS += -I ../../{{dpf_path}}{{dependency}}
	{%- endfor %}
{%- endif %}

BUILD_C_FLAGS += -Wno-unused-parameter -std=c11 -fno-strict-aliasing -pthread
BUILD_CXX_FLAGS += -Wno-unused-parameter -fno-strict-aliasing -pthread
LINK_FLAGS += -pthread

{%- if nosimd is sameas true %}
BUILD_C_FLAGS += -DHV_SIMD_NONE
BUILD_CXX_FLAGS += -DHV_SIMD_NONE
{%- endif %}

{% if meta.plugin_formats|length > 0 %}
	{%- for format in meta.plugin_formats %}
TARGETS += {{format}}
	{%- endfor %}
{% else %}
TARGETS += jack
TARGETS += lv2_dsp
TARGETS += vst
{%- endif %}

all: $(TARGETS)
