blob: 0cab873d02bf7ec3de5b864a510262e1a7443b6f [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#
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-Pehrsonbfbf8652009-06-26 21:46:52 -050014SHLIB_MINOR= 1.4.0beta66
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-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050021HDRS= png.h pngconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060022
Glenn Randers-Pehrson79084212008-08-04 13:31:41 -050023CFLAGS+= -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
28CLEANFILES+= pngtest.o pngtest
29
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
33pngtest.o: pngtest.c
34 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
35
36pngtest: pngtest.o
37 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
38
39test: pngtest
40 cd ${.OBJDIR} && env \
41 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
42
43beforeinstall:
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050044 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
45 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060046 fi
47 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
48 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
49 fi
50 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
51 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
52 fi
53 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
54 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
55 fi
56 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
57 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
58 fi
59 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
60 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
61 fi
62
63afterinstall:
64 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
65 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050066 @rm -f ${DESTDIR}${PREFIX}/include/png.h
67 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060068 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
69 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050070 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060071 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050072 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
73 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060074 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
75
76.include <bsd.lib.mk>