Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 1 | # makefile for libpng |
| 2 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
Glenn Randers-Pehrson | 316152f | 2009-12-04 08:42:32 -0600 | [diff] [blame] | 3 | # Copyright (C) 2007-2009 Glenn Randers-Pehrson |
Glenn Randers-Pehrson | 3e61d79 | 2009-06-24 09:31:28 -0500 | [diff] [blame] | 4 | # |
Glenn Randers-Pehrson | bfbf865 | 2009-06-26 21:46:52 -0500 | [diff] [blame] | 5 | # This code is released under the libpng license. |
Glenn Randers-Pehrson | c332bbc | 2009-06-25 13:43:50 -0500 | [diff] [blame] | 6 | # For conditions of distribution and use, see the disclaimer |
Glenn Randers-Pehrson | 037023b | 2009-06-24 10:27:36 -0500 | [diff] [blame] | 7 | # and license in png.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 8 | |
| 9 | PREFIX?= /usr/local |
| 10 | LIBDIR= ${PREFIX}/lib |
| 11 | MANDIR= ${PREFIX}/man/cat |
| 12 | |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 13 | SHLIB_MAJOR= 16 |
Glenn Randers-Pehrson | bb6e0a2 | 2014-01-10 08:19:20 -0600 | [diff] [blame^] | 14 | SHLIB_MINOR= 1.6.9beta04 |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 15 | |
| 16 | LIB= png |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 17 | SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 18 | pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \ |
| 19 | pngwio.c pngwrite.c pngwtran.c pngwutil.c |
| 20 | |
Glenn Randers-Pehrson | 0b3634b | 2011-12-17 09:57:00 -0600 | [diff] [blame] | 21 | HDRS= png.h pngconf.h pnglibconf.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 22 | |
Glenn Randers-Pehrson | 316152f | 2009-12-04 08:42:32 -0600 | [diff] [blame] | 23 | CFLAGS+= -W -Wall |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 24 | CPPFLAGS+= -I${.CURDIR} |
| 25 | |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 26 | NOPROFILE= Yes |
| 27 | |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 28 | CLEANFILES+= pngtest.o pngtest pnglibconf.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 29 | |
| 30 | MAN= libpng.3 libpngpf.3 png.5 |
Glenn Randers-Pehrson | 63495a4 | 2010-10-17 20:23:08 -0500 | [diff] [blame] | 31 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \ |
| 32 | libpng-manual.txt |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 33 | |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 34 | # see scripts/pnglibconf.mak for more options |
Glenn Randers-Pehrson | 8c66786 | 2010-08-24 16:16:35 -0500 | [diff] [blame] | 35 | pnglibconf.h: scripts/pnglibconf.h.prebuilt |
| 36 | cp scripts/pnglibconf.h.prebuilt $@ |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 37 | |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 38 | pngtest.o: pngtest.c |
| 39 | ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} |
| 40 | |
| 41 | pngtest: pngtest.o |
| 42 | ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm |
| 43 | |
| 44 | test: pngtest |
| 45 | cd ${.OBJDIR} && env \ |
| 46 | LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest |
| 47 | |
| 48 | beforeinstall: |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 49 | if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ |
Glenn Randers-Pehrson | 316152f | 2009-12-04 08:42:32 -0600 | [diff] [blame] | 50 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 51 | fi |
| 52 | if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ |
| 53 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \ |
| 54 | fi |
| 55 | if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \ |
| 56 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \ |
| 57 | fi |
| 58 | if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \ |
| 59 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \ |
| 60 | fi |
| 61 | if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \ |
| 62 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \ |
| 63 | fi |
| 64 | if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \ |
| 65 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \ |
| 66 | fi |
| 67 | |
| 68 | afterinstall: |
| 69 | @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a |
| 70 | @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 71 | @rm -f ${DESTDIR}${PREFIX}/include/png.h |
| 72 | @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 73 | @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 74 | @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true |
| 75 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | 316152f | 2009-12-04 08:42:32 -0600 | [diff] [blame] | 76 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 77 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 78 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include |
| 79 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 80 | -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png |
| 81 | |
| 82 | .include <bsd.lib.mk> |