blob: e7e9e17aa32999a01dbc380386d9f27b0321e88f [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
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050015LIB= png14
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050016SHLIB_MAJOR= 0
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050017SHLIB_MINOR= 1.4.0beta11
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
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050021INCS= png.h pngconf.h pngpriv.h
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050022MAN= 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-Pehrsonbeb572e2006-08-19 13:59:24 -050028all: pngconf.h pngdefs.h
Glenn Randers-Pehrson3424ee72006-07-12 13:33:47 -050029
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050030pngdefs.h:
31 echo "/* pngdefs.h was built by makefile.netbsd */" > pngdefs.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050032 /* if you don't want to use the intel MMX code, uncomment this */
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050033 # echo "#define PNG_NO_MMX_CODE" >> pngdefs.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050034 /* if you don't need thread safety you can uncomment this */
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050035 # echo "#define PNG_THREAD_UNSAFE_OK" >> pngdefs.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050036
37# We should be able to do something like this instead of the manual
38# uncommenting, but it core dumps for me at the moment:
39# .if ${MACHINE_ARCH} == "i386"
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050040# echo "#define PNG_THREAD_UNSAFE_OK" >> pngdefs.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050041# MKLINT= no
42# .else
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050043# echo "#define PNG_NO_MMX_CODE" >> pngdefs.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050044# .endif
45
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050046pngtest.o: pngtest.c
47 ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
48
49pngtest: pngtest.o libpng.a
50 ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm
51
52test: pngtest
53 cd ${.CURDIR} && ${.OBJDIR}/pngtest
54
55.include <bsd.lib.mk>