2 # Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
3 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
5 # This code is released under the libpng license.
6 # For conditions of distribution and use, see the disclaimer
11 MANDIR= ${PREFIX}/man/cat
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 HDRS= png.h pngconf.h pnglibconf.h
21 MAN= libpng.3 libpngpf.3 png.5
22 DOCS= ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO \
26 CPPFLAGS+= -I${.CURDIR}
30 CLEANFILES+= pngtest.o pngtest pnglibconf.h
32 # Pre-built configuration
33 # See scripts/pnglibconf.mak for more options
34 PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
37 ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
39 pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
40 cp ${PNGLIBCONF_H_PREBUILT} $@
43 ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
46 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
49 cd ${.OBJDIR} && env \
50 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
53 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
54 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
56 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
57 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
59 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
60 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
62 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
63 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
65 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
66 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
68 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
69 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
73 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
74 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
75 @rm -f ${DESTDIR}${PREFIX}/include/png.h
76 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
77 @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
78 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
79 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
80 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
81 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
82 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
83 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
84 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png