blob: 0bd0c880cd32de6b83eac8c58b859851d4444f6c [file] [log] [blame]
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -05001# makefile for libpng for NetBSD for the standard
2# make obj && make depend && make && make test
3# make includes && make install
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -05004# Copyright (C) 2006 Glenn Randers-Pehrson
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -05005# Copyright (C) 2002 Patrick R.L. Welche
6# For conditions of distribution and use, see copyright notice in png.h
7
8# You should also run makefile.netbsd
9
10LOCALBASE?=/usr/local
11LIBDIR= ${LOCALBASE}/lib
12MANDIR= ${LOCALBASE}/man
Glenn Randers-Pehrson17218292006-04-20 07:20:46 -050013INCSDIR=${LOCALBASE}/include/libpng14
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050014
15LIB= png12
16SHLIB_MAJOR= 0
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050017SHLIB_MINOR= 1.4.0beta10
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050018SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
19 pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
20 pngwtran.c pngmem.c pngerror.c pngpread.c
21INCS= png.h pngconf.h
22MAN= libpng.3 libpngpf.3 png.5
23
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050024CPPFLAGS+=-I${.CURDIR}
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050025
26CLEANFILES+=pngtest.o pngtest
27
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050028all: pngconf.h
29
30pngconf.h.in: pngconf.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050031 cat pngconf.h > pngconf.h.in
32
33pngconf.h: pngconf.h.in
34 sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h
35
36 /* if you don't want to use the intel MMX code, uncomment this */
37 # echo "#define PNG_NO_MMX_CODE" >> pngconf.h
38
39 /* if you don't need thread safety you can uncomment this */
40 # echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h
41
42# We should be able to do something like this instead of the manual
43# uncommenting, but it core dumps for me at the moment:
44# .if ${MACHINE_ARCH} == "i386"
45# echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h
46# MKLINT= no
47# .else
48# echo "#define PNG_NO_MMX_CODE" >> pngconf.h
49# .endif
50
51 sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h
52
53
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050054pngtest.o: pngtest.c
55 ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
56
57pngtest: pngtest.o libpng.a
58 ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm
59
60test: pngtest
61 cd ${.CURDIR} && ${.OBJDIR}/pngtest
62
63.include <bsd.lib.mk>