Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 1 | # makefile for libpng |
Glenn Randers-Pehrson | 5af0307 | 2014-01-20 12:36:30 -0600 | [diff] [blame] | 2 | # Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 3 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
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 | 0ece631 | 2014-07-21 17:01:01 -0500 | [diff] [blame^] | 14 | SHLIB_MINOR= 1.6.13beta03 |
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 | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 31 | DOCS= ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \ |
| 32 | libpng-manual.txt |
| 33 | |
Cosmin Truta | 9ab7b4c | 2014-03-22 13:13:11 -0500 | [diff] [blame] | 34 | # Pre-built configuration |
| 35 | # See scripts/pnglibconf.mak for more options |
| 36 | PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt |
| 37 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 38 | .c.o: |
| 39 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 40 | |
Cosmin Truta | 9ab7b4c | 2014-03-22 13:13:11 -0500 | [diff] [blame] | 41 | pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) |
Cosmin Truta | 82200da | 2014-03-22 09:29:59 -0500 | [diff] [blame] | 42 | cp $< $@ |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 43 | |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 44 | pngtest.o: pngtest.c |
| 45 | ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} |
| 46 | |
| 47 | pngtest: pngtest.o |
| 48 | ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm |
| 49 | |
| 50 | test: pngtest |
| 51 | cd ${.OBJDIR} && env \ |
| 52 | LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest |
| 53 | |
| 54 | beforeinstall: |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 55 | if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ |
Glenn Randers-Pehrson | 316152f | 2009-12-04 08:42:32 -0600 | [diff] [blame] | 56 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 57 | fi |
| 58 | if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ |
| 59 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \ |
| 60 | fi |
| 61 | if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \ |
| 62 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \ |
| 63 | fi |
| 64 | if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \ |
| 65 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \ |
| 66 | fi |
| 67 | if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \ |
| 68 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \ |
| 69 | fi |
| 70 | if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \ |
| 71 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \ |
| 72 | fi |
| 73 | |
| 74 | afterinstall: |
| 75 | @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a |
| 76 | @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 77 | @rm -f ${DESTDIR}${PREFIX}/include/png.h |
| 78 | @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 79 | @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 80 | @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true |
| 81 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | 316152f | 2009-12-04 08:42:32 -0600 | [diff] [blame] | 82 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 83 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 84 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include |
| 85 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 86 | -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png |
| 87 | |
| 88 | .include <bsd.lib.mk> |