xref: /aosp_15_r20/external/libpng/scripts/makefile.clang (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1*a67afe4dSAndroid Build Coastguard Worker# makefile for libpng using clang (generic, static library)
2*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta
3*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2008, 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# Location of the zlib library and include files
11*a67afe4dSAndroid Build Coastguard WorkerZLIBINC = ../zlib
12*a67afe4dSAndroid Build Coastguard WorkerZLIBLIB = ../zlib
13*a67afe4dSAndroid Build Coastguard Worker
14*a67afe4dSAndroid Build Coastguard Worker# Compiler, linker, lib and other tools
15*a67afe4dSAndroid Build Coastguard WorkerCC = clang
16*a67afe4dSAndroid Build Coastguard WorkerLD = $(CC)
17*a67afe4dSAndroid Build Coastguard WorkerAR = ar
18*a67afe4dSAndroid Build Coastguard WorkerRANLIB = ranlib
19*a67afe4dSAndroid Build Coastguard WorkerCP = cp
20*a67afe4dSAndroid Build Coastguard WorkerRM_F = rm -f
21*a67afe4dSAndroid Build Coastguard Worker
22*a67afe4dSAndroid Build Coastguard Worker# Compiler and linker flags
23*a67afe4dSAndroid Build Coastguard WorkerNOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
24*a67afe4dSAndroid Build Coastguard Worker	-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
25*a67afe4dSAndroid Build Coastguard WorkerWARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
26*a67afe4dSAndroid Build Coastguard Worker	-Wmissing-declarations -Wtraditional -Wcast-align \
27*a67afe4dSAndroid Build Coastguard Worker	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
28*a67afe4dSAndroid Build Coastguard WorkerDEFS = $(NOHWOPT)
29*a67afe4dSAndroid Build Coastguard WorkerCPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
30*a67afe4dSAndroid Build Coastguard WorkerCFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -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# File extensions
36*a67afe4dSAndroid Build Coastguard WorkerEXEEXT =
37*a67afe4dSAndroid Build Coastguard Worker
38*a67afe4dSAndroid Build Coastguard Worker# Pre-built configuration
39*a67afe4dSAndroid Build Coastguard Worker# See scripts/pnglibconf.mak for more options
40*a67afe4dSAndroid Build Coastguard WorkerPNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
41*a67afe4dSAndroid Build Coastguard Worker
42*a67afe4dSAndroid Build Coastguard Worker# File lists
43*a67afe4dSAndroid Build Coastguard WorkerOBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
44*a67afe4dSAndroid Build Coastguard Worker       pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
45*a67afe4dSAndroid Build Coastguard Worker       pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
46*a67afe4dSAndroid Build Coastguard Worker
47*a67afe4dSAndroid Build Coastguard Worker# Targets
48*a67afe4dSAndroid Build Coastguard Workerall: static
49*a67afe4dSAndroid Build Coastguard Worker
50*a67afe4dSAndroid Build Coastguard Workerpnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
51*a67afe4dSAndroid Build Coastguard Worker	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
52*a67afe4dSAndroid Build Coastguard Worker
53*a67afe4dSAndroid Build Coastguard Worker.c.o:
54*a67afe4dSAndroid Build Coastguard Worker	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
55*a67afe4dSAndroid Build Coastguard Worker
56*a67afe4dSAndroid Build Coastguard Workerstatic: libpng.a pngtest$(EXEEXT)
57*a67afe4dSAndroid Build Coastguard Worker
58*a67afe4dSAndroid Build Coastguard Workershared:
59*a67afe4dSAndroid Build Coastguard Worker	@echo This is a generic makefile that cannot create shared libraries.
60*a67afe4dSAndroid Build Coastguard Worker	@echo Please use a configuration that is specific to your platform.
61*a67afe4dSAndroid Build Coastguard Worker	@false
62*a67afe4dSAndroid Build Coastguard Worker
63*a67afe4dSAndroid Build Coastguard Workerlibpng.a: $(OBJS)
64*a67afe4dSAndroid Build Coastguard Worker	$(AR) $(ARFLAGS) $@ $(OBJS)
65*a67afe4dSAndroid Build Coastguard Worker	$(RANLIB) $@
66*a67afe4dSAndroid Build Coastguard Worker
67*a67afe4dSAndroid Build Coastguard Workertest: pngtest$(EXEEXT)
68*a67afe4dSAndroid Build Coastguard Worker	./pngtest$(EXEEXT)
69*a67afe4dSAndroid Build Coastguard Worker
70*a67afe4dSAndroid Build Coastguard Workerpngtest$(EXEEXT): pngtest.o libpng.a
71*a67afe4dSAndroid Build Coastguard Worker	$(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
72*a67afe4dSAndroid Build Coastguard Worker
73*a67afe4dSAndroid Build Coastguard Workerclean:
74*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
75*a67afe4dSAndroid Build Coastguard Worker
76*a67afe4dSAndroid Build Coastguard Workerpng.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
77*a67afe4dSAndroid Build Coastguard Workerpngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78*a67afe4dSAndroid Build Coastguard Workerpngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
79*a67afe4dSAndroid Build Coastguard Workerpngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
80*a67afe4dSAndroid Build Coastguard Workerpngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
81*a67afe4dSAndroid Build Coastguard Workerpngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
82*a67afe4dSAndroid Build Coastguard Workerpngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
83*a67afe4dSAndroid Build Coastguard Workerpngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
84*a67afe4dSAndroid Build Coastguard Workerpngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
85*a67afe4dSAndroid Build Coastguard Workerpngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
86*a67afe4dSAndroid Build Coastguard Workerpngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
87*a67afe4dSAndroid Build Coastguard Workerpngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
88*a67afe4dSAndroid Build Coastguard Workerpngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
89*a67afe4dSAndroid Build Coastguard Workerpngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
90*a67afe4dSAndroid Build Coastguard Workerpngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
91*a67afe4dSAndroid Build Coastguard Worker
92*a67afe4dSAndroid Build Coastguard Workerpngtest.o:  png.h pngconf.h pnglibconf.h
93