Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 1 | # makefile for libpng under FreeBSD |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 2 | # Copyright (C) 2002, 2006 Glenn Randers-Pehrson and Andrey A. Chernov |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 3 | # For conditions of distribution and use, see copyright notice in png.h |
| 4 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 5 | PREFIX?= /usr/local |
Glenn Randers-Pehrson | f46918d | 2006-06-02 05:31:20 -0500 | [diff] [blame] | 6 | SHLIB_VER?= 1 |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 7 | |
| 8 | LIB= png |
| 9 | SHLIB_MAJOR= ${SHLIB_VER} |
| 10 | SHLIB_MINOR= 0 |
| 11 | NOPROFILE= YES |
| 12 | NOOBJ= YES |
Glenn Randers-Pehrson | 03008a0 | 2002-04-27 10:11:25 -0500 | [diff] [blame] | 13 | |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 14 | # where make install puts libpng.a and png.h |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 15 | DESTDIR= ${PREFIX} |
| 16 | LIBDIR= /lib |
| 17 | INCS= png.h pngconf.h |
| 18 | INCSDIR= /include/libpng |
| 19 | INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk |
| 20 | MAN= libpng.3 libpngpf.3 png.5 |
| 21 | MANDIR= /man/man |
| 22 | SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \ |
| 23 | libpng/pngconf.h ${INCSDIR}/../pngconf.h |
| 24 | LDADD+= -lm -lz |
| 25 | DPADD+= ${LIBM} ${LIBZ} |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 26 | |
Glenn Randers-Pehrson | 3424ee7 | 2006-07-12 13:33:47 -0500 | [diff] [blame^] | 27 | all: pngconf.h |
| 28 | |
| 29 | pngconf.h.in: pngconf.h |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 30 | cat pngconf.h > pngconf.h.in |
| 31 | |
| 32 | pngconf.h: pngconf.h.in |
| 33 | sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 34 | .if (${MACHINE_ARCH} != "i386") |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 35 | /* uncoment this if you don't need thread safety */ |
| 36 | # echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h |
| 37 | .else |
| 38 | echo "#define PNG_NO_MMX_CODE" >> pngconf.h |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 39 | .endif |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 40 | sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h |
| 41 | |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 42 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 43 | SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ |
| 44 | pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ |
| 45 | pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 46 | |
| 47 | pngtest: pngtest.o libpng.a |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 48 | ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm |
| 49 | |
| 50 | CLEANFILES= pngtest pngtest.o pngout.png |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 51 | |
| 52 | test: pngtest |
| 53 | ./pngtest |
| 54 | |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 55 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 56 | writelock: |
| 57 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 58 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 59 | .include <bsd.lib.mk> |