blob: f7ce5819c20d3038ee6b9bafa19751c123eaf35b [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-Pehrsond60b8fa2006-04-20 21:31:14 -05006SHLIB_VER?= 0
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
17INCS= png.h pngconf.h
18INCSDIR= /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
24LDADD+= -lm -lz
25DPADD+= ${LIBM} ${LIBZ}
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050026
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050027pngconf.h.in:
28 cat pngconf.h > pngconf.h.in
29
30pngconf.h: pngconf.h.in
31 sed "/Makefile-supplied defines go here:/q" pngconf.h.in > pngconf.h
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050032.if (${MACHINE_ARCH} != "i386")
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050033 /* 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-Pehrson4fb046a2002-04-15 09:25:51 -050037.endif
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050038 sed "1,/Makefile-supplied defines go here:/d" pngconf.h.in >> pngconf.h
39
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050040
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050041SRCS= 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-Pehrson4fb046a2002-04-15 09:25:51 -050044
45pngtest: pngtest.o libpng.a
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050046 ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm
47
48CLEANFILES= pngtest pngtest.o pngout.png
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050049
50test: pngtest
51 ./pngtest
52
Glenn Randers-Pehrson4fb046a2002-04-15 09:25:51 -050053DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
54writelock:
55 chmod a-w *.[ch35] $(DOCS) scripts/*
56
Glenn Randers-Pehrsoncfbed9b2002-05-21 18:06:08 -050057.include <bsd.lib.mk>