Browse Source

Cleanup makefiles a bit more, and fix more warnings

pull/72/head
falkTX 3 years ago
parent
commit
2ad209cb73
7 changed files with 58 additions and 43 deletions
  1. +4
    -4
      Makefile
  2. +5
    -7
      Makefile.mk
  3. +2
    -0
      distrho/DistrhoPluginMain.cpp
  4. +2
    -0
      distrho/DistrhoUIMain.cpp
  5. +3
    -3
      distrho/src/DistrhoUIInternal.hpp
  6. +3
    -3
      examples/Info/InfoExamplePlugin.cpp
  7. +39
    -26
      examples/Makefile.mk

+ 4
- 4
Makefile View File

@@ -6,16 +6,16 @@

include Makefile.mk

all: libs examples gen
all: dgl examples gen

# --------------------------------------------------------------

libs:
dgl:
ifeq ($(HAVE_DGL),true)
$(MAKE) -C dgl
endif

examples: libs
examples: dgl
$(MAKE) all -C examples/Info
$(MAKE) all -C examples/Latency
$(MAKE) all -C examples/Meters
@@ -51,4 +51,4 @@ clean:

# --------------------------------------------------------------

.PHONY: examples
.PHONY: dgl examples

+ 5
- 7
Makefile.mk View File

@@ -172,18 +172,16 @@ endif
# ---------------------------------------------------------------------------------------------------------------------
# Check for optional libs

ifeq ($(LINUX),true)
ifeq ($(MACOS_OR_WIN32),true)
HAVE_DGL = true
else
HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
HAVE_JACK = $(shell pkg-config --exists jack && echo true)
HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
endif

ifeq ($(MACOS),true)
HAVE_DGL = true
endif

ifeq ($(WIN32),true)
HAVE_DGL = true
ifneq ($(HAVE_DGL),true)
$(error DGL missing 22)
endif

# ---------------------------------------------------------------------------------------------------------------------


+ 2
- 0
distrho/DistrhoPluginMain.cpp View File

@@ -27,4 +27,6 @@
# include "src/DistrhoPluginLV2export.cpp"
#elif defined(DISTRHO_PLUGIN_TARGET_VST)
# include "src/DistrhoPluginVST.cpp"
#else
# error unsupported format
#endif

+ 2
- 0
distrho/DistrhoUIMain.cpp View File

@@ -26,4 +26,6 @@
# include "src/DistrhoUILV2.cpp"
#elif defined(DISTRHO_PLUGIN_TARGET_VST)
// nothing
#else
# error unsupported format
#endif

+ 3
- 3
distrho/src/DistrhoUIInternal.hpp View File

@@ -434,9 +434,9 @@ public:
return glWindow.handlePluginKeyboard(press, key);
}
#else
void setWindowSize(const uint width, const uint height, const bool updateUI = false) {}
void setWindowTransientWinId(const uintptr_t winId) {}
bool setWindowVisible(const bool yesNo) { return true; }
void setWindowSize(const uint, const uint, const bool) {}
void setWindowTransientWinId(const uintptr_t) {}
bool setWindowVisible(const bool) { return true; }
#endif

// -------------------------------------------------------------------


+ 3
- 3
examples/Info/InfoExamplePlugin.cpp View File

@@ -220,9 +220,9 @@ protected:
const TimePosition& timePos(getTimePosition());
// set basic values
fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f;
fParameters[kParameterTimeFrame] = timePos.frame;
fParameters[kParameterTimeValidBBT] = timePos.bbt.valid ? 1.0f : 0.0f;
fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f;
fParameters[kParameterTimeFrame] = timePos.frame;
fParameters[kParameterTimeValidBBT] = timePos.bbt.valid ? 1.0f : 0.0f;
// set bbt
if (timePos.bbt.valid)


+ 39
- 26
examples/Makefile.mk View File

@@ -8,7 +8,7 @@

include ../../Makefile.mk

ifeq ($(OBJS_UI),)
ifeq ($(FILES_UI),)
HAVE_DGL = false
endif

