From 83ac2a8d259bb07f8cc754d8eacd0a63217d713c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 5 Feb 2017 17:54:56 +0100 Subject: Compile engine as a library. --- Makefile.am | 4 ++-- drumgizmo/Makefile.am | 7 ++----- plugin/Makefile.am | 33 +++++++++++++++++++------------- plugingui/Makefile.am | 28 ++++++++++----------------- src/Makefile.am | 47 ++++++++++++++++++++++++++++++++++++++++++++++ test/Makefile.am | 26 ++++++++++++------------- test/dgreftest/Makefile.am | 7 ++----- 7 files changed, 95 insertions(+), 57 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3784c39..94d578c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = gnu -SUBDIRS = plugingui tools include src plugin drumgizmo man test -DISTDIRS = plugingui tools include src plugin drumgizmo man test +SUBDIRS = tools include src plugingui plugin drumgizmo man test +DISTDIRS = tools include src plugingui plugin drumgizmo man test EXTRA_DIST = \ version.h \ diff --git a/drumgizmo/Makefile.am b/drumgizmo/Makefile.am index 369cd03..ee51e66 100644 --- a/drumgizmo/Makefile.am +++ b/drumgizmo/Makefile.am @@ -2,15 +2,13 @@ DISTDIRS = input output if ENABLE_CLI -include $(top_srcdir)/src/Makefile.am.drumgizmo - bin_PROGRAMS = drumgizmo -drumgizmo_LDADD = $(DRUMGIZMO_LIBS) $(JACK_LIBS) +drumgizmo_LDADD = $(JACK_LIBS) $(top_srcdir)/src/libdg.la drumgizmo_LDFLAGS = -drumgizmo_CXXFLAGS = $(DRUMGIZMO_CPPFLAGS) \ +drumgizmo_CXXFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src \ -I$(top_srcdir)/hugin -DWITH_HUG_MUTEX -DWITH_HUG_FILTER \ $(JACK_CFLAGS) $(SSEFLAGS) @@ -20,7 +18,6 @@ drumgizmo_CFLAGS = -DWITH_HUG_MUTEX -DWITH_HUG_FILTER drumgizmo_SOURCES = \ drumgizmoc.cc \ enginefactory.cc \ - $(DRUMGIZMO_SOURCES) \ $(top_srcdir)/hugin/hugin.c \ $(top_srcdir)/hugin/hugin_filter.c diff --git a/plugin/Makefile.am b/plugin/Makefile.am index c6c9f1a..2b4ff3e 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -1,8 +1,5 @@ SUBDIRS = vst -#include $(top_srcdir)/plugingui/Makefile.am.plugingui -include $(top_srcdir)/src/Makefile.am.drumgizmo - ####### # LV2 @@ -14,18 +11,23 @@ lv2plugin_DATA = manifest.ttl drumgizmo.ttl endif drumgizmo_la_CXXFLAGS = -DLV2 -DLV2_PLUGIN_URI=\"http://drumgizmo.org/lv2\" \ - -I$(top_srcdir)/plugin/plugingizmo $(DRUMGIZMO_CPPFLAGS) \ - -I$(top_srcdir)/plugingui + $(LV2_CFLAGS) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/plugin/plugingizmo \ + -I$(top_srcdir)/plugingui \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/hugin drumgizmo_la_SOURCES = \ - $(DRUMGIZMO_SOURCES) \ + $(top_srcdir)/hugin/hugin.c \ $(top_srcdir)/plugin/plugingizmo/midievent.cc \ $(top_srcdir)/plugin/plugingizmo/pluginlv2.cc \ drumgizmo_plugin.cc drumgizmo_la_LDFLAGS = -shared -module -avoid-version -drumgizmo_la_LIBADD = $(LV2_LIBS) $(DRUMGIZMO_LIBS) \ - $(top_srcdir)/plugingui/libdggui.la +drumgizmo_la_LIBADD = $(LV2_LIBS) \ + $(top_srcdir)/plugingui/libdggui.la \ + $(top_srcdir)/src/libdg.la ####### @@ -38,18 +40,23 @@ vstplugin_DATA = endif drumgizmo_vst_la_CXXFLAGS = -DVST \ - -I$(top_srcdir)/plugin/plugingizmo $(DRUMGIZMO_CPPFLAGS) \ - $(VST_CPPFLAGS) -Ivst -I$(top_srcdir)/plugingui + -I$(top_srcdir)/include \ + -I$(top_srcdir)/plugin/plugingizmo \ + -I$(top_srcdir)/plugingui \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/hugin \ + $(VST_CPPFLAGS) -Ivst drumgizmo_vst_la_SOURCES = \ - $(DRUMGIZMO_SOURCES) \ + $(top_srcdir)/hugin/hugin.c \ $(top_srcdir)/plugin/plugingizmo/midievent.cc \ $(top_srcdir)/plugin/plugingizmo/pluginvst.cc \ drumgizmo_plugin.cc drumgizmo_vst_la_LDFLAGS = -shared -module -avoid-version -drumgizmo_vst_la_LIBADD = vst/libvstsdk.la $(DRUMGIZMO_LIBS) \ - $(top_srcdir)/plugingui/libdggui.la +drumgizmo_vst_la_LIBADD = vst/libvstsdk.la \ + $(top_srcdir)/plugingui/libdggui.la \ + $(top_srcdir)/src/libdg.la install-exec-hook: diff --git a/plugingui/Makefile.am b/plugingui/Makefile.am index e67b9f6..1e90c89 100644 --- a/plugingui/Makefile.am +++ b/plugingui/Makefile.am @@ -1,16 +1,13 @@ noinst_PROGRAMS = plugingui rcgen noinst_LTLIBRARIES = libdggui.la -#include Makefile.am.plugingui - resource_data.cc : rcgen (cd resources; ../rcgen * > ../resource_data.cc) -PLUGIN_GUI_LIBS = $(GUI_LIBS) $(PTHREAD_LIBS) - -PLUGIN_GUI_CPPFLAGS = \ - $(GUI_CPPFLAGS) -I$(top_srcdir)/hugin \ - -I$(top_srcdir)/plugingui \ +libdggui_la_CPPFLAGS = \ + $(GUI_CPPFLAGS) \ + -I$(top_srcdir)/hugin \ + -I$(top_srcdir)/src \ -DWITH_HUG_MUTEX $(PTHREAD_CFLAGS) \ -DLODEPNG_NO_COMPILE_ENCODER \ -DLODEPNG_NO_COMPILE_DISK \ @@ -18,10 +15,10 @@ PLUGIN_GUI_CPPFLAGS = \ -DLODEPNG_NO_COMPILE_ERROR_TEXT \ -DLODEPNG_NO_COMPILE_CPP -libdggui_la_CPPFLAGS = $(PLUGIN_GUI_CPPFLAGS) -I../src -libdggui_la_LIBADD = $(PLUGIN_GUI_LIBS) +libdggui_la_LIBADD = \ + $(GUI_LIBS) $(PTHREAD_LIBS) + nodist_libdggui_la_SOURCES = \ - $(top_srcdir)/hugin/hugin.c \ dgwindow.cc \ plugingui.cc \ label.cc \ @@ -76,7 +73,6 @@ if ENABLE_PUGL nodist_libdggui_la_SOURCES += \ nativewindow_pugl.cc \ $(top_srcdir)/pugl/pugl/pugl_x11.c -PLUGIN_GUI_CPPFLAGS += -I$(top_srcdir)/pugl/pugl endif #if ENABLE_COCOA @@ -85,20 +81,16 @@ endif # nativewindow_cocoa.cc #endif -plugingui_LDADD = $(PLUGIN_GUI_LIBS) libdggui.la +plugingui_LDADD = libdggui.la $(top_srcdir)/src/libdg.la plugingui_CXXFLAGS = $(SNDFILE_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) \ - -I$(top_srcdir)/include $(PLUGIN_GUI_CPPFLAGS) -I$(top_srcdir)/src \ - -DSTANDALONE + -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/hugin plugingui_CFLAGS = $(plugingui_CXXFLAGS) plugingui_SOURCES = \ testmain.cc \ - $(top_srcdir)/src/configfile.cc \ - $(top_srcdir)/src/thread.cc \ - $(top_srcdir)/src/semaphore.cc \ - $(top_srcdir)/src/mutex.cc + $(top_srcdir)/hugin/hugin.c rcgen_SOURCES = rcgen.cc diff --git a/src/Makefile.am b/src/Makefile.am index c7cb8be..2277eeb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,50 @@ +noinst_LTLIBRARIES = libdg.la + +libdg_la_CPPFLAGS = \ + -I$(top_srcdir)/include -I$(top_srcdir)/hugin \ + $(SSEFLAGS) \ + $(ZITA_CPPFLAGS) $(SNDFILE_CFLAGS) $(EXPAT_CFLAGS) $(SAMPLERATE_CFLAGS) \ + $(PTHREAD_CFLAGS) + +libdg_la_LIBADD = \ + $(ZITA_LIBS) $(SNDFILE_LIBS) $(EXPAT_LIBS) $(SAMPLERATE_LIBS) \ + $(PTHREAD_LIBS) + +nodist_libdg_la_SOURCES = \ + audiocachefile.cc \ + audiocache.cc \ + audiocacheeventhandler.cc \ + audiocacheidmanager.cc \ + audioinputenginemidi.cc \ + audiofile.cc \ + channel.cc \ + channelmixer.cc \ + chresampler.cc \ + configfile.cc \ + configparser.cc \ + drumgizmo.cc \ + drumkit.cc \ + drumkitloader.cc \ + drumkitparser.cc \ + events.cc \ + inputprocessor.cc \ + instrument.cc \ + instrumentparser.cc \ + latencyfilter.cc \ + memchecker.cc \ + midimapparser.cc \ + midimapper.cc \ + mutex.cc \ + path.cc \ + powerlist.cc \ + random.cc \ + sample.cc \ + semaphore.cc \ + saxparser.cc \ + staminafilter.cc \ + thread.cc \ + versionstr.cc + EXTRA_DIST = \ atomic.h \ audio.h \ diff --git a/test/Makefile.am b/test/Makefile.am index 1cb6ce1..12d4713 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,9 +3,6 @@ SUBDIRS = dgreftest if ENABLE_TESTS -include $(top_srcdir)/src/Makefile.am.drumgizmo -#include $(top_srcdir)/plugingui/Makefile.am.plugingui - TESTS = resource enginetest paintertest resampler configfile audiocache \ audiocachefile audiocacheidmanager audiocacheeventhandler \ memchecker randomtest atomictest syncedsettingstest imagecachetest \ @@ -90,11 +87,10 @@ audiocacheeventhandler_SOURCES = \ enginetest_CXXFLAGS = -DOUTPUT=\"enginetest\" $(CPPUNIT_CFLAGS) \ -I$(top_srcdir)/src -I$(top_srcdir)/include \ - -I$(top_srcdir)/hugin -DDISABLE_HUGIN $(PTHREAD_CFLAGS) -enginetest_CFLAGS = -DDISABLE_HUGIN -enginetest_LDFLAGS = $(CPPUNIT_LIBS) $(DRUMGIZMO_LIBS) $(PTHREAD_LIBS) $(SNDFILE_LIBS) + -I$(top_srcdir)/hugin $(PTHREAD_CFLAGS) +enginetest_LDFLAGS = $(CPPUNIT_LIBS) $(PTHREAD_LIBS) $(SNDFILE_LIBS) \ + $(top_srcdir)/src/libdg.la enginetest_SOURCES = \ - $(DRUMGIZMO_SOURCES) \ $(top_srcdir)/hugin/hugin.c \ test.cc \ drumkit_creator.cc \ @@ -102,9 +98,10 @@ enginetest_SOURCES = \ paintertest_CXXFLAGS = -DOUTPUT=\"paintertest\" $(CPPUNIT_CFLAGS) \ -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_srcdir)/plugingui \ - -I$(top_srcdir)/hugin -DDISABLE_HUGIN $(PTHREAD_CFLAGS) + -I$(top_srcdir)/hugin $(PTHREAD_CFLAGS) paintertest_LDFLAGS = $(CPPUNIT_LIBS) $(top_srcdir)/plugingui/libdggui.la paintertest_SOURCES = \ + $(top_srcdir)/hugin/hugin.c \ test.cc \ paintertest.cc @@ -142,11 +139,11 @@ configfile_SOURCES = \ memchecker_CXXFLAGS = -DOUTPUT=\"memchecker\" $(CPPUNIT_CFLAGS) \ -I$(top_srcdir)/src -I$(top_srcdir)/include \ - -I$(top_srcdir)/hugin -DDISABLE_HUGIN $(PTHREAD_CFLAGS) -memchecker_CFLAGS = -DDISABLE_HUGIN -memchecker_LDFLAGS = $(CPPUNIT_LIBS) $(DRUMGIZMO_LIBS) $(PTHREAD_LIBS) + -I$(top_srcdir)/hugin $(PTHREAD_CFLAGS) +memchecker_LDFLAGS = $(CPPUNIT_LIBS) $(PTHREAD_LIBS) \ + $(top_srcdir)/src/libdg.la memchecker_SOURCES = \ - $(DRUMGIZMO_SOURCES) \ + $(top_srcdir)/hugin/hugin.c \ test.cc \ drumkit_creator.cc \ memcheckertest.cc @@ -166,8 +163,8 @@ atomictest_CXXFLAGS = -DOUTPUT=\"atomictest\" $(CPPUNIT_CFLAGS) \ atomictest_LDFLAGS = $(CPPUNIT_LIBS) atomictest_SOURCES = atomictest.cc test.cc -syncedsettingstest_CXXFLAGS = -DOUTPUT=\"syncedsettingstest\" $(CPPUNIT_CFLAGS) \ - -I$(top_srcdir)/src -I$(top_srcdir)/hugin +syncedsettingstest_CXXFLAGS = -DOUTPUT=\"syncedsettingstest\" \ + $(CPPUNIT_CFLAGS) -I$(top_srcdir)/src -I$(top_srcdir)/hugin syncedsettingstest_LDFLAGS = $(CPPUNIT_LIBS) syncedsettingstest_SOURCES = syncedsettings.cc test.cc @@ -179,6 +176,7 @@ imagecachetest_CXXFLAGS = -DOUTPUT=\"imagecachetest\" $(CPPUNIT_CFLAGS) \ -I$(top_srcdir)/src -I$(top_srcdir)/plugingui -I$(top_srcdir)/hugin imagecachetest_LDFLAGS = $(CPPUNIT_LIBS) $(top_srcdir)/plugingui/libdggui.la imagecachetest_SOURCES = \ + $(top_srcdir)/hugin/hugin.c \ imagecachetest.cc \ test.cc diff --git a/test/dgreftest/Makefile.am b/test/dgreftest/Makefile.am index 7e23839..07b324d 100644 --- a/test/dgreftest/Makefile.am +++ b/test/dgreftest/Makefile.am @@ -1,12 +1,10 @@ if ENABLE_CLI if HAVE_INPUT_MIDIFILE -include $(top_srcdir)/src/Makefile.am.drumgizmo - bin_PROGRAMS = dgreftest -dgreftest_LDADD = $(DRUMGIZMO_LIBS) $(PTHREAD_LIBS) $(JACK_LIBS) \ - $(SMF_LIBS) +dgreftest_LDADD = $(PTHREAD_LIBS) $(JACK_LIBS) \ + $(SMF_LIBS) $(top_srcdir)/src/libdg.la dgreftest_LDFLAGS = @@ -22,7 +20,6 @@ dgreftest_SOURCES = \ midiinputengine.cc \ wavfileoutputengine.cc \ compareoutputengine.cc \ - $(DRUMGIZMO_SOURCES) \ $(top_srcdir)/hugin/hugin.c \ $(top_srcdir)/hugin/hugin_filter.c -- cgit v1.2.3