xref: /aosp_15_r20/external/libpng/scripts/makefile.freebsd (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1*a67afe4dSAndroid Build Coastguard Worker# makefile for libpng under FreeBSD
2*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2020-2022 Cosmin Truta
3*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
4*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
5*a67afe4dSAndroid Build Coastguard Worker#
6*a67afe4dSAndroid Build Coastguard Worker# This code is released under the libpng license.
7*a67afe4dSAndroid Build Coastguard Worker# For conditions of distribution and use, see the disclaimer
8*a67afe4dSAndroid Build Coastguard Worker# and license in png.h
9*a67afe4dSAndroid Build Coastguard Worker
10*a67afe4dSAndroid Build Coastguard WorkerLIB=		png
11*a67afe4dSAndroid Build Coastguard WorkerSHLIB_VER=	16
12*a67afe4dSAndroid Build Coastguard WorkerSHLIB_MAJOR=	${SHLIB_VER}
13*a67afe4dSAndroid Build Coastguard WorkerSHLIB_MINOR=	0
14*a67afe4dSAndroid Build Coastguard Worker
15*a67afe4dSAndroid Build Coastguard WorkerZLIBLIB=	/usr/lib
16*a67afe4dSAndroid Build Coastguard WorkerZLIBINC=	/usr/include
17*a67afe4dSAndroid Build Coastguard Worker
18*a67afe4dSAndroid Build Coastguard WorkerLDADD+=		-lm -lz
19*a67afe4dSAndroid Build Coastguard Worker#LDADD+=	-lm -lz -lssp_nonshared   # for OSVERSION < 800000 ?
20*a67afe4dSAndroid Build Coastguard Worker
21*a67afe4dSAndroid Build Coastguard WorkerDPADD+=		${LIBM} ${LIBZ}
22*a67afe4dSAndroid Build Coastguard Worker
23*a67afe4dSAndroid Build Coastguard WorkerCPPFLAGS+=	-I. -I${ZLIBINC}
24*a67afe4dSAndroid Build Coastguard WorkerCFLAGS+=	-Wall -Wextra -Wundef
25*a67afe4dSAndroid Build Coastguard WorkerLDFLAGS+=	-L. -L${ZLIBLIB}
26*a67afe4dSAndroid Build Coastguard Worker
27*a67afe4dSAndroid Build Coastguard WorkerCLEANFILES+=	pngtest pngtest.o pngout.png
28*a67afe4dSAndroid Build Coastguard Worker
29*a67afe4dSAndroid Build Coastguard Worker# Pre-built configuration
30*a67afe4dSAndroid Build Coastguard Worker# See scripts/pnglibconf.mak for more options
31*a67afe4dSAndroid Build Coastguard WorkerPNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
32*a67afe4dSAndroid Build Coastguard Worker
33*a67afe4dSAndroid Build Coastguard WorkerSRCS=	png.c pngerror.c pngget.c pngmem.c pngpread.c \
34*a67afe4dSAndroid Build Coastguard Worker	pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
35*a67afe4dSAndroid Build Coastguard Worker	pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
36*a67afe4dSAndroid Build Coastguard Worker
37*a67afe4dSAndroid Build Coastguard Worker.c.o:
38*a67afe4dSAndroid Build Coastguard Worker	${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
39*a67afe4dSAndroid Build Coastguard Worker
40*a67afe4dSAndroid Build Coastguard Workerpnglibconf.h:	${PNGLIBCONF_H_PREBUILT}
41*a67afe4dSAndroid Build Coastguard Worker	cp ${PNGLIBCONF_H_PREBUILT} $@
42*a67afe4dSAndroid Build Coastguard Worker
43*a67afe4dSAndroid Build Coastguard Workerpngtest:	pngtest.o libpng.a
44*a67afe4dSAndroid Build Coastguard Worker	${CC} ${LDFLAGS} -static -o pngtest pngtest.o -lpng ${LDADD}
45*a67afe4dSAndroid Build Coastguard Worker
46*a67afe4dSAndroid Build Coastguard Workertest:	pngtest
47*a67afe4dSAndroid Build Coastguard Worker	./pngtest
48*a67afe4dSAndroid Build Coastguard Worker
49*a67afe4dSAndroid Build Coastguard Workerinstall:
50*a67afe4dSAndroid Build Coastguard Worker	@echo "The $@ target is no longer supported by this makefile."
51*a67afe4dSAndroid Build Coastguard Worker	@false
52*a67afe4dSAndroid Build Coastguard Worker
53*a67afe4dSAndroid Build Coastguard Worker.include <bsd.lib.mk>
54