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