Home | History | Annotate | Download | only in scripts
      1 # makefile for libpng
      2 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
      3 # Copyright (C) 2007-2009 Glenn Randers-Pehrson
      4 #
      5 # This code is released under the libpng license.
      6 # For conditions of distribution and use, see the disclaimer
      7 # and license in png.h
      8 
      9 PREFIX?= /usr/local
     10 LIBDIR=	${PREFIX}/lib
     11 MANDIR= ${PREFIX}/man/cat
     12 
     13 SHLIB_MAJOR=	0
     14 SHLIB_MINOR=	1.2.46
     15 
     16 LIB=	png
     17 SRCS=	png.c pngerror.c pngget.c pngmem.c pngpread.c \
     18 	pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
     19 	pngwio.c pngwrite.c pngwtran.c pngwutil.c
     20 
     21 HDRS=	png.h pngconf.h
     22 
     23 CFLAGS+= -W -Wall
     24 CPPFLAGS+= -I${.CURDIR} -DPNG_NO_MMX_CODE
     25 
     26 NOPROFILE= Yes
     27 
     28 CLEANFILES+= pngtest.o pngtest
     29 
     30 MAN=	libpng.3 libpngpf.3 png.5
     31 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt
     32 
     33 pngtest.o:	pngtest.c
     34 	${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
     35 
     36 pngtest:	pngtest.o
     37 	${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
     38 
     39 test:	pngtest
     40 	cd ${.OBJDIR} && env \
     41 		LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
     42 
     43 beforeinstall:
     44 	if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
     45 	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
     46 	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 
     63 afterinstall:
     64 	@rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
     65 	@rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
     66 	@rm -f ${DESTDIR}${PREFIX}/include/png.h
     67 	@rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
     68 	@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
     69 	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
     70 		-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
     71 	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
     72 		-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
     73 	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
     74 		-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
     75 
     76 .include <bsd.lib.mk>
     77