xref: /aosp_15_r20/external/libpng/scripts/makefile.std (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1*a67afe4dSAndroid Build Coastguard Worker# makefile for libpng
2*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2020-2024 Cosmin Truta
3*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
4*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
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 Worker# Where the zlib library and include files are located
11*a67afe4dSAndroid Build Coastguard Worker#ZLIBLIB=/usr/local/lib
12*a67afe4dSAndroid Build Coastguard Worker#ZLIBINC=/usr/local/include
13*a67afe4dSAndroid Build Coastguard WorkerZLIBLIB=../zlib
14*a67afe4dSAndroid Build Coastguard WorkerZLIBINC=../zlib
15*a67afe4dSAndroid Build Coastguard Worker
16*a67afe4dSAndroid Build Coastguard WorkerCC = cc
17*a67afe4dSAndroid Build Coastguard WorkerCPP = $(CC) -E
18*a67afe4dSAndroid Build Coastguard WorkerLD = $(CC)
19*a67afe4dSAndroid Build Coastguard WorkerAR = ar
20*a67afe4dSAndroid Build Coastguard WorkerRANLIB = ranlib
21*a67afe4dSAndroid Build Coastguard WorkerMV_F = mv -f
22*a67afe4dSAndroid Build Coastguard WorkerRM_F = rm -f
23*a67afe4dSAndroid Build Coastguard WorkerAWK = awk
24*a67afe4dSAndroid Build Coastguard Worker
25*a67afe4dSAndroid Build Coastguard WorkerNOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
26*a67afe4dSAndroid Build Coastguard Worker	-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
27*a67afe4dSAndroid Build Coastguard WorkerDFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build
28*a67afe4dSAndroid Build Coastguard WorkerDFA_EXTRA = # extra files that can be used to control configuration
29*a67afe4dSAndroid Build Coastguard WorkerCPPFLAGS = -I$(ZLIBINC) $(NOHWOPT) # -DPNG_DEBUG=5
30*a67afe4dSAndroid Build Coastguard WorkerCFLAGS = -O # -g
31*a67afe4dSAndroid Build Coastguard WorkerARFLAGS = rc
32*a67afe4dSAndroid Build Coastguard WorkerLDFLAGS = -L$(ZLIBLIB) # -g
33*a67afe4dSAndroid Build Coastguard WorkerLIBS = -lz -lm
34*a67afe4dSAndroid Build Coastguard Worker
35*a67afe4dSAndroid Build Coastguard Worker# Pre-built configuration
36*a67afe4dSAndroid Build Coastguard Worker# See scripts/pnglibconf.mak for more options
37*a67afe4dSAndroid Build Coastguard WorkerPNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
38*a67afe4dSAndroid Build Coastguard Worker
39*a67afe4dSAndroid Build Coastguard WorkerOBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
40*a67afe4dSAndroid Build Coastguard Worker       pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
41*a67afe4dSAndroid Build Coastguard Worker       pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
42*a67afe4dSAndroid Build Coastguard Worker
43*a67afe4dSAndroid Build Coastguard Worker.c.o:
44*a67afe4dSAndroid Build Coastguard Worker	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
45*a67afe4dSAndroid Build Coastguard Worker
46*a67afe4dSAndroid Build Coastguard Workerall: libpng.a pngtest
47*a67afe4dSAndroid Build Coastguard Worker
48*a67afe4dSAndroid Build Coastguard Worker# The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt,
49*a67afe4dSAndroid Build Coastguard Worker# copy this if the following doesn't work.
50*a67afe4dSAndroid Build Coastguard Workerpnglibconf.h: pnglibconf.dfn
51*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) $@ pnglibconf.c pnglibconf.out pnglibconf.tmp
52*a67afe4dSAndroid Build Coastguard Worker	echo '#include "pnglibconf.dfn"' >pnglibconf.c
53*a67afe4dSAndroid Build Coastguard Worker	@echo "## If '$(CC) -E' fails, try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
54*a67afe4dSAndroid Build Coastguard Worker	$(CPP) $(DFNFLAGS) pnglibconf.c >pnglibconf.out
55*a67afe4dSAndroid Build Coastguard Worker	$(AWK) -f scripts/dfn.awk out=pnglibconf.tmp pnglibconf.out >&2
56*a67afe4dSAndroid Build Coastguard Worker	$(MV_F) pnglibconf.tmp $@
57*a67afe4dSAndroid Build Coastguard Worker
58*a67afe4dSAndroid Build Coastguard Workerpnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
59*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) $@ pnglibconf.pre pnglibconf.tmp
60*a67afe4dSAndroid Build Coastguard Worker	@echo "## Calling $(AWK) from scripts/pnglibconf.mak" >&2
61*a67afe4dSAndroid Build Coastguard Worker	@echo "## If 'awk' fails, try a better awk (e.g. AWK='nawk')" >&2
62*a67afe4dSAndroid Build Coastguard Worker	$(AWK) -f scripts/options.awk out=pnglibconf.pre\
63*a67afe4dSAndroid Build Coastguard Worker	    version=search pngconf.h scripts/pnglibconf.dfa\
64*a67afe4dSAndroid Build Coastguard Worker	    pngusr.dfa $(DFA_XTRA) >&2
65*a67afe4dSAndroid Build Coastguard Worker	$(AWK) -f scripts/options.awk out=pnglibconf.tmp pnglibconf.pre >&2
66*a67afe4dSAndroid Build Coastguard Worker	$(MV_F) pnglibconf.tmp $@
67*a67afe4dSAndroid Build Coastguard Worker
68*a67afe4dSAndroid Build Coastguard Workerlibpng.a: $(OBJS)
69*a67afe4dSAndroid Build Coastguard Worker	$(AR) $(ARFLAGS) $@ $(OBJS)
70*a67afe4dSAndroid Build Coastguard Worker	$(RANLIB) $@
71*a67afe4dSAndroid Build Coastguard Worker
72*a67afe4dSAndroid Build Coastguard Workerpngtest: pngtest.o libpng.a
73*a67afe4dSAndroid Build Coastguard Worker	$(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
74*a67afe4dSAndroid Build Coastguard Worker
75*a67afe4dSAndroid Build Coastguard Workertest: pngtest
76*a67afe4dSAndroid Build Coastguard Worker	./pngtest
77*a67afe4dSAndroid Build Coastguard Worker
78*a67afe4dSAndroid Build Coastguard Workerinstall:
79*a67afe4dSAndroid Build Coastguard Worker	@echo "The $@ target is no longer supported by this makefile."
80*a67afe4dSAndroid Build Coastguard Worker	@false
81*a67afe4dSAndroid Build Coastguard Worker
82*a67afe4dSAndroid Build Coastguard Workerclean:
83*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
84*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) pnglibconf.c pnglibconf.dfn pnglibconf.out pnglibconf.pre
85*a67afe4dSAndroid Build Coastguard Worker
86*a67afe4dSAndroid Build Coastguard Worker# DO NOT DELETE THIS LINE -- make depend depends on it.
87*a67afe4dSAndroid Build Coastguard Worker
88*a67afe4dSAndroid Build Coastguard Workerpng.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
89*a67afe4dSAndroid Build Coastguard Workerpngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
90*a67afe4dSAndroid Build Coastguard Workerpngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
91*a67afe4dSAndroid Build Coastguard Workerpngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
92*a67afe4dSAndroid Build Coastguard Workerpngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
93*a67afe4dSAndroid Build Coastguard Workerpngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
94*a67afe4dSAndroid Build Coastguard Workerpngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
95*a67afe4dSAndroid Build Coastguard Workerpngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
96*a67afe4dSAndroid Build Coastguard Workerpngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
97*a67afe4dSAndroid Build Coastguard Workerpngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
98*a67afe4dSAndroid Build Coastguard Workerpngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
99*a67afe4dSAndroid Build Coastguard Workerpngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
100*a67afe4dSAndroid Build Coastguard Workerpngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
101*a67afe4dSAndroid Build Coastguard Workerpngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
102*a67afe4dSAndroid Build Coastguard Workerpngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
103*a67afe4dSAndroid Build Coastguard Worker
104*a67afe4dSAndroid Build Coastguard Workerpngtest.o:  png.h pngconf.h pnglibconf.h
105