The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 1 | # makefile for libpng under FreeBSD |
xNombre | 232e9ca | 2020-07-03 22:10:22 +0200 | [diff] [blame] | 2 | # Copyright (C) 2020 Cosmin Truta |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 3 | # Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov |
Patrick Scott | a0bb96c | 2009-07-22 11:50:02 -0400 | [diff] [blame] | 4 | # Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov |
Patrick Scott | 5f6bd84 | 2010-06-28 16:55:16 -0400 | [diff] [blame] | 5 | # |
Patrick Scott | a0bb96c | 2009-07-22 11:50:02 -0400 | [diff] [blame] | 6 | # 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 Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 9 | |
| 10 | PREFIX?= /usr/local |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 11 | SHLIB_VER?= 16 |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 12 | |
| 13 | LIB= png |
| 14 | SHLIB_MAJOR= ${SHLIB_VER} |
| 15 | SHLIB_MINOR= 0 |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 16 | NO_PROFILE= YES |
Matt Sarett | 9b1fe63 | 2015-11-25 10:21:17 -0500 | [diff] [blame] | 17 | NO_OBJ= YES |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 18 | |
| 19 | # where make install puts libpng.a and png.h |
| 20 | DESTDIR= ${PREFIX} |
| 21 | LIBDIR= /lib |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 22 | INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 23 | INCSDIR= /include/libpng |
| 24 | INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk |
| 25 | MAN= libpng.3 libpngpf.3 png.5 |
| 26 | MANDIR= /man/man |
| 27 | SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \ |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 28 | libpng/pngconf.h ${INCSDIR}/../pngconf.h \ |
| 29 | libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h |
| 30 | |
| 31 | # where make install finds libz.a and zlib.h |
| 32 | ZLIBLIB= /usr/lib |
| 33 | ZLIBINC= /usr/include |
| 34 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 35 | LDADD+= -lm -lz |
| 36 | #LDADD+= -lm -lz -lssp_nonshared # for OSVERSION < 800000 ? |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 37 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 38 | DPADD+= ${LIBM} ${LIBZ} |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 39 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 40 | CPPFLAGS+= -I. -I${ZLIBINC} |
| 41 | CFLAGS+= -W -Wall |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 42 | |
Matt Sarett | 9b1fe63 | 2015-11-25 10:21:17 -0500 | [diff] [blame] | 43 | # Pre-built configuration |
| 44 | # See scripts/pnglibconf.mak for more options |
| 45 | PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt |
| 46 | |
xNombre | 232e9ca | 2020-07-03 22:10:22 +0200 | [diff] [blame] | 47 | SRCS= 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 Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 50 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 51 | .c.o: |
| 52 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< |
| 53 | |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 54 | pngtest: pngtest.o libpng.a |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 55 | ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \ |
| 56 | -lpng ${LDADD} |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 57 | |
| 58 | CLEANFILES= pngtest pngtest.o pngout.png |
| 59 | |
| 60 | test: pngtest |
| 61 | ./pngtest |
| 62 | |
Matt Sarett | 9b1fe63 | 2015-11-25 10:21:17 -0500 | [diff] [blame] | 63 | pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) |
| 64 | cp $(PNGLIBCONF_H_PREBUILT) $@ |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 65 | |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 66 | .include <bsd.lib.mk> |