@@ -51,15 +51,6 @@ lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp$(LIB_EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui$(LIB_EXT)
vst = $(TARGET_DIR)/$(NAME)-vst$(LIB_EXT)

# ---------------------------------------------------------------------------------------------------------------------
# Set distrho code files

DISTRHO_PLUGIN_FILES = ../../distrho/DistrhoPluginMain.cpp

ifeq ($(HAVE_DGL),true)
DISTRHO_UI_FILES = ../../distrho/DistrhoUIMain.cpp ../../build/libdgl.a
endif

# ---------------------------------------------------------------------------------------------------------------------
# Handle plugins without UI

@@ -93,25 +84,47 @@ clean:
rm -rf $(BUILD_DIR)
rm -rf $(TARGET_DIR)/$(NAME) $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2

# ---------------------------------------------------------------------------------------------------------------------

$(BUILD_DIR)/DistrhoPluginMain_%.cpp.o: ../../distrho/DistrhoPluginMain.cpp
-@mkdir -p $(BUILD_DIR)
@echo "Compiling DistrhoPluginMain.cpp ($*)"
@$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_PLUGIN_TARGET_$* -c -o $@

$(BUILD_DIR)/DistrhoUIMain_%.cpp.o: ../../distrho/DistrhoUIMain.cpp
-@mkdir -p $(BUILD_DIR)
@echo "Compiling DistrhoUIMain.cpp ($*)"
@$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_PLUGIN_TARGET_$* -c -o $@

$(BUILD_DIR)/DistrhoPluginMain_JACK.cpp.o: ../../distrho/DistrhoPluginMain.cpp
-@mkdir -p $(BUILD_DIR)
@echo "Compiling DistrhoPluginMain.cpp (JACK)"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(shell pkg-config --cflags jack) -DDISTRHO_PLUGIN_TARGET_JACK -c -o $@

$(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o: ../../distrho/DistrhoUIMain.cpp
-@mkdir -p $(BUILD_DIR)
@echo "Compiling DistrhoUIMain.cpp (DSSI)"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(shell pkg-config --cflags liblo) -DDISTRHO_PLUGIN_TARGET_DSSI -c -o $@

# ---------------------------------------------------------------------------------------------------------------------
# JACK

jack: $(jack)

$(jack): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
$(jack): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_JACK.cpp.o $(BUILD_DIR)/DistrhoUIMain_JACK.cpp.o ../../build/libdgl.a
-@mkdir -p $(shell dirname $@)
@echo "Creating JACK standalone for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs jack) -DDISTRHO_PLUGIN_TARGET_JACK -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --libs jack) -o $@

# ---------------------------------------------------------------------------------------------------------------------
# LADSPA

ladspa: $(ladspa_dsp)

$(ladspa_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
$(ladspa_dsp): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_LADSPA.cpp.o
-@mkdir -p $(shell dirname $@)
@echo "Creating LADSPA plugin for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LADSPA -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -o $@

# ---------------------------------------------------------------------------------------------------------------------
# DSSI
@@ -120,15 +133,15 @@ dssi: $(dssi_dsp) $(dssi_ui)
dssi_dsp: $(dssi_dsp)
dssi_ui: $(dssi_ui)

$(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
$(dssi_dsp): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_DSSI.cpp.o
-@mkdir -p $(shell dirname $@)
@echo "Creating DSSI plugin library for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -o $@

$(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
$(dssi_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o ../../build/libdgl.a
-@mkdir -p $(shell dirname $@)
@echo "Creating DSSI UI for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs liblo) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --libs liblo) -o $@

# ---------------------------------------------------------------------------------------------------------------------
# LV2
@@ -137,30 +150,30 @@ lv2_one: $(lv2)
lv2_dsp: $(lv2_dsp)
lv2_sep: $(lv2_dsp) $(lv2_ui)

$(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
$(lv2): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_LV2.cpp.o $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o ../../build/libdgl.a
-@mkdir -p $(shell dirname $@)
@echo "Creating LV2 plugin for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -o $@

$(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
$(lv2_dsp): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_LV2.cpp.o
-@mkdir -p $(shell dirname $@)
@echo "Creating LV2 plugin library for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -o $@

$(lv2_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
$(lv2_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o ../../build/libdgl.a
-@mkdir -p $(shell dirname $@)
@echo "Creating LV2 plugin UI for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -o $@

# ---------------------------------------------------------------------------------------------------------------------
# VST

vst: $(vst)

$(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
$(vst): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_VST.cpp.o $(BUILD_DIR)/DistrhoUIMain_VST.cpp.o ../../build/libdgl.a
-@mkdir -p $(shell dirname $@)
@echo "Creating VST plugin for $(NAME)"
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@
@$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -o $@

# ---------------------------------------------------------------------------------------------------------------------



Loading…
Cancel
Save