blob: 357394d0b5e790184740cc2a8107b1b55b450031 [file] [log] [blame]
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -06001# Makefile.am:
2# Source file for Makefile.in (and hence Makefile)
3#
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -06004
Glenn Randers-Pehrsona7dbcba2007-05-15 16:16:34 -05005PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -06006
John Bowlera23f3db2012-01-27 10:24:21 -06007ACLOCAL_AMFLAGS = -I scripts
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -06008
9# test programs - run on make check, make distcheck
Glenn Randers-Pehrson4af77102011-11-17 09:05:18 -060010TESTS_ENVIRONMENT= srcdir=$(srcdir)
11check_PROGRAMS= pngtest
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060012pngtest_SOURCES = pngtest.c
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060013pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
Glenn Randers-Pehrson4af77102011-11-17 09:05:18 -060014TESTS = test-pngtest.sh
Glenn Randers-Pehrsone0bcbfd2011-11-16 23:03:52 -060015
Glenn Randers-Pehrson15ea1fa2011-11-23 15:28:01 -060016# Only do the following if the contrib directory is present.
Glenn Randers-Pehrson702053d2012-08-17 21:23:06 -050017check_PROGRAMS+= pngvalid pngstest pngunknown
Glenn Randers-Pehrson5b79cd52011-11-24 10:56:20 -060018pngvalid_SOURCES = contrib/libtests/pngvalid.c
John Bowlered9f8442011-11-16 11:52:27 -060019pngstest_SOURCES = contrib/libtests/pngstest.c
Glenn Randers-Pehrson702053d2012-08-17 21:23:06 -050020pngunknown_SOURCES = contrib/libtests/pngunknown.c
Glenn Randers-Pehrson4af77102011-11-17 09:05:18 -060021pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
John Bowlered9f8442011-11-16 11:52:27 -060022pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
Glenn Randers-Pehrson702053d2012-08-17 21:23:06 -050023pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
24TESTS += contrib/libtests/test-pngunknown.sh\
John Bowler74a9c072012-08-17 17:40:41 -050025 contrib/libtests/test-pngvalid-simple.sh\
26 contrib/libtests/test-pngvalid-full.sh\
27 contrib/libtests/test-pngstest.sh
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060028
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060029# man pages
30dist_man_MANS= libpng.3 libpngpf.3 png.5
31
32# generate the -config scripts if required
Glenn Randers-Pehrsonf3d737d2011-05-07 21:41:15 -050033binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060034EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060035bin_SCRIPTS= @binconfigs@
36
37# rules to build libpng, only build the old library on request
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060038lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
39# EXTRA_LTLIBRARIES= libpng.la
Glenn Randers-Pehrsonf01459f2010-07-29 19:42:45 -050040libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
Glenn Randers-Pehrson31aee0d2010-07-29 17:39:14 -050041 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-Pehrson9eb125e2012-02-24 22:04:53 -060043 png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
Glenn Randers-Pehrsond5d63602006-04-15 06:37:45 -050044
Glenn Randers-Pehrson6d7705e2011-11-03 00:42:58 -050045if PNG_ARM_NEON
John Bowlerf758d6c2012-12-13 11:26:50 -060046libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
47 arm/filter_neon.S
Glenn Randers-Pehrson6d7705e2011-11-03 00:42:58 -050048endif
49
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -050050nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
51
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060052libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
53 -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060054
55if HAVE_LD_VERSION_SCRIPT
Glenn Randers-Pehrson83bd94f2011-09-01 14:06:49 -050056# Versioned symbols and restricted exports
57if HAVE_SOLARIS_LD
Glenn Randers-Pehrson435cf872011-10-05 16:23:53 -050058 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers
Glenn Randers-Pehrson83bd94f2011-09-01 14:06:49 -050059else
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060060 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers
Glenn Randers-Pehrson83bd94f2011-09-01 14:06:49 -050061endif
62
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060063 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060064else
Glenn Randers-Pehrson83bd94f2011-09-01 14:06:49 -050065# Only restricted exports when possible
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060066 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym
67 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060068endif
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -050069
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060070#distribute headers in /usr/include/libpng/*
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060071pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
Glenn Randers-Pehrson0b3634b2011-12-17 09:57:00 -060072pkginclude_HEADERS= png.h pngconf.h
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -050073nodist_pkginclude_HEADERS= pnglibconf.h
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060074
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060075# pkg-config stuff, note that libpng.pc is always required in order
76# to get the correct library
77pkgconfigdir = @pkgconfigdir@
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060078pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060079
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060080#extra source distribution files.
Glenn Randers-Pehrson7b34df32006-02-24 06:30:16 -060081EXTRA_DIST= \
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -060082 ANNOUNCE CHANGES INSTALL LICENSE README TODO \
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060083 pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
Glenn Randers-Pehrsonb56e0d02010-04-24 12:10:36 -050084 ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060085 $(TESTS) \
Glenn Randers-Pehrsonf3abb2c2010-10-17 12:51:53 -050086 CMakeLists.txt example.c libpng-manual.txt
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060087
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -050088SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
89
John Bowlereb26ee62011-12-08 09:37:24 -060090CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
Glenn Randers-Pehrsonc551c0d2010-03-16 07:52:34 -050091 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
John Bowler42369cc2012-01-31 07:28:13 -060092 check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -050093 $(SCRIPT_CLEANFILES)
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060094
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -050095MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
Glenn Randers-Pehrsonc551c0d2010-03-16 07:52:34 -050096config.sub configure depcomp install-sh ltmain.sh missing
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050097
John Bowler1eb2c482012-01-25 08:07:29 -060098# 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)
101PNG_COPTS = @PNG_COPTS@
102AM_CFLAGS = ${PNG_COPTS}
103
John Bowler71a10f22011-01-22 17:03:33 -0600104# 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.
109DFNCPP = @DFNCPP@
110
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500111SUFFIXES = .chk .dfn .out
Glenn Randers-Pehrson7e597912010-03-17 07:29:42 -0500112
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600113$(PNGLIB_BASENAME).pc: libpng.pc
114 cp libpng.pc $@
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600115
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600116$(PNGLIB_BASENAME)-config: libpng-config
117 cp libpng-config $@
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600118
Glenn Randers-Pehrson0b3634b2011-12-17 09:57:00 -0600119scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
John Bowler42369cc2012-01-31 07:28:13 -0600120scripts/prefix.out: png.h pngconf.h pnglibconf.out
Glenn Randers-Pehrson0b3634b2011-12-17 09:57:00 -0600121scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
Glenn Randers-Pehrson7e597912010-03-17 07:29:42 -0500122
123libpng.sym: scripts/sym.out
124 rm -f $@
125 cp $? $@
126libpng.vers: scripts/vers.out
127 rm -f $@
128 cp $? $@
John Bowler42369cc2012-01-31 07:28:13 -0600129
John Bowler516c9c92012-02-01 07:14:24 -0600130if DO_PNG_PREFIX
John Bowler42369cc2012-01-31 07:28:13 -0600131# 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).
134pnglibconf.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
144pngprefix.h: scripts/intprefix.out
145 rm -f pngprefix.tf1
146 $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
147 mv pngprefix.tf1 $@
148else
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500149pnglibconf.h: pnglibconf.out
150 rm -f $@
151 cp $? $@
John Bowler42369cc2012-01-31 07:28:13 -0600152
153pngprefix.h: # is empty
154 :>$@
155endif
156
John Bowler5a77e672011-07-14 07:42:11 -0500157$(srcdir)/scripts/pnglibconf.h.prebuilt:
158 @echo "Attempting to build $@" >&2
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500159 @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-Pehrsone6474622006-03-04 16:50:47 -0600162
Glenn Randers-Pehrson2be8b642010-07-29 19:09:18 -0500163# 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-Pehrson5b79cd52011-11-24 10:56:20 -0600166contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
John Bowler74a9c072012-08-17 17:40:41 -0500167contrib/libtests/pngunknown.o: pnglibconf.h
Glenn Randers-Pehrson2be8b642010-07-29 19:09:18 -0500168
Glenn Randers-Pehrson0012e9c2011-01-26 22:04:03 -0600169# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
Glenn Randers-Pehrson83bd94f2011-09-01 14:06:49 -0500170# be built with PNG_USE_READ_MACROS; this prevents the read macros from
171# interfering with the symbol file format.
Glenn Randers-Pehrsona528fba2010-03-12 21:03:18 -0600172SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
173 -DPNGLIB_VERSION='@PNGLIB_VERSION@'\
John Bowlerf21a0d02011-01-23 23:55:19 -0600174 -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
Glenn Randers-Pehrson80de04e2011-03-24 23:06:26 -0500175 -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
Glenn Randers-Pehrsona528fba2010-03-12 21:03:18 -0600176
John Bowler516c9c92012-02-01 07:14:24 -0600177if DO_PNG_PREFIX
John Bowler42369cc2012-01-31 07:28:13 -0600178SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
179endif
180
Glenn Randers-Pehrson7e597912010-03-17 07:29:42 -0500181.dfn.out:
John Bowlereb26ee62011-12-08 09:37:24 -0600182 rm -f $@ $*.c $*.tf[123]
Glenn Randers-Pehrson7e597912010-03-17 07:29:42 -0500183 test -d scripts || mkdir scripts
John Bowlereb26ee62011-12-08 09:37:24 -0600184 echo '#include "$<"' >$*.c
John Bowlerba6fbc52011-12-17 14:21:54 -0600185 $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
John Bowlereb26ee62011-12-08 09:37:24 -0600186 $(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
John Bowler1d8b7552011-11-03 18:19:53 -0500187 $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
John Bowlereb26ee62011-12-08 09:37:24 -0600188 $*.tf1 >$*.tf2
189 $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' $*.tf2 >$*.tf3
190 rm -f $*.c $*.tf[12]
191 mv $*.tf3 $@
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -0600192
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500193# The .dfn file for pnglibconf.h is machine generated
Glenn Randers-Pehrson9eb125e2012-02-24 22:04:53 -0600194pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
John Bowlereb26ee62011-12-08 09:37:24 -0600195 rm -f $@ $*.tf[45]
196 $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
John Bowlerd4973832011-11-08 19:34:54 -0600197 ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
Glenn Randers-Pehrson9eb125e2012-02-24 22:04:53 -0600198 ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
John Bowlereb26ee62011-12-08 09:37:24 -0600199 $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
200 rm $*.tf4
201 mv $*.tf5 $@
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500202
203# Symbol checks (.def and .out files should match)
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500204scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
John Bowlereb26ee62011-12-08 09:37:24 -0600205
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500206.out.chk:
John Bowlereb26ee62011-12-08 09:37:24 -0600207 rm -f $@ $*.new
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500208 $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
John Bowlereb26ee62011-12-08 09:37:24 -0600209 of="$*.new" $< >&2
210 mv $*.new $@
Glenn Randers-Pehrsonc551c0d2010-03-16 07:52:34 -0500211
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500212# used on demand to regenerate the standard header, CPPFLAGS should
213# be empty - no non-standard defines
John Bowlerd4973832011-11-08 19:34:54 -0600214scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
John Bowlereb26ee62011-12-08 09:37:24 -0600215 rm -f $@ pnglibconf.tf[67]
Glenn Randers-Pehrsonf3d737d2011-05-07 21:41:15 -0500216 test -z "$(CPPFLAGS)"
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500217 echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
John Bowlereb26ee62011-12-08 09:37:24 -0600218 $(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-Pehrsonc551c0d2010-03-16 07:52:34 -0500225
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500226$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
John Bowler42369cc2012-01-31 07:28:13 -0600227 pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500228
229test: check-am
230
231# Extra checks
John Bowlere06092a2010-12-27 22:10:19 -0600232check: scripts/symbols.chk
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500233
234# Don't distribute the generated script files
235dist-hook:
236 cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -0500237
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600238# install the .../include headers as links to the new ones
239install-data-hook:
John Bowler785a8b12012-12-15 07:57:31 -0600240 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-Pehrsonf7831012008-11-13 06:05:13 -0600243 pngconf.h
John Bowler785a8b12012-12-15 07:57:31 -0600244 cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \
Glenn Randers-Pehrson98b4f002010-04-16 22:30:26 -0500245 pnglibconf.h
John Bowler785a8b12012-12-15 07:57:31 -0600246 cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc
247 cd '$(DESTDIR)$(pkgconfigdir)'; $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600248
Glenn Randers-Pehrsone3f3c4e2010-02-07 18:08:50 -0600249# do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600250install-exec-hook:
John Bowler785a8b12012-12-15 07:57:31 -0600251 cd '$(DESTDIR)$(bindir)'; rm -f libpng-config
252 cd '$(DESTDIR)$(bindir)';\
253 $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
Glenn Randers-Pehrsond60b8fa2006-04-20 21:31:14 -0500254 @set -x;\
John Bowler785a8b12012-12-15 07:57:31 -0600255 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-Pehrsond60b8fa2006-04-20 21:31:14 -0500258 rm -f libpng.$$ext;\
Glenn Randers-Pehrson3779c692006-11-07 20:38:11 -0600259 if test -f $(PNGLIB_BASENAME).$$ext; then\
260 $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
261 fi;\
Glenn Randers-Pehrsond60b8fa2006-04-20 21:31:14 -0500262 done
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -0600263
264uninstall-hook:
John Bowler785a8b12012-12-15 07:57:31 -0600265 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 Bowler408652a2012-12-27 09:56:41 -0600270 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 Bowler785a8b12012-12-15 07:57:31 -0600274 rm -f '$(DESTDIR)$(libdir)/libpng.dll.a'