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 | # |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 4 | |
Glenn Randers-Pehrson | a7dbcba | 2007-05-15 16:16:34 -0500 | [diff] [blame] | 5 | PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 6 | |
John Bowler | a23f3db | 2012-01-27 10:24:21 -0600 | [diff] [blame] | 7 | ACLOCAL_AMFLAGS = -I scripts |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 8 | |
| 9 | # test programs - run on make check, make distcheck |
Glenn Randers-Pehrson | 4af7710 | 2011-11-17 09:05:18 -0600 | [diff] [blame] | 10 | TESTS_ENVIRONMENT= srcdir=$(srcdir) |
| 11 | check_PROGRAMS= pngtest |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 12 | pngtest_SOURCES = pngtest.c |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 13 | pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la |
Glenn Randers-Pehrson | 4af7710 | 2011-11-17 09:05:18 -0600 | [diff] [blame] | 14 | TESTS = test-pngtest.sh |
Glenn Randers-Pehrson | e0bcbfd | 2011-11-16 23:03:52 -0600 | [diff] [blame] | 15 | |
Glenn Randers-Pehrson | 15ea1fa | 2011-11-23 15:28:01 -0600 | [diff] [blame] | 16 | # Only do the following if the contrib directory is present. |
Glenn Randers-Pehrson | 702053d | 2012-08-17 21:23:06 -0500 | [diff] [blame] | 17 | check_PROGRAMS+= pngvalid pngstest pngunknown |
Glenn Randers-Pehrson | 5b79cd5 | 2011-11-24 10:56:20 -0600 | [diff] [blame] | 18 | pngvalid_SOURCES = contrib/libtests/pngvalid.c |
John Bowler | ed9f844 | 2011-11-16 11:52:27 -0600 | [diff] [blame] | 19 | pngstest_SOURCES = contrib/libtests/pngstest.c |
Glenn Randers-Pehrson | 702053d | 2012-08-17 21:23:06 -0500 | [diff] [blame] | 20 | pngunknown_SOURCES = contrib/libtests/pngunknown.c |
Glenn Randers-Pehrson | 4af7710 | 2011-11-17 09:05:18 -0600 | [diff] [blame] | 21 | pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la |
John Bowler | ed9f844 | 2011-11-16 11:52:27 -0600 | [diff] [blame] | 22 | pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la |
Glenn Randers-Pehrson | 702053d | 2012-08-17 21:23:06 -0500 | [diff] [blame] | 23 | pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la |
| 24 | TESTS += contrib/libtests/test-pngunknown.sh\ |
John Bowler | 74a9c07 | 2012-08-17 17:40:41 -0500 | [diff] [blame] | 25 | contrib/libtests/test-pngvalid-simple.sh\ |
| 26 | contrib/libtests/test-pngvalid-full.sh\ |
| 27 | contrib/libtests/test-pngstest.sh |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 28 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 29 | # man pages |
| 30 | dist_man_MANS= libpng.3 libpngpf.3 png.5 |
| 31 | |
| 32 | # generate the -config scripts if required |
Glenn Randers-Pehrson | f3d737d | 2011-05-07 21:41:15 -0500 | [diff] [blame] | 33 | binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 34 | EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 35 | bin_SCRIPTS= @binconfigs@ |
| 36 | |
| 37 | # rules to build libpng, only build the old library on request |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 38 | lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la |
| 39 | # EXTRA_LTLIBRARIES= libpng.la |
Glenn Randers-Pehrson | f01459f | 2010-07-29 19:42:45 -0500 | [diff] [blame] | 40 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\ |
Glenn Randers-Pehrson | 31aee0d | 2010-07-29 17:39:14 -0500 | [diff] [blame] | 41 | pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\ |
| 42 | pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\ |
Glenn Randers-Pehrson | 9eb125e | 2012-02-24 22:04:53 -0600 | [diff] [blame] | 43 | png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa |
Glenn Randers-Pehrson | d5d6360 | 2006-04-15 06:37:45 -0500 | [diff] [blame] | 44 | |
Glenn Randers-Pehrson | 6d7705e | 2011-11-03 00:42:58 -0500 | [diff] [blame] | 45 | if PNG_ARM_NEON |
John Bowler | f758d6c | 2012-12-13 11:26:50 -0600 | [diff] [blame] | 46 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\ |
| 47 | arm/filter_neon.S |
Glenn Randers-Pehrson | 6d7705e | 2011-11-03 00:42:58 -0500 | [diff] [blame] | 48 | endif |
| 49 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 50 | nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h |
| 51 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 52 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ |
| 53 | -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 54 | |
| 55 | if HAVE_LD_VERSION_SCRIPT |
Glenn Randers-Pehrson | 83bd94f | 2011-09-01 14:06:49 -0500 | [diff] [blame] | 56 | # Versioned symbols and restricted exports |
| 57 | if HAVE_SOLARIS_LD |
Glenn Randers-Pehrson | 435cf87 | 2011-10-05 16:23:53 -0500 | [diff] [blame] | 58 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers |
Glenn Randers-Pehrson | 83bd94f | 2011-09-01 14:06:49 -0500 | [diff] [blame] | 59 | else |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 60 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers |
Glenn Randers-Pehrson | 83bd94f | 2011-09-01 14:06:49 -0500 | [diff] [blame] | 61 | endif |
| 62 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 63 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 64 | else |
Glenn Randers-Pehrson | 83bd94f | 2011-09-01 14:06:49 -0500 | [diff] [blame] | 65 | # Only restricted exports when possible |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 66 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym |
| 67 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 68 | endif |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 69 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 70 | #distribute headers in /usr/include/libpng/* |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 71 | pkgincludedir= $(includedir)/$(PNGLIB_BASENAME) |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 72 | pkginclude_HEADERS= png.h pngconf.h |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 73 | nodist_pkginclude_HEADERS= pnglibconf.h |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 74 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 75 | # pkg-config stuff, note that libpng.pc is always required in order |
| 76 | # to get the correct library |
| 77 | pkgconfigdir = @pkgconfigdir@ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 78 | pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 79 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 80 | #extra source distribution files. |
Glenn Randers-Pehrson | 7b34df3 | 2006-02-24 06:30:16 -0600 | [diff] [blame] | 81 | EXTRA_DIST= \ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 82 | ANNOUNCE CHANGES INSTALL LICENSE README TODO \ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 83 | pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ |
Glenn Randers-Pehrson | b56e0d0 | 2010-04-24 12:10:36 -0500 | [diff] [blame] | 84 | ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 85 | $(TESTS) \ |
Glenn Randers-Pehrson | f3abb2c | 2010-10-17 12:51:53 -0500 | [diff] [blame] | 86 | CMakeLists.txt example.c libpng-manual.txt |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 87 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 88 | SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn |
| 89 | |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 90 | CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \ |
Glenn Randers-Pehrson | c551c0d | 2010-03-16 07:52:34 -0500 | [diff] [blame] | 91 | libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \ |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 92 | check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \ |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 93 | $(SCRIPT_CLEANFILES) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 94 | |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 95 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ |
Glenn Randers-Pehrson | c551c0d | 2010-03-16 07:52:34 -0500 | [diff] [blame] | 96 | config.sub configure depcomp install-sh ltmain.sh missing |
Glenn Randers-Pehrson | 3424ee7 | 2006-07-12 13:33:47 -0500 | [diff] [blame] | 97 | |
John Bowler | 1eb2c48 | 2012-01-25 08:07:29 -0600 | [diff] [blame] | 98 | # PNG_COPTS give extra options for the C compiler to be used on all compilation |
| 99 | # steps (unless targe_CFLAGS is specified; that will take precedence over |
| 100 | # AM_CFLAGS) |
| 101 | PNG_COPTS = @PNG_COPTS@ |
| 102 | AM_CFLAGS = ${PNG_COPTS} |
| 103 | |
John Bowler | 71a10f2 | 2011-01-22 17:03:33 -0600 | [diff] [blame] | 104 | # DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe |
| 105 | # other operating systems (NeXT?) the C preprocessor selected by configure |
| 106 | # checks input tokens for validity - effectively it performs part of the ANSI-C |
| 107 | # parsing - and therefore fails with the .df files. configure.ac has special |
| 108 | # checks for this and sets DFNCPP appropriately. |
| 109 | DFNCPP = @DFNCPP@ |
| 110 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 111 | SUFFIXES = .chk .dfn .out |
Glenn Randers-Pehrson | 7e59791 | 2010-03-17 07:29:42 -0500 | [diff] [blame] | 112 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 113 | $(PNGLIB_BASENAME).pc: libpng.pc |
| 114 | cp libpng.pc $@ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 115 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 116 | $(PNGLIB_BASENAME)-config: libpng-config |
| 117 | cp libpng-config $@ |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 118 | |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 119 | scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 120 | scripts/prefix.out: png.h pngconf.h pnglibconf.out |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 121 | scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt |
Glenn Randers-Pehrson | 7e59791 | 2010-03-17 07:29:42 -0500 | [diff] [blame] | 122 | |
| 123 | libpng.sym: scripts/sym.out |
| 124 | rm -f $@ |
| 125 | cp $? $@ |
| 126 | libpng.vers: scripts/vers.out |
| 127 | rm -f $@ |
| 128 | cp $? $@ |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 129 | |
John Bowler | 516c9c9 | 2012-02-01 07:14:24 -0600 | [diff] [blame] | 130 | if DO_PNG_PREFIX |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 131 | # Rename functions in scripts/prefix.out with a PNG_PREFIX prefix. |
| 132 | # Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual |
| 133 | # implementation of the macro). |
| 134 | pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst |
| 135 | rm -f $@ |
| 136 | $(AWK) 's==0 && NR>1{print prev}\ |
| 137 | s==0{prev=$$0}\ |
| 138 | s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\ |
| 139 | s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\ |
| 140 | END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\ |
| 141 | s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8 |
| 142 | mv pnglibconf.tf8 $@ |
| 143 | |
| 144 | pngprefix.h: scripts/intprefix.out |
| 145 | rm -f pngprefix.tf1 |
| 146 | $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1 |
| 147 | mv pngprefix.tf1 $@ |
| 148 | else |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 149 | pnglibconf.h: pnglibconf.out |
| 150 | rm -f $@ |
| 151 | cp $? $@ |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 152 | |
| 153 | pngprefix.h: # is empty |
| 154 | :>$@ |
| 155 | endif |
| 156 | |
John Bowler | 5a77e67 | 2011-07-14 07:42:11 -0500 | [diff] [blame] | 157 | $(srcdir)/scripts/pnglibconf.h.prebuilt: |
| 158 | @echo "Attempting to build $@" >&2 |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 159 | @echo "This is a machine generated file, but if you want to make" >&2 |
| 160 | @echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2 |
| 161 | @exit 1 |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 162 | |
Glenn Randers-Pehrson | 2be8b64 | 2010-07-29 19:09:18 -0500 | [diff] [blame] | 163 | # The following is necessary to ensure that the local pnglibconf.h is used, not |
| 164 | # an installed one (this can happen immediately after on a clean system if |
| 165 | # 'make test' is the first thing the user does.) |
Glenn Randers-Pehrson | 5b79cd5 | 2011-11-24 10:56:20 -0600 | [diff] [blame] | 166 | contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h |
John Bowler | 74a9c07 | 2012-08-17 17:40:41 -0500 | [diff] [blame] | 167 | contrib/libtests/pngunknown.o: pnglibconf.h |
Glenn Randers-Pehrson | 2be8b64 | 2010-07-29 19:09:18 -0500 | [diff] [blame] | 168 | |
Glenn Randers-Pehrson | 0012e9c | 2011-01-26 22:04:03 -0600 | [diff] [blame] | 169 | # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually |
Glenn Randers-Pehrson | 83bd94f | 2011-09-01 14:06:49 -0500 | [diff] [blame] | 170 | # be built with PNG_USE_READ_MACROS; this prevents the read macros from |
| 171 | # interfering with the symbol file format. |
Glenn Randers-Pehrson | a528fba | 2010-03-12 21:03:18 -0600 | [diff] [blame] | 172 | SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\ |
| 173 | -DPNGLIB_VERSION='@PNGLIB_VERSION@'\ |
John Bowler | f21a0d0 | 2011-01-23 23:55:19 -0600 | [diff] [blame] | 174 | -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\ |
Glenn Randers-Pehrson | 80de04e | 2011-03-24 23:06:26 -0500 | [diff] [blame] | 175 | -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE |
Glenn Randers-Pehrson | a528fba | 2010-03-12 21:03:18 -0600 | [diff] [blame] | 176 | |
John Bowler | 516c9c9 | 2012-02-01 07:14:24 -0600 | [diff] [blame] | 177 | if DO_PNG_PREFIX |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 178 | SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@' |
| 179 | endif |
| 180 | |
Glenn Randers-Pehrson | 7e59791 | 2010-03-17 07:29:42 -0500 | [diff] [blame] | 181 | .dfn.out: |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 182 | rm -f $@ $*.c $*.tf[123] |
Glenn Randers-Pehrson | 7e59791 | 2010-03-17 07:29:42 -0500 | [diff] [blame] | 183 | test -d scripts || mkdir scripts |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 184 | echo '#include "$<"' >$*.c |
John Bowler | ba6fbc5 | 2011-12-17 14:21:54 -0600 | [diff] [blame] | 185 | $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\ |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 186 | $(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1 |
John Bowler | 1d8b755 | 2011-11-03 18:19:53 -0500 | [diff] [blame] | 187 | $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\ |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 188 | $*.tf1 >$*.tf2 |
| 189 | $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' $*.tf2 >$*.tf3 |
| 190 | rm -f $*.c $*.tf[12] |
| 191 | mv $*.tf3 $@ |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 192 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 193 | # The .dfn file for pnglibconf.h is machine generated |
Glenn Randers-Pehrson | 9eb125e | 2012-02-24 22:04:53 -0600 | [diff] [blame] | 194 | pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA) |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 195 | rm -f $@ $*.tf[45] |
| 196 | $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\ |
John Bowler | d497383 | 2011-11-08 19:34:54 -0600 | [diff] [blame] | 197 | ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ |
Glenn Randers-Pehrson | 9eb125e | 2012-02-24 22:04:53 -0600 | [diff] [blame] | 198 | ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2 |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 199 | $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2 |
| 200 | rm $*.tf4 |
| 201 | mv $*.tf5 $@ |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 202 | |
| 203 | # Symbol checks (.def and .out files should match) |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 204 | scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 205 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 206 | .out.chk: |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 207 | rm -f $@ $*.new |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 208 | $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\ |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 209 | of="$*.new" $< >&2 |
| 210 | mv $*.new $@ |
Glenn Randers-Pehrson | c551c0d | 2010-03-16 07:52:34 -0500 | [diff] [blame] | 211 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 212 | # used on demand to regenerate the standard header, CPPFLAGS should |
| 213 | # be empty - no non-standard defines |
John Bowler | d497383 | 2011-11-08 19:34:54 -0600 | [diff] [blame] | 214 | scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 215 | rm -f $@ pnglibconf.tf[67] |
Glenn Randers-Pehrson | f3d737d | 2011-05-07 21:41:15 -0500 | [diff] [blame] | 216 | test -z "$(CPPFLAGS)" |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 217 | echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ |
John Bowler | eb26ee6 | 2011-12-08 09:37:24 -0600 | [diff] [blame] | 218 | $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\ |
| 219 | logunsupported=1 version=search ${srcdir}/pngconf.h -\ |
| 220 | ${srcdir}/scripts/pnglibconf.dfa 1>&2 |
| 221 | $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\ |
| 222 | pnglibconf.tf6 1>&2 |
| 223 | rm pnglibconf.tf6 |
| 224 | mv pnglibconf.tf7 $@ |
Glenn Randers-Pehrson | c551c0d | 2010-03-16 07:52:34 -0500 | [diff] [blame] | 225 | |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 226 | $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \ |
John Bowler | 42369cc | 2012-01-31 07:28:13 -0600 | [diff] [blame] | 227 | pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 228 | |
| 229 | test: check-am |
| 230 | |
| 231 | # Extra checks |
John Bowler | e06092a | 2010-12-27 22:10:19 -0600 | [diff] [blame] | 232 | check: scripts/symbols.chk |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 233 | |
| 234 | # Don't distribute the generated script files |
| 235 | dist-hook: |
| 236 | cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES) |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 237 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 238 | # install the .../include headers as links to the new ones |
| 239 | install-data-hook: |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 240 | cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h |
| 241 | cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/png.h png.h |
| 242 | cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \ |
Glenn Randers-Pehrson | f783101 | 2008-11-13 06:05:13 -0600 | [diff] [blame] | 243 | pngconf.h |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 244 | cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \ |
Glenn Randers-Pehrson | 98b4f00 | 2010-04-16 22:30:26 -0500 | [diff] [blame] | 245 | pnglibconf.h |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 246 | cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc |
| 247 | cd '$(DESTDIR)$(pkgconfigdir)'; $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 248 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 249 | # do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 250 | install-exec-hook: |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 251 | cd '$(DESTDIR)$(bindir)'; rm -f libpng-config |
| 252 | cd '$(DESTDIR)$(bindir)';\ |
| 253 | $(LN_S) $(PNGLIB_BASENAME)-config libpng-config |
Glenn Randers-Pehrson | d60b8fa | 2006-04-20 21:31:14 -0500 | [diff] [blame] | 254 | @set -x;\ |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 255 | cd '$(DESTDIR)$(libdir)';\ |
| 256 | for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@\ |
| 257 | sl dylib dll.a; do\ |
Glenn Randers-Pehrson | d60b8fa | 2006-04-20 21:31:14 -0500 | [diff] [blame] | 258 | rm -f libpng.$$ext;\ |
Glenn Randers-Pehrson | 3779c69 | 2006-11-07 20:38:11 -0600 | [diff] [blame] | 259 | if test -f $(PNGLIB_BASENAME).$$ext; then\ |
| 260 | $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\ |
| 261 | fi;\ |
Glenn Randers-Pehrson | d60b8fa | 2006-04-20 21:31:14 -0500 | [diff] [blame] | 262 | done |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 263 | |
| 264 | uninstall-hook: |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 265 | cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h |
| 266 | rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc' |
| 267 | rm -f '$(DESTDIR)$(bindir)/libpng-config' |
| 268 | rm -f '$(DESTDIR)$(libdir)/libpng.a' |
| 269 | rm -f '$(DESTDIR)$(libdir)/libpng.la' |
John Bowler | 408652a | 2012-12-27 09:56:41 -0600 | [diff] [blame] | 270 | rm -f '$(DESTDIR)$(libdir)/libpng.so' |
| 271 | rm -f '$(DESTDIR)$(libdir)/libpng.so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@' |
| 272 | rm -f '$(DESTDIR)$(libdir)/libpng.sl' |
| 273 | rm -f '$(DESTDIR)$(libdir)/libpng.dylib' |
John Bowler | 785a8b1 | 2012-12-15 07:57:31 -0600 | [diff] [blame] | 274 | rm -f '$(DESTDIR)$(libdir)/libpng.dll.a' |