Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 1 | # Makefile.am: |
| 2 | # Source file for Makefile.in (and hence Makefile) |
| 3 | # |
| 4 | # Makefile.am need only be changed on a major version number |
| 5 | # change (e.g. libpng12 --> libpng13). In that case seach |
| 6 | # this file for every instance of the old base name (libpng12) |
| 7 | # and change to the new one (libpng13), then change the |
| 8 | # -version-number settings below so that the new values have |
| 9 | # the correct major part (first field). |
| 10 | |
| 11 | PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@ |
| 12 | |
| 13 | # libpng does not follow GNU file name conventions |
| 14 | AUTOMAKE_OPTIONS = foreign |
| 15 | |
| 16 | # test programs - run on make check, make distcheck |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 17 | check_PROGRAMS= pngtest |
| 18 | pngtest_SOURCES = pngtest.c |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 19 | pngtest_LDADD = libpng14.la |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 20 | TESTS = test-pngtest.sh |
| 21 | TESTS_ENVIRONMENT= srcdir=$(srcdir) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 22 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 23 | # man pages |
| 24 | dist_man_MANS= libpng.3 libpngpf.3 png.5 |
| 25 | |
| 26 | # generate the -config scripts if required |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 27 | binconfigs= libpng14-config |
| 28 | EXTRA_SCRIPTS= libpng-config libpng14-config |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 29 | bin_SCRIPTS= @binconfigs@ |
| 30 | |
| 31 | # rules to build libpng, only build the old library on request |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 32 | lib_LTLIBRARIES=libpng14.la @compatlib@ |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 33 | EXTRA_LTLIBRARIES= libpng.la |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 34 | libpng14_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 35 | pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ |
Glenn Randers-Pehrson | 26e47d9 | 2006-03-20 07:24:58 -0600 | [diff] [blame] | 36 | pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c \ |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 37 | png.h pngconf.h pngintrn.h |
| 38 | libpng_la_SOURCES = $(libpng14_la_SOURCES) |
Glenn Randers-Pehrson | d5d6360 | 2006-04-15 06:37:45 -0500 | [diff] [blame] | 39 | |
Glenn Randers-Pehrson | 629330e | 2006-04-17 14:33:23 -0500 | [diff] [blame] | 40 | libpng_la_CPPFLAGS = @LIBPNG_DEFINES@ |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 41 | libpng14_la_CPPFLAGS = @LIBPNG_DEFINES@ |
Glenn Randers-Pehrson | d5d6360 | 2006-04-15 06:37:45 -0500 | [diff] [blame] | 42 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 43 | # MAJOR UPGRADE: the version-number settings below must be changed. |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 44 | libpng14_la_LDFLAGS = -no-undefined -export-dynamic \ |
Glenn Randers-Pehrson | f46918d | 2006-06-02 05:31:20 -0500 | [diff] [blame] | 45 | -version-number 1:@PNGLIB_MINOR@:0 |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 46 | # -rpath is needed as automake doesn't know the directory |
| 47 | libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \ |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 48 | -version-number 14:@PNGLIB_MINOR@:0 |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 49 | |
| 50 | if HAVE_LD_VERSION_SCRIPT |
| 51 | # Versioned symbols and restricted exports |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 52 | libpng14_la_LDFLAGS += -Wl,--version-script=libpng.vers |
| 53 | libpng14_la_DEPENDENCIES = libpng.vers |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 54 | else |
| 55 | # Only restricted exports when possible |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 56 | libpng14_la_LDFLAGS += -export-symbols libpng.sym |
| 57 | libpng14_la_DEPENDENCIES = libpng.sym |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 58 | endif |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 59 | libpng_la_DEPENDENCIES = $(libpng14_la_DEPENDENCIES) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 60 | |
| 61 | #distribute headers in /usr/include/libpng/* |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 62 | pkgincludedir= $(includedir)/$(PNGLIB_BASENAME) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 63 | pkginclude_HEADERS= png.h pngconf.h |
| 64 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 65 | # pkg-config stuff, note that libpng.pc is always required in order |
| 66 | # to get the correct library |
| 67 | pkgconfigdir = @pkgconfigdir@ |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 68 | pkgconfig_DATA = libpng14.pc |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 69 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 70 | #extra source distribution files. |
Glenn Randers-Pehrson | 7b34df3 | 2006-02-24 06:30:16 -0600 | [diff] [blame] | 71 | EXTRA_DIST= \ |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 72 | ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 73 | pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ |
Glenn Randers-Pehrson | 7b34df3 | 2006-02-24 06:30:16 -0600 | [diff] [blame] | 74 | ${srcdir}/projects/cbuilder5/* \ |
| 75 | ${srcdir}/projects/beos/* \ |
| 76 | ${srcdir}/projects/visualc6/* \ |
| 77 | ${srcdir}/projects/visualc71/* \ |
| 78 | ${srcdir}/projects/wince.txt \ |
| 79 | ${srcdir}/projects/netware.txt \ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 80 | ${srcdir}/scripts/* \ |
| 81 | ${srcdir}/contrib/gregbook/* \ |
| 82 | ${srcdir}/contrib/pngminus/* \ |
| 83 | ${srcdir}/contrib/pngsuite/* \ |
| 84 | ${srcdir}/contrib/visupng/* \ |
| 85 | $(TESTS) \ |
Glenn Randers-Pehrson | 26e47d9 | 2006-03-20 07:24:58 -0600 | [diff] [blame] | 86 | example.c libpng.txt pngvcrd.c |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 87 | |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 88 | CLEANFILES= pngout.png libpng14.pc libpng14-config libpng.vers libpng.sym |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 89 | |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 90 | pngconf.h.in: |
| 91 | cat pngconf.h > pngconf.h.in |
| 92 | |
Glenn Randers-Pehrson | 3424ee7 | 2006-07-12 13:33:47 -0500 | [diff] [blame^] | 93 | pngconf.h: pngconf.h.in |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 94 | sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h |
| 95 | @if test -n "@LIBPNG_NO_MMX@"; then \ |
Glenn Randers-Pehrson | 73b064c | 2006-05-15 06:44:21 -0500 | [diff] [blame] | 96 | echo "#define PNG_NO_MMX_CODE" >> pngconf.h; \ |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 97 | fi |
| 98 | sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h |
| 99 | |
Glenn Randers-Pehrson | 3424ee7 | 2006-07-12 13:33:47 -0500 | [diff] [blame^] | 100 | all: pngconf.h.in pngconf.h |
| 101 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 102 | $(PNGLIB_BASENAME).pc: libpng.pc |
| 103 | cp libpng.pc $@ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 104 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 105 | $(PNGLIB_BASENAME)-config: libpng-config |
| 106 | cp libpng-config $@ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 107 | |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 108 | libpng.sym: png.h pngconf.h |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 109 | rm -f $@ $@.new |
Glenn Randers-Pehrson | 629330e | 2006-04-17 14:33:23 -0500 | [diff] [blame] | 110 | $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \ |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 111 | $(SED) -n -e \ |
| 112 | 's|^.*PNG_FUNCTION_EXPORT[ ]*\([a-zA-Z0-9_]*\).*$$|\1|p' \ |
| 113 | -e 's|^.*PNG_DATA_EXPORT[ ]*\([a-zA-Z0-9_]*\).*$$|\1|p' \ |
| 114 | >$@.new |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 115 | mv $@.new $@ |
| 116 | |
| 117 | libpng.vers: libpng.sym |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 118 | rm -f $@ $@.new |
| 119 | $(ECHO) PNG@PNGLIB_MAJOR@_0 '{global:' > $@.new |
Glenn Randers-Pehrson | 26e47d9 | 2006-03-20 07:24:58 -0600 | [diff] [blame] | 120 | $(SED) s/$$/\;/ libpng.sym >> $@.new |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 121 | $(ECHO) 'local: *; };' >> $@.new |
| 122 | mv $@.new $@ |
| 123 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 124 | # install the .../include headers as links to the new ones |
| 125 | install-data-hook: |
| 126 | cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h |
| 127 | cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h |
| 128 | cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 129 | cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc |
| 130 | cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 131 | |
Glenn Randers-Pehrson | d60b8fa | 2006-04-20 21:31:14 -0500 | [diff] [blame] | 132 | # do evil things to libpng to cause libpng14 to be used |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 133 | install-exec-hook: |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 134 | cd $(DESTDIR)$(bindir); rm -f libpng-config |
| 135 | cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config |
Glenn Randers-Pehrson | d60b8fa | 2006-04-20 21:31:14 -0500 | [diff] [blame] | 136 | @set -x;\ |
| 137 | cd $(DESTDIR)$(libdir);\ |
| 138 | for ext in a la so; do\ |
| 139 | rm -f libpng.$$ext;\ |
| 140 | $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\ |
| 141 | done |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 142 | |
| 143 | uninstall-hook: |
| 144 | cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h |
| 145 | rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc |
| 146 | rm -f $(DESTDIR)$(bindir)/libpng-config |
| 147 | @if test -n "@compatlib@"; then\ |
| 148 | set -x;\ |
| 149 | cd $(DESTDIR)$(libdir);\ |
| 150 | for ext in a la so; do\ |
| 151 | rm -f libpng.$$ext;\ |
| 152 | done;\ |
| 153 | fi |