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 | d60b8fa | 2006-04-20 21:31:14 -0500 | [diff] [blame] | 6 | SHLIB_VER?= 0 |
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 | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame^] | 27 | pngconf.h.in: |
| 28 | cat pngconf.h > pngconf.h.in |
| 29 | |
| 30 | pngconf.h: pngconf.h.in |
| 31 | 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] | 32 | .if (${MACHINE_ARCH} != "i386") |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame^] | 33 | /* uncoment this if you don't need thread safety */ |
| 34 | # echo "#define PNG_THREAD_UNSAFE_OK" >> pngconf.h |
| 35 | .else |
| 36 | echo "#define PNG_NO_MMX_CODE" >> pngconf.h |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 37 | .endif |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame^] | 38 | sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h |
| 39 | |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 40 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 41 | SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ |
| 42 | pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ |
| 43 | pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 44 | |
| 45 | pngtest: pngtest.o libpng.a |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 46 | ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm |
| 47 | |
| 48 | CLEANFILES= pngtest pngtest.o pngout.png |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 49 | |
| 50 | test: pngtest |
| 51 | ./pngtest |
| 52 | |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 53 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 54 | writelock: |
| 55 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 56 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 57 | .include <bsd.lib.mk> |