blob: d0c95986b6f52b5d5e2fc3e5aa34b4fa1180e049 [file] [log] [blame]
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -06001# makefile for libpng
2# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -05003# Copyright (C) 2007-2008 Glenn Randers-Pehrson
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -05004#
5# This code is released under the zlib-libpng license.
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -06006# For conditions of distribution and use, see copyright notice in png.h
7
8PREFIX?= /usr/local
9LIBDIR= ${PREFIX}/lib
10MANDIR= ${PREFIX}/man/cat
11
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050012SHLIB_MAJOR= 0
Glenn Randers-Pehrsond84748a2009-06-24 08:17:34 -050013SHLIB_MINOR= 1.4.0beta65
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060014
15LIB= png
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050016SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060017 pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
18 pngwio.c pngwrite.c pngwtran.c pngwutil.c
19
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050020HDRS= png.h pngconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060021
Glenn Randers-Pehrson79084212008-08-04 13:31:41 -050022CFLAGS+= -W -Wall
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050023CPPFLAGS+= -I${.CURDIR}
24
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060025NOPROFILE= Yes
26
27CLEANFILES+= pngtest.o pngtest
28
29MAN= libpng.3 libpngpf.3 png.5
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060030DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060031
32pngtest.o: pngtest.c
33 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
34
35pngtest: pngtest.o
36 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
37
38test: pngtest
39 cd ${.OBJDIR} && env \
40 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
41
42beforeinstall:
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050043 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
44 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060045 fi
46 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
47 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
48 fi
49 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
50 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
51 fi
52 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
53 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
54 fi
55 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
56 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
57 fi
58 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
59 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
60 fi
61
62afterinstall:
63 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
64 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050065 @rm -f ${DESTDIR}${PREFIX}/include/png.h
66 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060067 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
68 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050069 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060070 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050071 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
72 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060073 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
74
75.include <bsd.lib.mk>