fukasawa e60969
# makefile for libpng
fukasawa e60969
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
fukasawa e60969
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
fukasawa e60969
#
fukasawa e60969
# This code is released under the libpng license.
fukasawa e60969
# For conditions of distribution and use, see the disclaimer
fukasawa e60969
# and license in png.h
fukasawa e60969
fukasawa e60969
PREFIX?= /usr/local
fukasawa e60969
LIBDIR=	${PREFIX}/lib
fukasawa e60969
MANDIR= ${PREFIX}/man/cat
fukasawa e60969
fukasawa e60969
SHLIB_MAJOR=	16
fukasawa e60969
SHLIB_MINOR=	1.6.21
fukasawa e60969
fukasawa e60969
LIB=	png
fukasawa e60969
SRCS=	png.c pngerror.c pngget.c pngmem.c pngpread.c \
fukasawa e60969
	pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
fukasawa e60969
	pngwio.c pngwrite.c pngwtran.c pngwutil.c
fukasawa e60969
fukasawa e60969
HDRS=	png.h pngconf.h pnglibconf.h
fukasawa e60969
fukasawa e60969
CFLAGS+= -W -Wall
fukasawa e60969
CPPFLAGS+= -I${.CURDIR}
fukasawa e60969
fukasawa e60969
NOPROFILE= Yes
fukasawa e60969
fukasawa e60969
CLEANFILES+= pngtest.o pngtest pnglibconf.h
fukasawa e60969
fukasawa e60969
MAN=	libpng.3 libpngpf.3 png.5
fukasawa e60969
DOCS=	ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
fukasawa e60969
	libpng-manual.txt
fukasawa e60969
fukasawa e60969
# Pre-built configuration
fukasawa e60969
# See scripts/pnglibconf.mak for more options
fukasawa e60969
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
fukasawa e60969
fukasawa e60969
.c.o:
fukasawa e60969
	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
fukasawa e60969
fukasawa e60969
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
fukasawa e60969
	cp $(PNGLIBCONF_H_PREBUILT) $@
fukasawa e60969
fukasawa e60969
pngtest.o:	pngtest.c
fukasawa e60969
	${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
fukasawa e60969
fukasawa e60969
pngtest:	pngtest.o
fukasawa e60969
	${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
fukasawa e60969
fukasawa e60969
test:	pngtest
fukasawa e60969
	cd ${.OBJDIR} && env \
fukasawa e60969
		LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
fukasawa e60969
fukasawa e60969
beforeinstall:
fukasawa e60969
	if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
fukasawa e60969
	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
fukasawa e60969
	fi
fukasawa e60969
	if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
fukasawa e60969
	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
fukasawa e60969
	fi
fukasawa e60969
	if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
fukasawa e60969
	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
fukasawa e60969
	fi
fukasawa e60969
	if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
fukasawa e60969
	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
fukasawa e60969
	fi
fukasawa e60969
	if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
fukasawa e60969
	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
fukasawa e60969
	fi
fukasawa e60969
	if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
fukasawa e60969
	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
fukasawa e60969
	fi
fukasawa e60969
fukasawa e60969
afterinstall:
fukasawa e60969
	@rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
fukasawa e60969
	@rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
fukasawa e60969
	@rm -f ${DESTDIR}${PREFIX}/include/png.h
fukasawa e60969
	@rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
fukasawa e60969
	@rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
fukasawa e60969
	@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
fukasawa e60969
	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
fukasawa e60969
		-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
fukasawa e60969
	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
fukasawa e60969
		-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
fukasawa e60969
	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
fukasawa e60969
		-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
fukasawa e60969
fukasawa e60969
.include <bsd.lib.mk></bsd.lib.mk>