blob: 61c7604edfdf788cadec2d841c60d47a04d915cb [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-Pehrsonfcbd7872002-04-07 16:35:38 -050013SHLIB_MAJOR= 0
Glenn Randers-Pehrsonf1361552010-04-01 07:17:54 -050014SHLIB_MINOR= 1.5.0beta17
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-Pehrson72531442010-04-17 08:17:51 -050021HDRS= 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-Pehrsonc3d51c12006-03-02 07:23:18 -060031DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060032
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050033# see scripts/pnglibconf.mak for more options
34pnglibconf.h: scripts/pnglibconf.h
35 cp scripts/pnglibconf.h $@
36
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060037pngtest.o: pngtest.c
38 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
39
40pngtest: pngtest.o
41 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
42
43test: pngtest
44 cd ${.OBJDIR} && env \
45 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
46
47beforeinstall:
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050048 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060049 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060050 fi
51 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
52 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
53 fi
54 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
55 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
56 fi
57 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
58 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
59 fi
60 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
61 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
62 fi
63 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
64 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
65 fi
66
67afterinstall:
68 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
69 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050070 @rm -f ${DESTDIR}${PREFIX}/include/png.h
71 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050072 @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060073 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
74 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson316152f2009-12-04 08:42:32 -060075 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060076 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050077 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
78 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060079 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
80
81.include <bsd.lib.mk>