[libbluray-devel] build: remove src/examples/Makefile. am and collapse everything in a single Makefile.am

Diego Elio Pettenò git at videolan.org
Fri Feb 15 04:07:43 CET 2013


libbluray | branch: flameeyes | Diego Elio Pettenò <flameeyes at flameeyes.eu> | Thu Feb 14 19:06:41 2013 -0800| [1062e4631bb9d01aea2ec438e023b95a5ab8edbc] | committer: Diego Elio Pettenò

build: remove src/examples/Makefile.am and collapse everything in a single Makefile.am

This allows a much faster build especially with --enable-examples, as
all the objects are built together and the linking can happen in
parallel for most of them as well.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1062e4631bb9d01aea2ec438e023b95a5ab8edbc
---

 .gitignore               |   24 +++++------
 Makefile.am              |  105 +++++++++++++++++++++++++++++++++++++++++++---
 configure.ac             |    3 +-
 src/examples/Makefile.am |   86 -------------------------------------
 4 files changed, 113 insertions(+), 105 deletions(-)

diff --git a/.gitignore b/.gitignore
index 81a92cc..bec7937 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,18 +23,18 @@ libtool
 .deps
 .libs
 src/libbluray/bluray-version.h
-src/examples/bdsplice
-src/examples/clpi_dump
-src/examples/index_dump
-src/examples/libbluray_test
-src/examples/list_titles
-src/examples/mobj_dump
-src/examples/mpls_dump
-src/examples/sound_dump
-src/examples/bdj_test
-src/examples/bd_info
-src/examples/hdmv_test
-src/examples/*.exe
+bdsplice
+clpi_dump
+index_dump
+libbluray_test
+list_titles
+mobj_dump
+mpls_dump
+sound_dump
+bdj_test
+bd_info
+hdmv_test
+*.exe
 src/libbluray/bdj/build
 libbluray.jar
 stamp-h1
diff --git a/Makefile.am b/Makefile.am
index 3ec26fe..1a886e9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,5 @@
 include $(top_srcdir)/doxygen-include.am
 
-if USING_EXAMPLES
-SUBDIRS = src/examples
-endif
-
 ACLOCAL_AMFLAGS=-I m4
 
 EXTRA_DIST = \
@@ -107,7 +103,102 @@ pkginclude_HEADERS = \
 	src/libbluray/keys.h \
 	src/util/log_control.h
 
+EXTRA_PROGRAMS = \
+	bd_info \
+	bdsplice \
+	clpi_dump \
+	hdmv_test \
+	index_dump \
+	libbluray_test \
+	list_titles \
+	mobj_dump \
+	mpls_dump \
+	sound_dump
+
+# the overriding of CFLAGS is necessary to ensure that automake will
+# rebuild different objects for different targets.
+
+mpls_dump_CFLAGS = $(AM_CFLAGS)
+mpls_dump_SOURCES = \
+	src/examples/mpls_dump.c \
+	src/examples/util.c \
+	src/examples/util.h \
+	src/util/bits.c \
+	src/util/strutl.c \
+	src/util/logging.c \
+	src/file/file_posix.c \
+	src/file/dir_posix.c \
+	src/libbluray/bdnav/extdata_parse.c \
+	src/libbluray/bdnav/mpls_parse.c \
+	src/libbluray/bdnav/clpi_parse.c \
+	src/libbluray/bdnav/navigation.c
+
+clpi_dump_CFLAGS = $(AM_CFLAGS)
+clpi_dump_SOURCES = \
+	src/examples/clpi_dump.c \
+	src/examples/util.c \
+	src/examples/util.h \
+	src/util/bits.c \
+	src/util/logging.c \
+	src/file/file_posix.c \
+	src/libbluray/bdnav/extdata_parse.c \
+	src/libbluray/bdnav/clpi_parse.c
+
+sound_dump_CFLAGS = $(AM_CFLAGS)
+sound_dump_SOURCES = \
+	src/examples/sound_dump.c \
+	src/util/bits.c \
+	src/util/logging.c \
+	src/file/file_posix.c \
+	src/libbluray/bdnav/sound_parse.c
+
+index_dump_CFLAGS = $(AM_CFLAGS)
+index_dump_SOURCES = \
+	src/examples/index_dump.c \
+	src/util/bits.c \
+	src/util/logging.c \
+	src/file/file_posix.c \
+	src/libbluray/bdnav/index_parse.c
+
+mobj_dump_CFLAGS = $(AM_CFLAGS)
+mobj_dump_SOURCES = \
+	src/examples/mobj_dump.c \
+	src/util/bits.c \
+	src/util/logging.c \
+	src/file/file_posix.c \
+	src/libbluray/hdmv/mobj_parse.c \
+	src/libbluray/hdmv/mobj_print.c
+
+libbluray_test_CFLAGS = $(AM_CFLAGS)
+libbluray_test_SOURCES = \
+	src/examples/libbluray_test.c \
+	src/util/logging.c
+libbluray_test_LDADD = libbluray.la
+
+list_titles_CFLAGS = $(AM_CFLAGS)
+list_titles_SOURCES = \
+	src/examples/list_titles.c \
+	src/util/logging.c
+list_titles_LDADD = libbluray.la
+
+bdsplice_SOURCES = src/examples/bdsplice.c
+bdsplice_LDADD = libbluray.la
+
+hdmv_test_SOURCES = src/examples/hdmv_test.c
+hdmv_test_LDADD = libbluray.la
+
+bd_info_SOURCES = src/examples/bd_info.c
+bd_info_LDADD = libbluray.la
+
+bdj_test_SOURCES = src/examples/bdj_test.c
+bdj_test_LDADD = libbluray.la
+
 if USING_BDJAVA
+
+AM_CFLAGS += $(BDJAVA_CFLAGS)
+
+EXTRA_PROGRAMS += bdj_test
+
 jardir = $(libdir)/libbluray/
 jar_DATA = libbluray.jar
 
@@ -134,11 +225,13 @@ libbluray_la_SOURCES += \
 	src/libbluray/bdj/native/register_native.h \
 	src/libbluray/bdj/native/register_native.c
 
-AM_CFLAGS += $(BDJAVA_CFLAGS)
-
 clean-local:
 	ant -f $(top_srcdir)/src/libbluray/bdj/build.xml clean
 endif
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = src/libbluray.pc
+
+if USING_EXAMPLES
+noinst_PROGRAMS = $(EXTRA_PROGRAMS)
+endif
diff --git a/configure.ac b/configure.ac
index ccfcfe2..620a42d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,7 @@ AC_ARG_WITH([bdj-bootclasspath],
 
 dnl required programs
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_CC_C99
 AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
   AC_MSG_ERROR([no C99 compiler found, $PACKAGE requires a C99 compiler.])
@@ -218,7 +219,7 @@ AC_SUBST(LT_VERSION_INFO)
 
 dnl generate output files
 AC_SUBST(BDJAVA_CFLAGS)
-AC_CONFIG_FILES([Makefile src/examples/Makefile src/libbluray.pc src/libbluray/bluray-version.h])
+AC_CONFIG_FILES([Makefile src/libbluray.pc src/libbluray/bluray-version.h])
 AC_OUTPUT
 
 
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
deleted file mode 100644
index 2cbe053..0000000
--- a/src/examples/Makefile.am
+++ /dev/null
@@ -1,86 +0,0 @@
-SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT
-SET_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/file -I$(top_srcdir)/src/libbluray/bdnav
-
-AM_CFLAGS = $(SET_FEATURES) $(SET_INCLUDES)
-
-EXTRA_PROGRAMS=bdsplice mpls_dump clpi_dump index_dump mobj_dump sound_dump \
-    libbluray_test list_titles hdmv_test bd_info
-
-BLURAY_LIB = $(top_builddir)/libbluray.la
-
-if USING_BDJAVA
-  AM_CFLAGS += @BDJAVA_CFLAGS@
-endif
-
-bdsplice_SOURCES = \
-	bdsplice.c
-
-bdsplice_LDADD = $(BLURAY_LIB)
-
-mpls_dump_SOURCES = \
-	mpls_dump.c util.c util.h \
-	../util/bits.c \
-	../util/strutl.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../file/dir_posix.c \
-	../libbluray/bdnav/extdata_parse.c \
-	../libbluray/bdnav/mpls_parse.c \
-	../libbluray/bdnav/clpi_parse.c \
-	../libbluray/bdnav/navigation.c
-
-clpi_dump_SOURCES = \
-	clpi_dump.c util.c util.h \
-	../util/bits.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/extdata_parse.c \
-	../libbluray/bdnav/clpi_parse.c
-
-sound_dump_SOURCES = \
-	sound_dump.c \
-	../util/bits.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/sound_parse.c
-
-index_dump_SOURCES = \
-	index_dump.c \
-	../util/bits.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/index_parse.c
-
-mobj_dump_SOURCES = \
-	mobj_dump.c \
-	../util/bits.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/hdmv/mobj_parse.c \
-	../libbluray/hdmv/mobj_print.c
-
-libbluray_test_SOURCES = \
-	libbluray_test.c ../util/logging.c
-
-libbluray_test_LDADD = $(BLURAY_LIB)
-
-hdmv_test_SOURCES = \
-	hdmv_test.c
-
-hdmv_test_LDADD = $(BLURAY_LIB)
-
-list_titles_SOURCES = \
-	list_titles.c ../util/logging.c
-
-list_titles_LDADD = $(BLURAY_LIB)
-
-bd_info_SOURCES = \
-	bd_info.c
-
-bd_info_LDADD = $(BLURAY_LIB)
-
-if USING_BDJAVA
-EXTRA_PROGRAMS+= bdj_test
-bdj_test_SOURCES = bdj_test.c
-bdj_test_LDADD = $(BLURAY_LIB)
-endif



More information about the libbluray-devel mailing list