blob: ca7c7ae7e4a1a6947ea1bbd9692486ba403c2b77 [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-Pehrsonbb6e0a22014-01-10 08:19:20 -060014SHLIB_MINOR= 1.6.9beta04
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-Pehrson42503282014-01-12 10:44:01 -060031DOCS= ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
32 libpng-manual.txt
33
34.c.o:
35 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060036
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050037# see scripts/pnglibconf.mak for more options
Glenn Randers-Pehrson8c667862010-08-24 16:16:35 -050038pnglibconf.h: scripts/pnglibconf.h.prebuilt
39 cp scripts/pnglibconf.h.prebuilt $@
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050040
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060041pngtest.o: pngtest.c
42 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
43
44pngtest: pngtest.o
45 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
46
47test: pngtest
48 cd ${.OBJDIR} && env \
49 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
50
51beforeinstall:
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050052 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060053 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060054 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
71afterinstall:
72 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
73 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050074 @rm -f ${DESTDIR}${PREFIX}/include/png.h
75 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050076 @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060077 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
78 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060079 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060080 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050081 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
82 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060083 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
84
85.include <bsd.lib.mk>