From 70e247179fab57ec16fcbfa0d50b3e829d906c0f Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 25 Sep 2018 23:31:46 +0200 Subject: [PATCH] Adjust makefiles so they can be used externally --- Makefile | 2 +- Makefile.mk => Makefile.base.mk | 0 examples/Makefile.mk => Makefile.plugins.mk | 31 +++++++++++++-------- dgl/Makefile | 2 +- examples/Info/Makefile | 2 +- examples/Latency/Makefile | 2 +- examples/Meters/Makefile | 2 +- examples/MidiThrough/Makefile | 2 +- examples/Parameters/Makefile | 2 +- examples/States/Makefile | 2 +- 10 files changed, 27 insertions(+), 20 deletions(-) rename Makefile.mk => Makefile.base.mk (100%) rename examples/Makefile.mk => Makefile.plugins.mk (86%) diff --git a/Makefile b/Makefile index ae7e626b..e27a4936 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # Created by falkTX # -include Makefile.mk +include Makefile.base.mk all: dgl examples gen diff --git a/Makefile.mk b/Makefile.base.mk similarity index 100% rename from Makefile.mk rename to Makefile.base.mk diff --git a/examples/Makefile.mk b/Makefile.plugins.mk similarity index 86% rename from examples/Makefile.mk rename to Makefile.plugins.mk index d0ad6607..f7a9341b 100644 --- a/examples/Makefile.mk +++ b/Makefile.plugins.mk @@ -4,9 +4,16 @@ # Created by falkTX # -# NAME, FILES_DSP and FILES_UI have been defined before +# NOTE: NAME, FILES_DSP and FILES_UI must have been defined before including this file! -include ../../Makefile.mk + +ifeq (,$(wildcard ../../Makefile.base.mk)) +DPF_PATH=../../dpf +else +DPF_PATH=../.. +endif + +include $(DPF_PATH)/Makefile.base.mk ifeq ($(FILES_UI),) HAVE_DGL = false @@ -19,7 +26,7 @@ TARGET_DIR = ../../bin BUILD_DIR = ../../build/$(NAME) BUILD_C_FLAGS += -I. -BUILD_CXX_FLAGS += -I. -I../../distrho -I../../dgl +BUILD_CXX_FLAGS += -I. -I$(DPF_PATH)/distrho -I$(DPF_PATH)/dgl ifeq ($(HAVE_DGL),true) BASE_FLAGS += -DHAVE_DGL @@ -85,22 +92,22 @@ clean: # --------------------------------------------------------------------------------------------------------------------- -$(BUILD_DIR)/DistrhoPluginMain_%.cpp.o: ../../distrho/DistrhoPluginMain.cpp +$(BUILD_DIR)/DistrhoPluginMain_%.cpp.o: $(DPF_PATH)/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 +$(BUILD_DIR)/DistrhoUIMain_%.cpp.o: $(DPF_PATH)/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 +$(BUILD_DIR)/DistrhoPluginMain_JACK.cpp.o: $(DPF_PATH)/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 +$(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o: $(DPF_PATH)/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 $@ @@ -110,7 +117,7 @@ $(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o: ../../distrho/DistrhoUIMain.cpp jack: $(jack) -$(jack): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_JACK.cpp.o $(BUILD_DIR)/DistrhoUIMain_JACK.cpp.o ../../build/libdgl.a +$(jack): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_JACK.cpp.o $(BUILD_DIR)/DistrhoUIMain_JACK.cpp.o $(DPF_PATH)/build/libdgl.a -@mkdir -p $(shell dirname $@) @echo "Creating JACK standalone for $(NAME)" @$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --libs jack) -o $@ @@ -137,7 +144,7 @@ $(dssi_dsp): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_DSSI.cpp.o @echo "Creating DSSI plugin library for $(NAME)" @$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -o $@ -$(dssi_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o ../../build/libdgl.a +$(dssi_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o $(DPF_PATH)/build/libdgl.a -@mkdir -p $(shell dirname $@) @echo "Creating DSSI UI for $(NAME)" @$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --libs liblo) -o $@ @@ -149,7 +156,7 @@ lv2_one: $(lv2) lv2_dsp: $(lv2_dsp) lv2_sep: $(lv2_dsp) $(lv2_ui) -$(lv2): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_LV2.cpp.o $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o ../../build/libdgl.a +$(lv2): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_LV2.cpp.o $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o $(DPF_PATH)/build/libdgl.a -@mkdir -p $(shell dirname $@) @echo "Creating LV2 plugin for $(NAME)" @$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -o $@ @@ -159,7 +166,7 @@ $(lv2_dsp): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_LV2.cpp.o @echo "Creating LV2 plugin library for $(NAME)" @$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -o $@ -$(lv2_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o ../../build/libdgl.a +$(lv2_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o $(DPF_PATH)/build/libdgl.a -@mkdir -p $(shell dirname $@) @echo "Creating LV2 plugin UI for $(NAME)" @$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -o $@ @@ -170,7 +177,7 @@ $(lv2_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_LV2.cpp.o ../../build/libdgl.a vst: $(vst) ifeq ($(HAVE_DGL),true) -$(vst): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_VST.cpp.o $(BUILD_DIR)/DistrhoUIMain_VST.cpp.o ../../build/libdgl.a +$(vst): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_VST.cpp.o $(BUILD_DIR)/DistrhoUIMain_VST.cpp.o $(DPF_PATH)/build/libdgl.a else $(vst): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_VST.cpp.o endif diff --git a/dgl/Makefile b/dgl/Makefile index 9a418d12..b0b4f419 100644 --- a/dgl/Makefile +++ b/dgl/Makefile @@ -4,7 +4,7 @@ # Created by falkTX # -include ../Makefile.mk +include ../Makefile.base.mk # --------------------------------------------------------------------------------------------------------------------- diff --git a/examples/Info/Makefile b/examples/Info/Makefile index ae9216dc..200ee8c9 100644 --- a/examples/Info/Makefile +++ b/examples/Info/Makefile @@ -21,7 +21,7 @@ FILES_UI = \ # -------------------------------------------------------------- # Do some magic -include ../Makefile.mk +include ../../Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types diff --git a/examples/Latency/Makefile b/examples/Latency/Makefile index c2d7fb64..1a61a70d 100644 --- a/examples/Latency/Makefile +++ b/examples/Latency/Makefile @@ -18,7 +18,7 @@ FILES_DSP = \ # -------------------------------------------------------------- # Do some magic -include ../Makefile.mk +include ../../Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types diff --git a/examples/Meters/Makefile b/examples/Meters/Makefile index 470ac06e..3fc712ce 100644 --- a/examples/Meters/Makefile +++ b/examples/Meters/Makefile @@ -21,7 +21,7 @@ FILES_UI = \ # -------------------------------------------------------------- # Do some magic -include ../Makefile.mk +include ../../Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types diff --git a/examples/MidiThrough/Makefile b/examples/MidiThrough/Makefile index dffac446..79c50beb 100644 --- a/examples/MidiThrough/Makefile +++ b/examples/MidiThrough/Makefile @@ -18,7 +18,7 @@ FILES_DSP = \ # -------------------------------------------------------------- # Do some magic -include ../Makefile.mk +include ../../Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types diff --git a/examples/Parameters/Makefile b/examples/Parameters/Makefile index e7b296bf..15c39099 100644 --- a/examples/Parameters/Makefile +++ b/examples/Parameters/Makefile @@ -21,7 +21,7 @@ FILES_UI = \ # -------------------------------------------------------------- # Do some magic -include ../Makefile.mk +include ../../Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types diff --git a/examples/States/Makefile b/examples/States/Makefile index e4c7f6a3..026e4ec2 100644 --- a/examples/States/Makefile +++ b/examples/States/Makefile @@ -21,7 +21,7 @@ FILES_UI = \ # -------------------------------------------------------------- # Do some magic -include ../Makefile.mk +include ../../Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types