From 48d8323e00b60857484126a81813880858d8037b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 1 Nov 2003 14:36:22 +0000 Subject: [PATCH] Directory reorganization. Better dependencies on the libraries. --- aviclasses/Makefile.am | 3 +- avilib-0.6.10/Makefile.am | 3 +- configure.in | 4 +- src/Makefile.am | 127 +++++++++++++++----------------------- src/common/Makefile.am | 33 ++++++++++ src/input/Makefile.am | 33 ++++++++++ src/mmg/Makefile.am | 24 +++---- src/output/Makefile.am | 29 +++++++++ 8 files changed, 165 insertions(+), 91 deletions(-) create mode 100644 src/common/Makefile.am create mode 100644 src/input/Makefile.am create mode 100644 src/output/Makefile.am diff --git a/aviclasses/Makefile.am b/aviclasses/Makefile.am index 803a38e8f..e2d408e8d 100644 --- a/aviclasses/Makefile.am +++ b/aviclasses/Makefile.am @@ -1,4 +1,5 @@ -DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I. +DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/common noinst_LIBRARIES = libaviclasses.a diff --git a/avilib-0.6.10/Makefile.am b/avilib-0.6.10/Makefile.am index b96e28ccd..8e340485c 100644 --- a/avilib-0.6.10/Makefile.am +++ b/avilib-0.6.10/Makefile.am @@ -2,7 +2,8 @@ AUTOMAKE_OPTIONS = 1.3 foreign -DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I. +DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/common noinst_LIBRARIES = libavi.a diff --git a/configure.in b/configure.in index 63dce71b6..307c12809 100644 --- a/configure.in +++ b/configure.in @@ -789,6 +789,7 @@ dnl WXWINDOWS_LIBS=$(wx-config --libs) fi AC_DEFINE(HAVE_WXWINDOWS, 1, [Define if wxWindows is present]) + MMG_SUBDIRS=mmg AC_MSG_RESULT($wxwversion ok) have_wxwindows=yes else @@ -801,6 +802,7 @@ dnl AC_SUBST(WXWINDOWS_CFLAGS) AC_SUBST(WXWINDOWS_LDFLAGS) AC_SUBST(WXWINDOWS_LIBS) +AC_SUBST(MMG_SUBDIRS) AM_CONDITIONAL(HAVE_WXWINDOWS, test x"$have_wxwindows" = "xyes") @@ -873,4 +875,4 @@ CXXFLAGS="-Wall -Wno-sign-compare -Wno-comment -D_LARGEFILE64_SOURCE -D_LARGEFIL CPPFLAGS="@EXTRA_CFLAGS@" LDFLAGS="@EXTRA_LDFLAGS@" -AC_OUTPUT(Makefile avilib-0.6.10/Makefile aviclasses/Makefile src/Makefile src/mmg/Makefile doc/Makefile) +AC_OUTPUT(Makefile avilib-0.6.10/Makefile aviclasses/Makefile src/Makefile src/common/Makefile src/input/Makefile src/output/Makefile src/mmg/Makefile doc/Makefile) diff --git a/src/Makefile.am b/src/Makefile.am index b55a75aef..4f09d0004 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,105 +1,80 @@ AUTOMAKE_OPTIONS = dist-zip foreign -if HAVE_AVILIB -avilib_incdirs = -I$(top_srcdir)/avilib -avilib_libdirs = -L$(top_srcdir)/avilib -endif if HAVE_AVILIB0_6_10 avilib0_6_10_incdirs = -I$(top_srcdir)/avilib-0.6.10 avilib0_6_10_libdirs = -L$(top_srcdir)/avilib-0.6.10 +avilib0_6_10_deps = ../avilib-0.6.10/libavi.a endif if HAVE_AVICLASSES aviclasses_incdirs = -I$(top_srcdir)/aviclasses aviclasses_libdirs = -L$(top_srcdir)/aviclasses +aviclasses_deps = ../aviclasses/libaviclasses.a endif DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ - $(avilib0_6_10_incdirs) $(aviclasses_incdirs) + $(avilib0_6_10_incdirs) $(aviclasses_incdirs) \ + -Icommon -Iinput -Ioutput -LDFLAGS = @LDFLAGS@ $(avilib0_6_10_libdirs) $(aviclasses_libdirs) +LDFLAGS = @LDFLAGS@ $(avilib0_6_10_libdirs) $(aviclasses_libdirs) \ + -Lcommon -Linput -Loutput -SUBDIRS = . @MMG_SUBDIRS@ - -noinst_LIBRARIES = libmtxcommon.a - -libmtxcommon_a_SOURCES = base64.cpp \ - chapters.cpp chapters.h \ - chapter_parser_xml.cpp \ - compression.cpp compression.h \ - common.cpp common.h \ - iso639.cpp iso639.h \ - mm_io.cpp mm_io.h \ - tagparser_start.cpp tagparser.h \ - tagparser_end.cpp +SUBDIRS = common input output @MMG_SUBDIRS@ bin_PROGRAMS = mkvmerge mkvinfo mkvextract base64tool -mkvmerge_SOURCES = mkvmerge.cpp mkvmerge.h \ - aac_common.cpp aac_common.h \ - ac3_common.cpp ac3_common.h \ - dts_common.cpp dts_common.h \ - cluster_helper.cpp cluster_helper.h \ - mp3_common.cpp mp3_common.h \ - p_aac.cpp p_aac.h \ - p_ac3.cpp p_ac3.h \ - p_dts.cpp p_dts.h \ - p_mp3.cpp p_mp3.h \ - p_passthrough.cpp p_passthrough.h \ - p_pcm.cpp p_pcm.h \ - p_textsubs.cpp p_textsubs.h \ - p_video.cpp p_video.h \ - p_vobsub.cpp p_vobsub.h \ - p_vorbis.cpp p_vorbis.h \ - pr_generic.h pr_generic.cpp \ - r_aac.cpp r_aac.h \ - r_ac3.cpp r_ac3.h \ - r_avi.cpp r_avi.h \ - r_dts.cpp r_dts.h \ - r_matroska.cpp r_matroska.h \ - r_mp3.cpp r_mp3.h \ - r_qtmp4.cpp r_qtmp4.h \ - r_real.cpp r_real.h \ - r_srt.cpp r_srt.h \ - r_ssa.cpp r_ssa.h \ - r_ogm.cpp r_ogm.h \ - r_vobsub.cpp r_vobsub.h \ - r_wav.cpp r_wav.h \ - subtitles.cpp subtitles.h +## +## mkvmerge +## +mkvmerge_DEPENDENCIES = common/libmtxcommon.a input/libmtxinput.a \ + output/libmtxoutput.a \ + $(avilib0_6_10_deps) $(aviclasses_deps) -mkvinfo_SOURCES = mkvinfo.cpp mkvinfo.h \ - common.cpp common.h \ - mkvinfo_gui.cpp \ - mkvinfo_tag_types.cpp mkvinfo_tag_types.h \ - mm_io.cpp mm_io.h \ - iso639.cpp iso639.h +mkvmerge_SOURCES = mkvmerge.cpp \ + cluster_helper.cpp \ + pr_generic.cpp -mkvextract_SOURCES = mkvextract.cpp mkvextract.h \ - base64.cpp base64.h \ - chapter_writer.cpp chapters.h \ - common.cpp common.h \ - mkvextract_attachments.cpp \ - mkvextract_chapters.cpp \ - mkvextract_tags.cpp \ - mkvextract_tracks.cpp \ - mm_io.cpp mm_io.h \ - tagwriter.cpp tagwriter.h - -base64tool_SOURCES = base64tool.cpp \ - base64.cpp base64.h \ - common.cpp common.h \ - mm_io.cpp mm_io.h - -mkvmerge_LDADD = -L. -lmtxcommon @AVILIB_LIBS@ @AVICLASSES_LIBS@ \ +mkvmerge_LDADD = -lmtxinput -lmtxoutput -lmtxcommon \ + @AVILIB_LIBS@ @AVICLASSES_LIBS@ \ @MATROSKA_LIBS@ @EBML_LIBS@ \ @VORBIS_LIBS@ @OGG_LIBS@ \ @ICONV_LIBS@ @MINGW_LIBS@ @EXPAT_LIBS@ \ @ZLIB_LIBS@ @LZO_LIBS@ @BZ2_LIBS@ \ @PROFILING_LIBS@ -mkvinfo_LDADD = @PROFILING_LIBS@ @MATROSKA_LIBS@ @EBML_LIBS@ @ICONV_LIBS@ \ + +## +## mkvinfo +## +mkvinfo_DEPENDENCIES = common/libmtxcommon.a + +mkvinfo_SOURCES = mkvinfo.cpp \ + mkvinfo_gui.cpp \ + mkvinfo_tag_types.cpp + +mkvinfo_LDADD = -lmtxcommon @PROFILING_LIBS@ \ + @MATROSKA_LIBS@ @EBML_LIBS@ @ICONV_LIBS@ \ @WXWINDOWS_LIBS@ @MINGW_LIBS@ -mkvextract_LDADD = @AVILIB_LIBS@ @PROFILING_LIBS@ @MATROSKA_LIBS@ @EBML_LIBS@ \ +## +## mkvextract +## +mkvextract_DEPENDENCIES = common/libmtxcommon.a $(avilib0_6_10_deps) + +mkvextract_SOURCES = mkvextract.cpp \ + mkvextract_attachments.cpp \ + mkvextract_chapters.cpp \ + mkvextract_tags.cpp \ + mkvextract_tracks.cpp + +mkvextract_LDADD = -lmtxcommon @PROFILING_LIBS@ \ + @AVILIB_LIBS@ @MATROSKA_LIBS@ @EBML_LIBS@ \ @VORBIS_LIBS@ @OGG_LIBS@ @ICONV_LIBS@ @LZO_LIBS@ @BZ2_LIBS@ -base64tool_LDADD = @EBML_LIBS@ @ICONV_LIBS@ +## +## base64tool +## +base64tool_DEPENDENCIES = common/libmtxcommon.a + +base64tool_SOURCES = base64tool.cpp + +base64tool_LDADD = -lmtxcommon @EBML_LIBS@ @ICONV_LIBS@ diff --git a/src/common/Makefile.am b/src/common/Makefile.am new file mode 100644 index 000000000..2b11fff2c --- /dev/null +++ b/src/common/Makefile.am @@ -0,0 +1,33 @@ +if HAVE_AVILIB +avilib_incdirs = -I$(top_srcdir)/avilib +avilib_libdirs = -L$(top_srcdir)/avilib +endif +if HAVE_AVILIB0_6_10 +avilib0_6_10_incdirs = -I$(top_srcdir)/avilib-0.6.10 +avilib0_6_10_libdirs = -L$(top_srcdir)/avilib-0.6.10 +endif +if HAVE_AVICLASSES +aviclasses_incdirs = -I$(top_srcdir)/aviclasses +aviclasses_libdirs = -L$(top_srcdir)/aviclasses +endif + +DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ + $(avilib0_6_10_incdirs) $(aviclasses_incdirs) -I. + +noinst_LIBRARIES = libmtxcommon.a + +libmtxcommon_a_SOURCES = base64.cpp \ + aac_common.cpp \ + ac3_common.cpp \ + chapters.cpp \ + chapter_parser_xml.cpp \ + chapter_writer.cpp \ + compression.cpp \ + common.cpp \ + dts_common.cpp \ + iso639.cpp \ + mm_io.cpp \ + mp3_common.cpp \ + tagparser_start.cpp \ + tagparser_end.cpp \ + tagwriter.cpp diff --git a/src/input/Makefile.am b/src/input/Makefile.am new file mode 100644 index 000000000..828834100 --- /dev/null +++ b/src/input/Makefile.am @@ -0,0 +1,33 @@ +if HAVE_AVILIB +avilib_incdirs = -I$(top_srcdir)/avilib +avilib_libdirs = -L$(top_srcdir)/avilib +endif +if HAVE_AVILIB0_6_10 +avilib0_6_10_incdirs = -I$(top_srcdir)/avilib-0.6.10 +avilib0_6_10_libdirs = -L$(top_srcdir)/avilib-0.6.10 +endif +if HAVE_AVICLASSES +aviclasses_incdirs = -I$(top_srcdir)/aviclasses +aviclasses_libdirs = -L$(top_srcdir)/aviclasses +endif + +DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ + $(avilib0_6_10_incdirs) $(aviclasses_incdirs) \ + -I$(top_srcdir)/src/common -I$(top_srcdir)/src/output + +noinst_LIBRARIES = libmtxinput.a + +libmtxinput_a_SOURCES = r_aac.cpp \ + r_ac3.cpp \ + r_avi.cpp \ + r_dts.cpp \ + r_matroska.cpp \ + r_mp3.cpp \ + r_qtmp4.cpp \ + r_real.cpp \ + r_srt.cpp \ + r_ssa.cpp \ + r_ogm.cpp \ + r_vobsub.cpp \ + r_wav.cpp \ + subtitles.cpp diff --git a/src/mmg/Makefile.am b/src/mmg/Makefile.am index de92a51e7..e5550c558 100644 --- a/src/mmg/Makefile.am +++ b/src/mmg/Makefile.am @@ -2,17 +2,16 @@ AUTOMAKE_OPTIONS = dist-zip foreign bin_PROGRAMS = mmg -DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/common -mmg_SOURCES = mmg.cpp mmg.h \ - ../chapters.cpp ../chapters.h \ - ../chapter_parser_xml.cpp \ - ../chapter_writer.cpp \ - ../common.cpp ../common.h \ - extern_data.cpp extern_data.h \ - ../iso639.cpp ../iso639.h \ - kax_analyzer.cpp kax_analyzer.h \ - ../mm_io.cpp ../mm_io.h \ +LDFLAGS = @LDFLAGS@ -L$(top_srcdir)/src/common + +mmg_DEPENDENCIES = ../common/libmtxcommon.a + +mmg_SOURCES = mmg.cpp \ + extern_data.cpp \ + kax_analyzer.cpp \ mux_dialog.cpp \ tab_attachments.cpp \ tab_chapters.cpp \ @@ -20,5 +19,6 @@ mmg_SOURCES = mmg.cpp mmg.h \ tab_global.cpp \ tab_settings.cpp -mmg_LDADD = @MINGW_LIBS@ @PROFILING_LIBS@ @MATROSKA_LIBS@ @EBML_LIBS@ \ - @WXWINDOWS_LIBS@ @EXPAT_LIBS@ @MINGW_GUIAPP@ @ICONV_LIBS@ +mmg_LDADD = -lmtxcommon @MATROSKA_LIBS@ @EBML_LIBS@ \ + @WXWINDOWS_LIBS@ @EXPAT_LIBS@ \ + @MINGW_GUIAPP@ @MINGW_LIBS@ @ICONV_LIBS@ @PROFILING_LIBS@ diff --git a/src/output/Makefile.am b/src/output/Makefile.am new file mode 100644 index 000000000..0c55b62e0 --- /dev/null +++ b/src/output/Makefile.am @@ -0,0 +1,29 @@ +if HAVE_AVILIB +avilib_incdirs = -I$(top_srcdir)/avilib +avilib_libdirs = -L$(top_srcdir)/avilib +endif +if HAVE_AVILIB0_6_10 +avilib0_6_10_incdirs = -I$(top_srcdir)/avilib-0.6.10 +avilib0_6_10_libdirs = -L$(top_srcdir)/avilib-0.6.10 +endif +if HAVE_AVICLASSES +aviclasses_incdirs = -I$(top_srcdir)/aviclasses +aviclasses_libdirs = -L$(top_srcdir)/aviclasses +endif + +DEFAULT_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src \ + $(avilib0_6_10_incdirs) $(aviclasses_incdirs) \ + -I../common + +noinst_LIBRARIES = libmtxoutput.a + +libmtxoutput_a_SOURCES = p_aac.cpp \ + p_ac3.cpp \ + p_dts.cpp \ + p_mp3.cpp \ + p_passthrough.cpp \ + p_pcm.cpp \ + p_textsubs.cpp \ + p_video.cpp \ + p_vobsub.cpp \ + p_vorbis.cpp