blob: e22e72ba2f89130728167d304a1bbc3c72a49cae [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-Pehrsonb3870ab2006-05-11 09:43:09 -05003# Copyright (C) 2006 Glenn Randers-Pehrson
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -06004# For conditions of distribution and use, see copyright notice in png.h
5
6PREFIX?= /usr/local
7LIBDIR= ${PREFIX}/lib
8MANDIR= ${PREFIX}/man/cat
9
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050010SHLIB_MAJOR= 0
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050011SHLIB_MINOR= 1.4.0beta10
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060012
13LIB= png
14SRCS= 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
18HDRS= png.h pngconf.h
19
20CFLAGS+= -Wall
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050021CPPFLAGS+= -I${.CURDIR}
22
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050023all: pngconf.h
24
25pngconf.h.in: pngconf.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050026 cat pngconf.h > pngconf.h.in
27
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050028pngconf.h: pngconf.h.in
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050029 sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h
30
31 /* if you want to use the intel assembler code, remove this */
32 echo "#define PNG_NO_MMX_CODE" >> pngconf.h
33 /* if you want to use the intel MMX code, also remove this */
34 echo "#define PNG_NO_ASSEMBLER_CODE" >> pngconf.h
35
36 /* if you don't need thread safety you can uncomment this */
37 # echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h
38
39 sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060040
41NOPROFILE= Yes
42
43CLEANFILES+= pngtest.o pngtest
44
45MAN= libpng.3 libpngpf.3 png.5
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060046DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060047
48pngtest.o: pngtest.c
49 ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
50
51pngtest: pngtest.o
52 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
53
54test: pngtest
55 cd ${.OBJDIR} && env \
56 LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
57
58beforeinstall:
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050059 if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
60 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060061 fi
62 if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
63 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
64 fi
65 if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
66 ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
67 fi
68 if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
69 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
70 fi
71 if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
72 ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
73 fi
74 if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
75 ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
76 fi
77
78afterinstall:
79 @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
80 @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050081 @rm -f ${DESTDIR}${PREFIX}/include/png.h
82 @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060083 @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
84 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonfcbd7872002-04-07 16:35:38 -050085 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060086 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050087 -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
88 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
Glenn Randers-Pehrsonc1bfe682002-03-06 22:08:00 -060089 -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
90
91.include <bsd.lib.mk>