blob: 34f95f73d625b8d9510e2f7d174acf89bb7c1807 [file] [log] [blame]
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -05001# makefile for libpng under FreeBSD
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -05002# Copyright (C) 2002, 2006 Glenn Randers-Pehrson and Andrey A. Chernov
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -05003# For conditions of distribution and use, see copyright notice in png.h
4
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -05005PREFIX?= /usr/local
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -05006SHLIB_VER?= %SONUM%
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -05007
8LIB= png
9SHLIB_MAJOR= ${SHLIB_VER}
10SHLIB_MINOR= 0
11NOPROFILE= YES
12NOOBJ= YES
Glenn Randers-Pehrson03008a02002-04-27 10:11:25 -050013
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050014# where make install puts libpng.a and png.h
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050015DESTDIR= ${PREFIX}
16LIBDIR= /lib
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050017INCS= png.h pngconf.h pngdefs.h
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050018INCSDIR= /include/libpng
19INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
20MAN= libpng.3 libpngpf.3 png.5
21MANDIR= /man/man
22SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
23 libpng/pngconf.h ${INCSDIR}/../pngconf.h
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050024 libpng/pngdefs.h ${INCSDIR}/../pngdefs.h
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050025LDADD+= -lm -lz
26DPADD+= ${LIBM} ${LIBZ}
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050027
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050028all: 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.freebsd */" > pngdefs.h
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050032.if (${MACHINE_ARCH} != "i386")
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050033 /* uncomment this if you don't need thread safety */
34 # echo "#define PNG_THREAD_UNSAFE_OK" >> pngdefs.h
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050035.else
Glenn Randers-Pehrsonbeb572e2006-08-19 13:59:24 -050036 echo "#define PNG_NO_MMX_CODE" >> pngdefs.h
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050037.endif
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050038
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050039SRCS= 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-Pehrson4fb046a2002-04-15 09:25:51 -050042
43pngtest: pngtest.o libpng.a
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050044 ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm
45
46CLEANFILES= pngtest pngtest.o pngout.png
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050047
48test: pngtest
49 ./pngtest
50
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050051DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
52writelock:
53 chmod a-w *.[ch35] $(DOCS) scripts/*
54
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050055.include <bsd.lib.mk>