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