blob: 03a15df6cd65186ec6edc4a29272fbc3a38b55dc [file] [log] [blame]
The Android Open Source Project893912b2009-03-03 19:30:05 -08001# makefile for libpng under FreeBSD
Sireesh Tripurarib478e662014-05-09 15:15:10 +05302# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
Patrick Scotta0bb96c2009-07-22 11:50:02 -04003# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
Patrick Scott5f6bd842010-06-28 16:55:16 -04004#
Patrick Scotta0bb96c2009-07-22 11:50:02 -04005# This code is released under the libpng license.
6# For conditions of distribution and use, see the disclaimer
7# and license in png.h
The Android Open Source Project893912b2009-03-03 19:30:05 -08008
9PREFIX?= /usr/local
Chris Craikb50c2172013-07-29 15:28:30 -070010SHLIB_VER?= 16
The Android Open Source Project893912b2009-03-03 19:30:05 -080011
12LIB= png
13SHLIB_MAJOR= ${SHLIB_VER}
14SHLIB_MINOR= 0
Chris Craikb50c2172013-07-29 15:28:30 -070015NO_PROFILE= YES
16NO_OBJ= YES
The Android Open Source Project893912b2009-03-03 19:30:05 -080017
18# where make install puts libpng.a and png.h
19DESTDIR= ${PREFIX}
20LIBDIR= /lib
Sireesh Tripurarib478e662014-05-09 15:15:10 +053021INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
The Android Open Source Project893912b2009-03-03 19:30:05 -080022INCSDIR= /include/libpng
23INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
24MAN= libpng.3 libpngpf.3 png.5
25MANDIR= /man/man
26SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
Chris Craikb50c2172013-07-29 15:28:30 -070027 libpng/pngconf.h ${INCSDIR}/../pngconf.h \
28 libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
29
30# where make install finds libz.a and zlib.h
31ZLIBLIB= /usr/lib
32ZLIBINC= /usr/include
33
Sireesh Tripurarib478e662014-05-09 15:15:10 +053034LDADD+= -lm -lz
35#LDADD+= -lm -lz -lssp_nonshared # for OSVERSION < 800000 ?
Chris Craikb50c2172013-07-29 15:28:30 -070036
Sireesh Tripurarib478e662014-05-09 15:15:10 +053037DPADD+= ${LIBM} ${LIBZ}
The Android Open Source Project893912b2009-03-03 19:30:05 -080038
Sireesh Tripurarib478e662014-05-09 15:15:10 +053039CPPFLAGS+= -I. -I${ZLIBINC}
40CFLAGS+= -W -Wall
The Android Open Source Project893912b2009-03-03 19:30:05 -080041
42SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
43 pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
44 pngwtran.c pngmem.c pngerror.c pngpread.c
45
Sireesh Tripurarib478e662014-05-09 15:15:10 +053046.c.o:
47 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
48
The Android Open Source Project893912b2009-03-03 19:30:05 -080049pngtest: pngtest.o libpng.a
Chris Craikb50c2172013-07-29 15:28:30 -070050 ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \
51 -lpng ${LDADD}
The Android Open Source Project893912b2009-03-03 19:30:05 -080052
53CLEANFILES= pngtest pngtest.o pngout.png
54
55test: pngtest
56 ./pngtest
57
Chris Craikb50c2172013-07-29 15:28:30 -070058# see scripts/pnglibconf.mak for more options
59pnglibconf.h: scripts/pnglibconf.h.prebuilt
60 cp scripts/pnglibconf.h.prebuilt $@
61
The Android Open Source Project893912b2009-03-03 19:30:05 -080062DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
63writelock:
64 chmod a-w *.[ch35] $(DOCS) scripts/*
65
66.include <bsd.lib.mk>