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 | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame^] | 6 | SHLIB_VER?= %SONUM% |
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 |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 17 | INCS= png.h pngconf.h pngdefs.h |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 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 |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 24 | libpng/pngdefs.h ${INCSDIR}/../pngdefs.h |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 25 | LDADD+= -lm -lz |
| 26 | DPADD+= ${LIBM} ${LIBZ} |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 27 | |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 28 | all: pngdefs.h |
Glenn Randers-Pehrson | 3424ee7 | 2006-07-12 13:33:47 -0500 | [diff] [blame] | 29 | |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 30 | pngdefs.h: |
| 31 | echo "/* pngdefs.h was built by makefile.freebsd */" > pngdefs.h |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 32 | .if (${MACHINE_ARCH} != "i386") |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 33 | /* uncomment this if you don't need thread safety */ |
| 34 | # echo "#define PNG_THREAD_UNSAFE_OK" >> pngdefs.h |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 35 | .else |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 36 | echo "#define PNG_NO_MMX_CODE" >> pngdefs.h |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 37 | .endif |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 38 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 39 | SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ |
| 40 | pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ |
| 41 | pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 42 | |
| 43 | pngtest: pngtest.o libpng.a |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 44 | ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm |
| 45 | |
| 46 | CLEANFILES= pngtest pngtest.o pngout.png |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 47 | |
| 48 | test: pngtest |
| 49 | ./pngtest |
| 50 | |
Glenn Randers-Pehrson | 4fb046a | 2002-04-15 09:25:51 -0500 | [diff] [blame] | 51 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 52 | writelock: |
| 53 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 54 | |
Glenn Randers-Pehrson | cfbed9b | 2002-05-21 18:06:08 -0500 | [diff] [blame] | 55 | .include <bsd.lib.mk> |