From 9c27944f0f4230df7b4eb88f7baf5ab510f02983 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 7 Oct 2013 16:48:06 +0100 Subject: [PATCH] More makefile tweaks --- .gitignore | 1 + Makefile | 8 ++++++-- source/Makefile.mk | 7 ++----- source/modules/Makefile | 14 ++++++------- source/modules/carla_native/Makefile | 30 +++++++++++++++++++++------- source/modules/carla_native/_link.c | 22 ++++++++++++++++++++ source/modules/distrho/dgl/Makefile | 24 +++++++++++++++------- source/modules/lilv/Makefile | 12 +++++++---- source/modules/rtmempool/Makefile | 10 +++++----- 9 files changed, 91 insertions(+), 37 deletions(-) create mode 100644 source/modules/carla_native/_link.c diff --git a/.gitignore b/.gitignore index 9ac9ccbcd..53e148bdb 100644 --- a/.gitignore +++ b/.gitignore @@ -125,6 +125,7 @@ source/modules/carla_native/zynaddsubfx/UI/VirKeyboard.cpp source/modules/carla_native/zynaddsubfx/UI/VirKeyboard.h # Other +source/includes/asio/ source/includes/rewire/ source/includes/vst/ source/includes/vst3/ diff --git a/Makefile b/Makefile index ace774aa1..c52c2c8d5 100644 --- a/Makefile +++ b/Makefile @@ -315,7 +315,11 @@ ifeq ($(HAVE_QT4),true) else @echo "Qt4: $(ANS_NO) $(mS)Qt4 missing$(mE)" endif +ifeq ($(HAVE_QT5),true) @echo "Qt5: $(ANS_YES) (bridge)" +else + @echo "Qt5: $(ANS_NO) $(mS)Qt5 missing$(mE)" +endif @echo "X11: $(ANS_YES) (direct+bridge)" else @echo "Gtk2: $(ANS_NO) $(mZ)Linux only$(mE)" @@ -379,7 +383,7 @@ endif ifeq ($(HAVE_MF_DEPS),true) @echo "MidiFile: $(ANS_YES)" else - @echo "MidiFile: $(ANS_NO) $(mS)libsmf missing$(mE)" + @echo "MidiFile: $(ANS_NO) $(mS)LibSMF missing$(mE)" endif ifeq ($(HAVE_OPENGL),true) @echo "DISTRHO: $(ANS_YES)" @@ -393,7 +397,7 @@ else @echo "ZynAddSubFX:$(ANS_YES) (without UI) $(mS)NTK missing$(mE)" endif else - @echo "ZynAddSubFX:$(ANS_NO) $(mS)fftw-3, mxml or zlib missing$(mE)" + @echo "ZynAddSubFX:$(ANS_NO) $(mS)fftw3, mxml or zlib missing$(mE)" endif # -------------------------------------------------------------- diff --git a/source/Makefile.mk b/source/Makefile.mk index 5965ac538..fc5d15954 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -85,10 +85,6 @@ ifneq ($(shell pkg-config --exists liblo && echo true),true) $(error liblo missing, cannot continue) endif -ifneq ($(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true),true) -$(error Qt5 missing, cannot continue) -endif - ifeq ($(LINUX),true) ifneq ($(shell pkg-config --exists x11 && echo true),true) $(error X11 missing, cannot continue) @@ -118,7 +114,8 @@ HAVE_ALSA = $(shell pkg-config --exists alsa && echo true) HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true) HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true) HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true) -HAVE_QT4 = $(shell pkg-config --exists QtCore && echo true) +HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true) +HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) endif ifeq ($(CARLA_SAMPLERS_SUPPORT),true) diff --git a/source/modules/Makefile b/source/modules/Makefile index 9cb3f58a9..641bc1840 100644 --- a/source/modules/Makefile +++ b/source/modules/Makefile @@ -131,14 +131,14 @@ jackbridge-wine64: # -------------------------------------------------------------- -libjuce_%.dll: - $(MAKE) -C juce_$* ../libjuce_$*.dll +lib%.dll: + $(MAKE) -C $* ../lib$*.dll -libjuce_%.dylib: - $(MAKE) -C juce_$* ../libjuce_$*.dylib +lib%.dylib: + $(MAKE) -C $* ../lib$*.dylib -libjuce_%.so: - $(MAKE) -C juce_$* ../libjuce_$*.so +lib%.so: + $(MAKE) -C $* ../lib$*.so # -------------------------------------------------------------- @@ -163,6 +163,6 @@ clean: # -------------------------------------------------------------- -.PHONY: carla_native dgl juce_audio_basics juce_audio_devices juce_audio_formats juce_audio_processors juce_core juce_data_structures juce_events juce_graphics juce_gui_basics lilv rtmempool theme +.PHONY: carla_native juce_audio_basics juce_audio_devices juce_audio_formats juce_audio_processors juce_core juce_data_structures juce_events juce_graphics juce_gui_basics lilv rtmempool theme # -------------------------------------------------------------- diff --git a/source/modules/carla_native/Makefile b/source/modules/carla_native/Makefile index 81051a79c..a95787e0d 100644 --- a/source/modules/carla_native/Makefile +++ b/source/modules/carla_native/Makefile @@ -11,36 +11,52 @@ include ../../Makefile.mk BUILD_C_FLAGS += -I. -I.. -I../../includes BUILD_CXX_FLAGS += -I. -I.. -I../../includes -I../../utils -I../distrho +LINK_FLAGS += ../juce_audio_basics.a $(JUCE_AUDIO_BASICS_LIBS) +LINK_FLAGS += ../juce_core.a $(JUCE_CORE_LIBS) +LINK_FLAGS += ../juce_data_structures.a $(JUCE_DATA_STRUCTURES_LIBS) +LINK_FLAGS += ../juce_events.a $(JUCE_EVENTS_LIBS) +LINK_FLAGS += ../juce_graphics.a $(JUCE_GRAPHICS_LIBS) +LINK_FLAGS += ../juce_gui_basics.a $(JUCE_GUI_BASICS_LIBS) + # -------------------------------------------------------------- ifeq ($(HAVE_OPENGL),true) GL_CXX_FLAGS = $(BUILD_CXX_FLAGS) GL_CXX_FLAGS += $(shell pkg-config --cflags gl) +LINK_FLAGS += ../dgl.a $(shell pkg-config --libs gl) endif ifeq ($(HAVE_AF_DEPS),true) AF_C_FLAGS = $(BUILD_C_FLAGS) AF_C_FLAGS += $(shell pkg-config --cflags sndfile) +LINK_FLAGS += $(shell pkg-config --libs sndfile) ifeq ($(HAVE_FFMPEG),true) AF_C_FLAGS += -DHAVE_FFMPEG AF_C_FLAGS += $(shell pkg-config --cflags libavcodec libavformat libavutil) +LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat libavutil) endif endif ifeq ($(HAVE_MF_DEPS),true) MF_CXX_FLAGS = $(BUILD_CXX_FLAGS) MF_CXX_FLAGS += $(shell pkg-config --cflags smf) +LINK_FLAGS += $(shell pkg-config --libs smf) endif ifeq ($(HAVE_ZYN_DEPS),true) 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) ZYN_CXX_FLAGS += -DNTK_GUI -DWANT_ZYNADDSUBFX_UI -ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk ntk_images) +ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk_images ntk) +LINK_FLAGS += $(shell pkg-config --libs ntk_images ntk) endif endif +# Implement carla_register_native_plugin +LINK_FLAGS += -I.. _link.c + # -------------------------------------------------------------- # Simple plugins (C) @@ -148,13 +164,13 @@ all: ../carla_native.a rm -f $@ $(AR) rs $@ $^ -../carla_native.dll: $(OBJS) +../libcarla_native.dll: $(OBJS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ -../carla_native.dylib: $(OBJS) +../libcarla_native.dylib: $(OBJS) $(CXX) $^ -dynamiclib $(LINK_FLAGS) -o $@ -../carla_native.so: $(OBJS) +../libcarla_native.so: $(OBJS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ # -------------------------------------------------------------- @@ -218,8 +234,8 @@ zynaddsubfx/UI/%.h: zynaddsubfx/UI/%.fl %.c.o: %.c $(CC) $< $(BUILD_C_FLAGS) -c -o $@ -%.cpp.o: %.cpp - $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ +# %.cpp.o: %.cpp +# $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ moc_%.cpp: %.hpp $(MOC) $< -DMOC_PARSING -o $@ @@ -227,7 +243,7 @@ moc_%.cpp: %.hpp # -------------------------------------------------------------- clean: - rm -f $(OBJS) ../carla_native*.a + rm -f $(OBJS) ../carla_native*.a ../libcarla_native.* rm -f $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP) debug: diff --git a/source/modules/carla_native/_link.c b/source/modules/carla_native/_link.c new file mode 100644 index 000000000..022d50426 --- /dev/null +++ b/source/modules/carla_native/_link.c @@ -0,0 +1,22 @@ +/* + * Carla Native Plugins + * Copyright (C) 2013 Filipe Coelho + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For a full copy of the GNU General Public License see the doc/GPL.txt file. + */ + +#include "CarlaNative.h" + +// Dummy function for linking test +void carla_register_native_plugin(const PluginDescriptor* desc) +{ (void)desc; } diff --git a/source/modules/distrho/dgl/Makefile b/source/modules/distrho/dgl/Makefile index e3de27d2a..175394ac2 100644 --- a/source/modules/distrho/dgl/Makefile +++ b/source/modules/distrho/dgl/Makefile @@ -71,12 +71,22 @@ OBJS_win64 = \ src/Widget.cpp.win64.o \ src/Window.cpp.win64.o +ifeq ($(LINUX),true) +BASE_FLAGS += $(shell pkg-config --cflags gl x11) +LINK_FLAGS += $(shell pkg-config --libs gl x11) +endif + ifeq ($(MACOS),true) +LINK_FLAGS += -framework OpenGL -framework Cocoa OBJS += src/pugl/pugl_osx_extended.m.o OBJS_posix32 += src/pugl/pugl_osx_extended.m.posix32.o OBJS_posix64 += src/pugl/pugl_osx_extended.m.posix64.o endif +ifeq ($(WIN32),true) +LINK_FLAGS += -lopengl32 -lgdi32 +endif + # -------------------------------------------------------------- all: ../../dgl.a @@ -103,14 +113,14 @@ win64: ../../dgl.win64.a ../../dgl.win64.a: $(OBJS_win64) $(AR) rs $@ $^ -../../dgl.dll: $(OBJS) - $(CXX) $^ -shared $(LINK_FLAGS) -lopengl32 -lgdi32 -o $@ +../../libdgl.dll: $(OBJS) + $(CXX) $^ -shared $(LINK_FLAGS) -o $@ -../../dgl.dylib: $(OBJS) - $(CXX) $^ -dynamiclib $(LINK_FLAGS) -framework OpenGL -framework Cocoa -o $@ +../../libdgl.dylib: $(OBJS) + $(CXX) $^ -dynamiclib $(LINK_FLAGS) -o $@ -../../dgl.so: $(OBJS) - $(CXX) $^ -shared $(LINK_FLAGS) -lGL -lX11 -o $@ +../../libdgl.so: $(OBJS) + $(CXX) $^ -shared $(LINK_FLAGS) -o $@ # -------------------------------------------------------------- @@ -135,7 +145,7 @@ win64: ../../dgl.win64.a # -------------------------------------------------------------- clean: - rm -f *.o src/*.o src/pugl/*.o ../../dgl.* + rm -f *.o src/*.o src/pugl/*.o ../../dgl*.a ../../libdgl.* debug: $(MAKE) DEBUG=true diff --git a/source/modules/lilv/Makefile b/source/modules/lilv/Makefile index 11acf0a7a..fccd36777 100644 --- a/source/modules/lilv/Makefile +++ b/source/modules/lilv/Makefile @@ -22,6 +22,10 @@ OBJS_posix64 = serd.c.posix64.o sord.c.posix64.o sratom.c.posix64.o lilv.c.posix OBJS_win32 = serd.c.win32.o sord.c.win32.o sratom.c.win32.o lilv.c.win32.o OBJS_win64 = serd.c.win64.o sord.c.win64.o sratom.c.win64.o lilv.c.win64.o +ifneq ($(WIN32),true) +LINK_FLAGS += -ldl +endif + # -------------------------------------------------------------- all: ../lilv.a @@ -48,13 +52,13 @@ win64: ../lilv.win64.a ../lilv.win64.a: $(OBJS_win64) $(AR) rs $@ $^ -../lilv.dll: $(OBJS) +../liblilv.dll: $(OBJS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ -../lilv.dylib: $(OBJS) +../liblilv.dylib: $(OBJS) $(CXX) $^ -dynamiclib $(LINK_FLAGS) -o $@ -../lilv.so: $(OBJS) +../liblilv.so: $(OBJS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ # -------------------------------------------------------------- @@ -102,7 +106,7 @@ lilv.c.%64.o: lilv.c # -------------------------------------------------------------- clean: - rm -f *.o ../lilv*.a + rm -f *.o ../lilv*.a ../liblilv.* debug: $(MAKE) DEBUG=true diff --git a/source/modules/rtmempool/Makefile b/source/modules/rtmempool/Makefile index ba618fa92..8e08fc600 100644 --- a/source/modules/rtmempool/Makefile +++ b/source/modules/rtmempool/Makefile @@ -8,7 +8,7 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BUILD_C_FLAGS += -I. -I../../includes -pthread +BUILD_C_FLAGS += -I. -I../../includes ifeq ($(CARLA_PLUGIN_SUPPORT),true) BUILD_C_FLAGS += -DWANT_LV2 @@ -48,13 +48,13 @@ win64: ../rtmempool.win64.a ../rtmempool.win64.a: $(OBJS_win64) $(AR) rs $@ $^ -../rtmempool.dll: $(OBJS) +../librtmempool.dll: $(OBJS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ -../rtmempool.dylib: $(OBJS) +../librtmempool.dylib: $(OBJS) $(CXX) $^ -dynamiclib $(LINK_FLAGS) -o $@ -../rtmempool.so: $(OBJS) +../librtmempool.so: $(OBJS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ # -------------------------------------------------------------- @@ -77,7 +77,7 @@ win64: ../rtmempool.win64.a # -------------------------------------------------------------- clean: - rm -f *.o ../rtmempool*.a + rm -f *.o ../rtmempool*.a ../librtmempool.* debug: $(MAKE) DEBUG=true