]> git.saurik.com Git - wxWidgets.git/blob - src/png/scripts/makefile.openbsd
fix compilation both for Robert's cross-compiler and for all normal compilers by...
[wxWidgets.git] / src / png / scripts / makefile.openbsd
1 # makefile for libpng
2 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
3 # For conditions of distribution and use, see copyright notice in png.h
4
5 PREFIX?= /usr/local
6 LIBDIR= ${PREFIX}/lib
7 MANDIR= ${PREFIX}/man/cat
8
9 SHLIB_MAJOR= 0
10 SHLIB_MINOR= 1.2.7
11
12 LIB= png
13 SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
14 pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
15 pngwio.c pngwrite.c pngwtran.c pngwutil.c
16
17 HDRS= png.h pngconf.h
18
19 CFLAGS+= -Wall
20 CPPFLAGS+= -I${.CURDIR} -DPNG_NO_ASSEMBLER_CODE -DPNG_USE_PNGGCCRD
21
22 NOPROFILE= Yes
23
24 CLEANFILES+= pngtest.o pngtest
25
26 MAN= libpng.3 libpngpf.3 png.5
27 DOCS= ANNOUNCE CHANGES LICENSE README libpng.txt
28
29 pngtest.o: pngtest.c
30 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
31
32 pngtest: pngtest.o
33 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
34
35 test: pngtest
36 cd ${.OBJDIR} && env \
37 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
38
39 beforeinstall:
40 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
41 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \
42 fi
43 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
44 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
45 fi
46 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
47 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
48 fi
49 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
50 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
51 fi
52 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
53 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
54 fi
55 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
56 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
57 fi
58
59 afterinstall:
60 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
61 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
62 @rm -f ${DESTDIR}${PREFIX}/include/png.h
63 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
64 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
65 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
66 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
67 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
68 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
69 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
70 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
71
72 .include <bsd.lib.mk>