From e50a5ecf61f428c6f3469cd84bb883b1fa6f5db0 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 15 Mar 2013 20:23:19 +0000 Subject: [PATCH] Small makefile rework --- source/backend/CarlaNative.h | 16 ++++--- source/backend/Makefile.mk | 11 +++-- source/backend/engine/Makefile | 2 +- source/backend/native/Makefile | 73 ++++++++++++++++++++++-------- source/backend/plugin/Makefile | 8 ++-- source/backend/standalone/Makefile | 27 ++++++++--- source/discovery/Makefile | 2 + 7 files changed, 98 insertions(+), 41 deletions(-) diff --git a/source/backend/CarlaNative.h b/source/backend/CarlaNative.h index 8ed18f819..32f5eec5c 100644 --- a/source/backend/CarlaNative.h +++ b/source/backend/CarlaNative.h @@ -210,17 +210,21 @@ void carla_register_native_plugin_midiThrough(); void carla_register_native_plugin_midiTranspose(); void carla_register_native_plugin_nekofilter(); -// DISTRHO plugins -void carla_register_native_plugin_3BandEQ(); -void carla_register_native_plugin_3BandSplitter(); -void carla_register_native_plugin_PingPongPan(); -void carla_register_native_plugin_Notes(); - #ifdef WANT_AUDIOFILE // AudioFile void carla_register_native_plugin_audiofile(); #endif +#ifdef WANT_OPENGL +// DISTRHO plugins (OpenGL) +void carla_register_native_plugin_3BandEQ(); +void carla_register_native_plugin_3BandSplitter(); +void carla_register_native_plugin_PingPongPan(); +#endif + +// DISTRHO plugins (Qt) +void carla_register_native_plugin_Notes(); + #ifdef WANT_ZYNADDSUBFX // ZynAddSubFX void carla_register_native_plugin_zynaddsubfx(); diff --git a/source/backend/Makefile.mk b/source/backend/Makefile.mk index c19fd4bcb..dac1f26f0 100644 --- a/source/backend/Makefile.mk +++ b/source/backend/Makefile.mk @@ -8,12 +8,11 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BACKEND_FLAGS = -pthread -fvisibility=hidden -fPIC -I. -I.. -I../../includes -BACKEND_FLAGS += $(shell pkg-config --cflags gl) +BACKEND_FLAGS = -fvisibility=hidden -fPIC +BACKEND_FLAGS += -I. -I.. -I../../includes -I../../libs -I../../utils BUILD_C_FLAGS += $(BACKEND_FLAGS) -BUILD_CXX_FLAGS += $(BACKEND_FLAGS) -I../../libs -I../../libs/distrho -I../../utils -LINK_FLAGS += $(shell pkg-config --libs gl) -lpthread +BUILD_CXX_FLAGS += $(BACKEND_FLAGS) # -------------------------------------------------------------- @@ -50,6 +49,10 @@ ifeq ($(HAVE_LINUXSAMPLER),true) BUILD_CXX_FLAGS += -DWANT_LINUXSAMPLER endif +ifeq ($(HAVE_OPENGL),true) +BUILD_CXX_FLAGS += -DWANT_OPENGL +endif + ifeq ($(HAVE_AF_DEPS),true) BUILD_CXX_FLAGS += -DWANT_AUDIOFILE endif diff --git a/source/backend/engine/Makefile b/source/backend/engine/Makefile index 2fe0ee91d..ba7b866f4 100644 --- a/source/backend/engine/Makefile +++ b/source/backend/engine/Makefile @@ -69,7 +69,7 @@ debug: # -------------------------------------------------------------- -%.cpp.o: %.cpp ../CarlaPlugin.hpp ../CarlaEngine.hpp CarlaEngineInternal.hpp CarlaEngineOsc.hpp CarlaEngineThread.hpp +%.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp CarlaEngineInternal.hpp CarlaEngineOsc.hpp CarlaEngineThread.hpp $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ $(SHARED): $(OBJS) diff --git a/source/backend/native/Makefile b/source/backend/native/Makefile index 34ba93733..55b8020d5 100644 --- a/source/backend/native/Makefile +++ b/source/backend/native/Makefile @@ -11,16 +11,22 @@ include ../Makefile.mk BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui) -I../../widgets LINK_FLAGS += $(shell pkg-config --libs QtCore QtGui) +# -------------------------------------------------------------- + ifeq ($(HAVE_AF_DEPS),true) AF_C_FLAGS = $(BUILD_C_FLAGS) AF_C_FLAGS += $(shell pkg-config --cflags libavcodec libavformat sndfile) LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat sndfile) endif -# -Izynaddsubfx/UI +ifeq ($(HAVE_OPENGL),true) +GL_CXX_FLAGS = $(BUILD_CXX_FLAGS) +GL_CXX_FLAGS += $(shell pkg-config --cflags gl) +LINK_FLAGS += $(shell pkg-config --cflags gl) +endif ifeq ($(HAVE_ZYN_DEPS),true) -ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) -DNTK_GUI +ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib) LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib) ifeq ($(HAVE_ZYN_UI_DEPS),true) @@ -41,21 +47,26 @@ OBJS = \ midi-transpose.c.o \ nekofilter.c.o -# DISTRHO plugins -OBJS += \ - distrho-3bandeq.cpp.o \ - distrho-3bandsplitter.cpp.o \ - distrho-pingpongpan.cpp.o \ - distrho-notes.cpp.o - # AudioFile ifeq ($(HAVE_AF_DEPS),true) OBJS += \ audiofile.c.o endif -# ZynAddSubFX +# DISTRHO plugins (OpenGL) +ifeq ($(HAVE_OPENGL),true) +OBJS += \ + distrho-3bandeq.cpp.o \ + distrho-3bandsplitter.cpp.o \ + distrho-pingpongpan.cpp.o +endif + +# DISTRHO plugins (Qt) +OBJS += \ + distrho-notes.cpp.o + ifeq ($(HAVE_ZYN_DEPS),true) +# ZynAddSubFX OBJS += \ zynaddsubfx.cpp.o \ zynaddsubfx-src.cpp.o @@ -63,7 +74,7 @@ OBJS += \ ifeq ($(HAVE_ZYN_UI_DEPS),true) OBJS += zynaddsubfx-ui.cpp.o -ZYN_UI_FILES = \ +ZYN_UI_FILES_CPP = \ zynaddsubfx/UI/ADnoteUI.cpp \ zynaddsubfx/UI/BankUI.cpp \ zynaddsubfx/UI/ConfigUI.cpp \ @@ -80,14 +91,35 @@ ZYN_UI_FILES = \ zynaddsubfx/UI/ResonanceUI.cpp \ zynaddsubfx/UI/SUBnoteUI.cpp \ zynaddsubfx/UI/VirKeyboard.cpp + +ZYN_UI_FILES_H = \ + zynaddsubfx/UI/ADnoteUI.h \ + zynaddsubfx/UI/BankUI.h \ + zynaddsubfx/UI/ConfigUI.h \ + zynaddsubfx/UI/EffUI.h \ + zynaddsubfx/UI/EnvelopeUI.h \ + zynaddsubfx/UI/FilterUI.h \ + zynaddsubfx/UI/LFOUI.h \ + zynaddsubfx/UI/MasterUI.h \ + zynaddsubfx/UI/MicrotonalUI.h \ + zynaddsubfx/UI/OscilGenUI.h \ + zynaddsubfx/UI/PADnoteUI.h \ + zynaddsubfx/UI/PartUI.h \ + zynaddsubfx/UI/PresetsUI.h \ + zynaddsubfx/UI/ResonanceUI.h \ + zynaddsubfx/UI/SUBnoteUI.h \ + zynaddsubfx/UI/VirKeyboard.h endif endif SHARED = ../libcarla_native.so STATIC = ../libcarla_native.a -LIBS = ../../libs/dgl.a -LIBS += ../../libs/widgets.a +LIBS = ../../libs/widgets.a + +ifeq ($(HAVE_OPENGL),true) +LIBS += ../../libs/dgl.a +endif # -------------------------------------------------------------- @@ -95,7 +127,8 @@ all: $(STATIC) clean: rm -f $(OBJS) $(SHARED) $(STATIC) - rm -f $(ZYN_UI_FILES) + rm -f $(ZYN_UI_FILES_CPP) + rm -f $(ZYN_UI_FILES_H) rm -f moc_*.cpp debug: @@ -117,21 +150,21 @@ $(STATIC): $(OBJS) # -------------------------------------------------------------- +audiofile.c.o: audiofile.c + $(CC) $< $(AF_C_FLAGS) -c -o $@ + distrho-3bandeq.cpp.o: distrho-3bandeq.cpp 3bandeq/DistrhoArtwork3BandEQ.cpp 3bandeq/DistrhoPlugin3BandEQ.cpp 3bandeq/DistrhoUI3BandEQ.cpp distrho/DistrhoPluginCarla.cpp - $(CXX) $< $(BUILD_CXX_FLAGS) -I3bandeq -DDISTRHO_NAMESPACE=DISTRHO_3BandEQ -c -o $@ + $(CXX) $< $(GL_CXX_FLAGS) -I3bandeq -DDISTRHO_NAMESPACE=DISTRHO_3BandEQ -c -o $@ distrho-3bandsplitter.cpp.o: distrho-3bandsplitter.cpp 3bandsplitter/DistrhoArtwork3BandSplitter.cpp 3bandsplitter/DistrhoPlugin3BandSplitter.cpp 3bandsplitter/DistrhoUI3BandSplitter.cpp distrho/DistrhoPluginCarla.cpp - $(CXX) $< $(BUILD_CXX_FLAGS) -I3bandsplitter -DDISTRHO_NAMESPACE=DISTRHO_3BandSplitter -c -o $@ + $(CXX) $< $(GL_CXX_FLAGS) -I3bandsplitter -DDISTRHO_NAMESPACE=DISTRHO_3BandSplitter -c -o $@ distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp pingpongpan/DistrhoArtworkPingPongPan.cpp pingpongpan/DistrhoPluginPingPongPan.cpp pingpongpan/DistrhoUIPingPongPan.cpp distrho/DistrhoPluginCarla.cpp - $(CXX) $< $(BUILD_CXX_FLAGS) -Ipingpongpan -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -c -o $@ + $(CXX) $< $(GL_CXX_FLAGS) -Ipingpongpan -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -c -o $@ distrho-notes.cpp.o: distrho-notes.cpp notes/DistrhoPluginNotes.cpp notes/DistrhoUINotes.cpp distrho/DistrhoPluginCarla.cpp moc_DistrhoUINotes.cpp $(CXX) $< $(BUILD_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@ -audiofile.c.o: audiofile.c - $(CC) $< $(AF_C_FLAGS) -c -o $@ - zynaddsubfx.cpp.o: zynaddsubfx.cpp $(ZYN_UI_FILES) $(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ diff --git a/source/backend/plugin/Makefile b/source/backend/plugin/Makefile index f6010d161..4e09929d8 100644 --- a/source/backend/plugin/Makefile +++ b/source/backend/plugin/Makefile @@ -8,8 +8,10 @@ include ../Makefile.mk # -------------------------------------------------------------- -BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore) -LINK_FLAGS += $(shell pkg-config --libs liblo QtCore) +BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore QtGui) +LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui) + +# -------------------------------------------------------------- ifeq ($(HAVE_FLUIDSYNTH),true) BUILD_CXX_FLAGS += $(shell pkg-config --cflags fluidsynth) @@ -51,7 +53,7 @@ debug: # -------------------------------------------------------------- -%.cpp.o: %.cpp ../CarlaEngine.hpp ../CarlaPlugin.hpp CarlaPluginInternal.hpp CarlaPluginThread.hpp +%.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp CarlaPluginInternal.hpp CarlaPluginThread.hpp $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ $(SHARED): $(OBJS) diff --git a/source/backend/standalone/Makefile b/source/backend/standalone/Makefile index ea2a929b9..21ef298e4 100644 --- a/source/backend/standalone/Makefile +++ b/source/backend/standalone/Makefile @@ -9,8 +9,7 @@ include ../Makefile.mk # -------------------------------------------------------------- # Common -LINK_FLAGS += $(shell pkg-config --libs gl liblo QtCore QtXml) -LINK_FLAGS += -lX11 +LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui QtXml) # -------------------------------------------------------------- # Engine @@ -18,9 +17,11 @@ LINK_FLAGS += -lX11 ifeq ($(HAVE_ALSA),true) LINK_FLAGS += $(shell pkg-config --libs alsa) endif + ifeq ($(HAVE_JACK),true) LINK_FLAGS += $(shell pkg-config --libs jack) endif + ifeq ($(HAVE_PULSEAUDIO),true) LINK_FLAGS += $(shell pkg-config --libs libpulse-simple) endif @@ -31,6 +32,7 @@ endif ifeq ($(HAVE_FLUIDSYNTH),true) LINK_FLAGS += $(shell pkg-config --libs fluidsynth) endif + ifeq ($(HAVE_LINUXSAMPLER),true) LINK_FLAGS += $(shell pkg-config --libs linuxsampler) endif @@ -43,11 +45,16 @@ LINK_FLAGS += $(shell pkg-config --libs QtGui) ifeq ($(HAVE_AF_DEPS),true) LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat sndfile) endif + +ifeq ($(HAVE_OPENGL),true) +LINK_FLAGS += $(shell pkg-config --libs gl) +endif + ifeq ($(HAVE_ZYN_DEPS),true) LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib) -# ifeq ($(HAVE_ZYN_UI_DEPS),true) +ifeq ($(HAVE_ZYN_UI_DEPS),true) LINK_FLAGS += $(shell pkg-config --libs ntk ntk_images) -# endif +endif endif # -------------------------------------------------------------- @@ -55,11 +62,17 @@ endif LIBS = ../libcarla_engine.a LIBS += ../libcarla_plugin.a LIBS += ../libcarla_native.a -LIBS += ../../libs/dgl.a -LIBS += ../../libs/lilv.a LIBS += ../../libs/rtmempool.a LIBS += ../../libs/widgets.a +ifeq ($(CARLA_PLUGIN_SUPPORT),true) +LIBS += ../../libs/lilv.a +endif + +ifeq ($(HAVE_OPENGL),true) +LIBS += ../../libs/dgl.a +endif + OBJS = \ CarlaStandalone.cpp.o @@ -78,7 +91,7 @@ debug: # -------------------------------------------------------------- -%.cpp.o: %.cpp ../CarlaEngine.hpp ../CarlaPlugin.hpp +%.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ $(SHARED): $(OBJS) $(LIBS) diff --git a/source/discovery/Makefile b/source/discovery/Makefile index 456bce54d..1c9aa02c6 100644 --- a/source/discovery/Makefile +++ b/source/discovery/Makefile @@ -12,6 +12,8 @@ BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) LINK_FLAGS += $(shell pkg-config --libs QtCore) +# -------------------------------------------------------------- + ifeq ($(CARLA_PLUGIN_SUPPORT),true) BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST endif