blob: 9a0033c6234b911f280c3ba2da5c6a75710b3828 [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-Pehrson316152f2009-12-04 08:42:32 -06003# Copyright (C) 2007-2009 Glenn Randers-Pehrson
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -05004#
Glenn Randers-Pehrsonbfbf8652009-06-26 21:46:52 -05005# This code is released under the libpng license.
Glenn Randers-Pehrsonc332bbc2009-06-25 13:43:50 -05006# For conditions of distribution and use, see the disclaimer
Glenn Randers-Pehrson037023b2009-06-24 10:27:36 -05007# and license in png.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -06008
9PREFIX?= /usr/local
10LIBDIR= ${PREFIX}/lib
11MANDIR= ${PREFIX}/man/cat
12
Glenn Randers-Pehrson7455cbf2011-11-24 14:40:36 -060013SHLIB_MAJOR= 16
Glenn Randers-Pehrsonc4f94cb2011-12-15 13:05:55 -060014SHLIB_MINOR= 1.6.0beta02
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060015
16LIB= png
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050017SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060018 pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
19 pngwio.c pngwrite.c pngwtran.c pngwutil.c
20
Glenn Randers-Pehrson0b3634b2011-12-17 09:57:00 -060021HDRS= png.h pngconf.h pnglibconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060022
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060023CFLAGS+= -W -Wall
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050024CPPFLAGS+= -I${.CURDIR}
25
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060026NOPROFILE= Yes
27
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050028CLEANFILES+= pngtest.o pngtest pnglibconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060029
30MAN= libpng.3 libpngpf.3 png.5
Glenn Randers-Pehrson63495a42010-10-17 20:23:08 -050031DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
32 libpng-manual.txt
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060033
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050034# see scripts/pnglibconf.mak for more options
Glenn Randers-Pehrson8c667862010-08-24 16:16:35 -050035pnglibconf.h: scripts/pnglibconf.h.prebuilt
36 cp scripts/pnglibconf.h.prebuilt $@
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050037
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060038pngtest.o: pngtest.c
39 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
40
41pngtest: pngtest.o
42 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
43
44test: pngtest
45 cd ${.OBJDIR} && env \
46 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
47
48beforeinstall:
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050049 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060050 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060051 fi
52 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
53 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
54 fi
55 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
56 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
57 fi
58 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
59 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
60 fi
61 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
62 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
63 fi
64 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
65 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
66 fi
67
68afterinstall:
69 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
70 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050071 @rm -f ${DESTDIR}${PREFIX}/include/png.h
72 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050073 @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060074 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
75 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060076 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060077 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050078 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
79 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060080 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
81
82.include <bsd.lib.mk>