summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2013-10-04 19:56:19 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2013-10-04 19:56:19 -0500
commit940b37b197835b60241571a3b0544849af98cd45 (patch)
tree298b02435624715d7ddf5ffab3a69fcc7d086b52 /Makefile.am
parent0441ff62e7d598130842d8eb4a659d5069641f52 (diff)
downloadlibpng-940b37b197835b60241571a3b0544849af98cd45.tar.gz
[libpng16] Made changes for compatibility with automake 1.14:
1) Added the 'compile' program to the list of programs that must be cleaned in autogen.sh 2) Added 'subdir-objects' which causes .c files in sub-directories to be compiled such that the corresponding .o files are also in the sub-directory. This is because automake 1.14 warns that the current behavior of compiling to the top level directory may be removed in the future. 3) Updated dependencies on pnglibconf.h to match the new .o locations and added all the files in contrib/libtests and contrib/tools that depend on pnglibconf.h 4) Added 'BUILD_SOURCES = pnglibconf.h'; this is the automake recommended way of handling the dependencies of sources that are machine generated; unfortunately it only works if the user does 'make all' or 'make check', so the dependencies (3) are still required.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am28
1 files changed, 25 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 74a33e672..565206ebb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,6 +12,16 @@ check_PROGRAMS= pngtest pngunknown pngstest pngvalid
# Utilities - installed
bin_PROGRAMS= pngfix png-fix-itxt
+# This ensures that pnglibconf.h gets built at the start of 'make all' or
+# 'make check', but it does not add dependencies to the individual programs,
+# this is done below.
+#
+# IMPORTANT: always add the object modules of new programs to the list below
+# because otherwise the sequence 'configure; make new-program' will *sometimes*
+# result in the installed (system) pnglibconf.h being used and the result is
+# always wrong and always very confusing.
+BUILT_SOURCES = pnglibconf.h
+
pngtest_SOURCES = pngtest.c
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
@@ -194,9 +204,21 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt:
# The following is necessary to ensure that the local pnglibconf.h is used, not
# an installed one (this can happen immediately after on a clean system if
-# 'make test' is the first thing the user does.)
-pngstest.o pngvalid.o pngtest.o pngunknown.o timepng.o: pnglibconf.h
-pngfix.o png-fix-itxt.o: pnglibconf.h
+# 'make test' is the first thing the user does.) Only files which include
+# one of the png source files (typically png.h or pngpriv.h) need to be listed
+# here:
+pngtest.o: pnglibconf.h
+
+contrib/libtests/makepng.o: pnglibconf.h
+contrib/libtests/pngstest.o: pnglibconf.h
+contrib/libtests/pngunknown.o: pnglibconf.h
+contrib/libtests/pngvalid.o: pnglibconf.h
+contrib/libtests/readpng.o: pnglibconf.h
+contrib/libtests/tarith.o: pnglibconf.h
+contrib/libtests/timepng.o: pnglibconf.h
+
+contrib/tools/makesRGB.o: pnglibconf.h
+contrib/tools/pngfix.o: pnglibconf.h
# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
# be built with PNG_USE_READ_MACROS; this prevents the read macros from