blob: e958e6dbe62b98c52fc2a3b9470293fef7c01111 [file] [log] [blame]
The Android Open Source Project893912b2009-03-03 19:30:05 -08001# makefile for libpng under FreeBSD
xNombre232e9ca2020-07-03 22:10:22 +02002# Copyright (C) 2020 Cosmin Truta
Sireesh Tripurarib478e662014-05-09 15:15:10 +05303# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
Patrick Scotta0bb96c2009-07-22 11:50:02 -04004# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
Patrick Scott5f6bd842010-06-28 16:55:16 -04005#
Patrick Scotta0bb96c2009-07-22 11:50:02 -04006# This code is released under the libpng license.
7# For conditions of distribution and use, see the disclaimer
8# and license in png.h
The Android Open Source Project893912b2009-03-03 19:30:05 -08009
10PREFIX?= /usr/local
Chris Craikb50c2172013-07-29 15:28:30 -070011SHLIB_VER?= 16
The Android Open Source Project893912b2009-03-03 19:30:05 -080012
13LIB= png
14SHLIB_MAJOR= ${SHLIB_VER}
15SHLIB_MINOR= 0
Chris Craikb50c2172013-07-29 15:28:30 -070016NO_PROFILE= YES
Matt Sarett9b1fe632015-11-25 10:21:17 -050017NO_OBJ= YES
The Android Open Source Project893912b2009-03-03 19:30:05 -080018
19# where make install puts libpng.a and png.h
20DESTDIR= ${PREFIX}
21LIBDIR= /lib
Sireesh Tripurarib478e662014-05-09 15:15:10 +053022INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
The Android Open Source Project893912b2009-03-03 19:30:05 -080023INCSDIR= /include/libpng
24INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
25MAN= libpng.3 libpngpf.3 png.5
26MANDIR= /man/man
27SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
Chris Craikb50c2172013-07-29 15:28:30 -070028 libpng/pngconf.h ${INCSDIR}/../pngconf.h \
29 libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
30
31# where make install finds libz.a and zlib.h
32ZLIBLIB= /usr/lib
33ZLIBINC= /usr/include
34
Sireesh Tripurarib478e662014-05-09 15:15:10 +053035LDADD+= -lm -lz
36#LDADD+= -lm -lz -lssp_nonshared # for OSVERSION < 800000 ?
Chris Craikb50c2172013-07-29 15:28:30 -070037
Sireesh Tripurarib478e662014-05-09 15:15:10 +053038DPADD+= ${LIBM} ${LIBZ}
The Android Open Source Project893912b2009-03-03 19:30:05 -080039
Sireesh Tripurarib478e662014-05-09 15:15:10 +053040CPPFLAGS+= -I. -I${ZLIBINC}
41CFLAGS+= -W -Wall
The Android Open Source Project893912b2009-03-03 19:30:05 -080042
Matt Sarett9b1fe632015-11-25 10:21:17 -050043# Pre-built configuration
44# See scripts/pnglibconf.mak for more options
45PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
46
xNombre232e9ca2020-07-03 22:10:22 +020047SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
48 pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
49 pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
The Android Open Source Project893912b2009-03-03 19:30:05 -080050
Sireesh Tripurarib478e662014-05-09 15:15:10 +053051.c.o:
52 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
53
The Android Open Source Project893912b2009-03-03 19:30:05 -080054pngtest: pngtest.o libpng.a
Chris Craikb50c2172013-07-29 15:28:30 -070055 ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \
56 -lpng ${LDADD}
The Android Open Source Project893912b2009-03-03 19:30:05 -080057
58CLEANFILES= pngtest pngtest.o pngout.png
59
60test: pngtest
61 ./pngtest
62
Matt Sarett9b1fe632015-11-25 10:21:17 -050063pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
64 cp $(PNGLIBCONF_H_PREBUILT) $@
Chris Craikb50c2172013-07-29 15:28:30 -070065
The Android Open Source Project893912b2009-03-03 19:30:05 -080066.include <bsd.lib.mk>