xref: /aosp_15_r20/external/libpng/scripts/makefile.freebsd (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1# makefile for libpng under FreeBSD
2# Copyright (C) 2020-2022 Cosmin Truta
3# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
4# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
5#
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
9
10LIB=		png
11SHLIB_VER=	16
12SHLIB_MAJOR=	${SHLIB_VER}
13SHLIB_MINOR=	0
14
15ZLIBLIB=	/usr/lib
16ZLIBINC=	/usr/include
17
18LDADD+=		-lm -lz
19#LDADD+=	-lm -lz -lssp_nonshared   # for OSVERSION < 800000 ?
20
21DPADD+=		${LIBM} ${LIBZ}
22
23CPPFLAGS+=	-I. -I${ZLIBINC}
24CFLAGS+=	-Wall -Wextra -Wundef
25LDFLAGS+=	-L. -L${ZLIBLIB}
26
27CLEANFILES+=	pngtest pngtest.o pngout.png
28
29# Pre-built configuration
30# See scripts/pnglibconf.mak for more options
31PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
32
33SRCS=	png.c pngerror.c pngget.c pngmem.c pngpread.c \
34	pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
35	pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
36
37.c.o:
38	${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
39
40pnglibconf.h:	${PNGLIBCONF_H_PREBUILT}
41	cp ${PNGLIBCONF_H_PREBUILT} $@
42
43pngtest:	pngtest.o libpng.a
44	${CC} ${LDFLAGS} -static -o pngtest pngtest.o -lpng ${LDADD}
45
46test:	pngtest
47	./pngtest
48
49install:
50	@echo "The $@ target is no longer supported by this makefile."
51	@false
52
53.include <bsd.lib.mk>
54