Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 1 | # makefile for libpng |
| 2 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame^] | 3 | # Copyright (C) 2006 Glenn Randers-Pehrson |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 4 | # For conditions of distribution and use, see copyright notice in png.h |
| 5 | |
| 6 | PREFIX?= /usr/local |
| 7 | LIBDIR= ${PREFIX}/lib |
| 8 | MANDIR= ${PREFIX}/man/cat |
| 9 | |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 10 | SHLIB_MAJOR= 0 |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame^] | 11 | SHLIB_MINOR= 1.4.0beta4 |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 12 | |
| 13 | LIB= png |
| 14 | SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \ |
| 15 | pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \ |
| 16 | pngwio.c pngwrite.c pngwtran.c pngwutil.c |
| 17 | |
| 18 | HDRS= png.h pngconf.h |
| 19 | |
| 20 | CFLAGS+= -Wall |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame^] | 21 | CPPFLAGS+= -I${.CURDIR} |
| 22 | |
| 23 | pngconf.h.in: |
| 24 | cat pngconf.h > pngconf.h.in |
| 25 | |
| 26 | pngconf.h: pngconf.h.in |
| 27 | sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h |
| 28 | |
| 29 | /* if you want to use the intel assembler code, remove this */ |
| 30 | echo "#define PNG_NO_MMX_CODE" >> pngconf.h |
| 31 | /* if you want to use the intel MMX code, also remove this */ |
| 32 | echo "#define PNG_NO_ASSEMBLER_CODE" >> pngconf.h |
| 33 | |
| 34 | /* if you don't need thread safety you can uncomment this */ |
| 35 | # echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h |
| 36 | |
| 37 | sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 38 | |
| 39 | NOPROFILE= Yes |
| 40 | |
| 41 | CLEANFILES+= pngtest.o pngtest |
| 42 | |
| 43 | MAN= libpng.3 libpngpf.3 png.5 |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 44 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 45 | |
| 46 | pngtest.o: pngtest.c |
| 47 | ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} |
| 48 | |
| 49 | pngtest: pngtest.o |
| 50 | ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm |
| 51 | |
| 52 | test: pngtest |
| 53 | cd ${.OBJDIR} && env \ |
| 54 | LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest |
| 55 | |
| 56 | beforeinstall: |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 57 | if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ |
| 58 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 59 | fi |
| 60 | if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ |
| 61 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \ |
| 62 | fi |
| 63 | if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \ |
| 64 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \ |
| 65 | fi |
| 66 | if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \ |
| 67 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \ |
| 68 | fi |
| 69 | if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \ |
| 70 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \ |
| 71 | fi |
| 72 | if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \ |
| 73 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \ |
| 74 | fi |
| 75 | |
| 76 | afterinstall: |
| 77 | @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a |
| 78 | @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 79 | @rm -f ${DESTDIR}${PREFIX}/include/png.h |
| 80 | @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 81 | @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true |
| 82 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | fcbd787 | 2002-04-07 16:35:38 -0500 | [diff] [blame] | 83 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 84 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 85 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include |
| 86 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ |
Glenn Randers-Pehrson | c1bfe68 | 2002-03-06 22:08:00 -0600 | [diff] [blame] | 87 | -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png |
| 88 | |
| 89 | .include <bsd.lib.mk> |