xref: /aosp_15_r20/external/libpng/scripts/makefile.msys (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1*a67afe4dSAndroid Build Coastguard Worker# makefile for libpng using MSYS/gcc (shared, static library)
2*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2000, 2019-2024 Cosmin Truta
3*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
4*a67afe4dSAndroid Build Coastguard Worker#
5*a67afe4dSAndroid Build Coastguard Worker# Portions taken from makefile.linux and makefile.gcc:
6*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 2000 Cosmin Truta
7*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
8*a67afe4dSAndroid Build Coastguard Worker# Glenn Randers-Pehrson
9*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 1996, 1997 Andreas Dilger
10*a67afe4dSAndroid Build Coastguard Worker# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
11*a67afe4dSAndroid Build Coastguard Worker#
12*a67afe4dSAndroid Build Coastguard Worker# This code is released under the libpng license.
13*a67afe4dSAndroid Build Coastguard Worker# For conditions of distribution and use, see the disclaimer
14*a67afe4dSAndroid Build Coastguard Worker# and license in png.h
15*a67afe4dSAndroid Build Coastguard Worker
16*a67afe4dSAndroid Build Coastguard Worker# Library name:
17*a67afe4dSAndroid Build Coastguard WorkerLIBNAME=libpng16
18*a67afe4dSAndroid Build Coastguard WorkerPNGMAJ=16
19*a67afe4dSAndroid Build Coastguard Worker
20*a67afe4dSAndroid Build Coastguard Worker# Shared library names:
21*a67afe4dSAndroid Build Coastguard WorkerLIBSO=$(LIBNAME).dll
22*a67afe4dSAndroid Build Coastguard WorkerLIBSOMAJ=$(LIBNAME).dll.$(PNGMAJ)
23*a67afe4dSAndroid Build Coastguard Worker
24*a67afe4dSAndroid Build Coastguard Worker# Where the zlib library and include files are located.
25*a67afe4dSAndroid Build Coastguard Worker#ZLIBLIB=../zlib
26*a67afe4dSAndroid Build Coastguard Worker#ZLIBINC=../zlib
27*a67afe4dSAndroid Build Coastguard WorkerZLIBLIB=/usr/local/lib
28*a67afe4dSAndroid Build Coastguard WorkerZLIBINC=/usr/local/include
29*a67afe4dSAndroid Build Coastguard Worker
30*a67afe4dSAndroid Build Coastguard Worker# Compiler, linker, lib and other tools
31*a67afe4dSAndroid Build Coastguard WorkerCC = gcc
32*a67afe4dSAndroid Build Coastguard WorkerLD = $(CC)
33*a67afe4dSAndroid Build Coastguard WorkerAR = ar
34*a67afe4dSAndroid Build Coastguard WorkerRANLIB = ranlib
35*a67afe4dSAndroid Build Coastguard WorkerCP = cp
36*a67afe4dSAndroid Build Coastguard WorkerRM_F = rm -rf
37*a67afe4dSAndroid Build Coastguard WorkerLN_SF = ln -sf
38*a67afe4dSAndroid Build Coastguard Worker
39*a67afe4dSAndroid Build Coastguard WorkerCPPFLAGS = # -DPNG_DEBUG=5
40*a67afe4dSAndroid Build Coastguard WorkerCFLAGS = -O2 -Wall -Wextra -Wundef # -g
41*a67afe4dSAndroid Build Coastguard WorkerARFLAGS = rc
42*a67afe4dSAndroid Build Coastguard WorkerLDFLAGS = # -g
43*a67afe4dSAndroid Build Coastguard WorkerLIBS = -lz -lm
44*a67afe4dSAndroid Build Coastguard Worker
45*a67afe4dSAndroid Build Coastguard Worker# File extensions
46*a67afe4dSAndroid Build Coastguard WorkerEXEEXT = .exe
47*a67afe4dSAndroid Build Coastguard Worker
48*a67afe4dSAndroid Build Coastguard Worker# Pre-built configuration
49*a67afe4dSAndroid Build Coastguard Worker# See scripts/pnglibconf.mak for more options
50*a67afe4dSAndroid Build Coastguard WorkerPNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
51*a67afe4dSAndroid Build Coastguard Worker
52*a67afe4dSAndroid Build Coastguard Worker# File lists
53*a67afe4dSAndroid Build Coastguard WorkerOBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
54*a67afe4dSAndroid Build Coastguard Worker       pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
55*a67afe4dSAndroid Build Coastguard Worker       pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
56*a67afe4dSAndroid Build Coastguard Worker
57*a67afe4dSAndroid Build Coastguard Worker# Targets
58*a67afe4dSAndroid Build Coastguard Workerall: static shared
59*a67afe4dSAndroid Build Coastguard Worker
60*a67afe4dSAndroid Build Coastguard Workerpnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
61*a67afe4dSAndroid Build Coastguard Worker	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
62*a67afe4dSAndroid Build Coastguard Worker
63*a67afe4dSAndroid Build Coastguard Worker.c.o:
64*a67afe4dSAndroid Build Coastguard Worker	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
65*a67afe4dSAndroid Build Coastguard Worker
66*a67afe4dSAndroid Build Coastguard Workerstatic: libpng.a pngtest$(EXEEXT)
67*a67afe4dSAndroid Build Coastguard Worker
68*a67afe4dSAndroid Build Coastguard Workershared: $(LIBSOMAJ)
69*a67afe4dSAndroid Build Coastguard Worker	$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSO)
70*a67afe4dSAndroid Build Coastguard Worker
71*a67afe4dSAndroid Build Coastguard Worker$(LIBSO): $(LIBSOMAJ)
72*a67afe4dSAndroid Build Coastguard Worker	$(LN_SF) $(LIBSOMAJ) $(LIBSO)
73*a67afe4dSAndroid Build Coastguard Worker
74*a67afe4dSAndroid Build Coastguard Worker$(LIBSOMAJ):
75*a67afe4dSAndroid Build Coastguard Worker	$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ)
76*a67afe4dSAndroid Build Coastguard Worker
77*a67afe4dSAndroid Build Coastguard Workerlibpng.a: $(OBJS)
78*a67afe4dSAndroid Build Coastguard Worker	$(AR) $(ARFLAGS) $@ $(OBJS)
79*a67afe4dSAndroid Build Coastguard Worker	$(RANLIB) $@
80*a67afe4dSAndroid Build Coastguard Worker
81*a67afe4dSAndroid Build Coastguard Workerinstall:
82*a67afe4dSAndroid Build Coastguard Worker	@echo "The $@ target is no longer supported by this makefile."
83*a67afe4dSAndroid Build Coastguard Worker	@false
84*a67afe4dSAndroid Build Coastguard Worker
85*a67afe4dSAndroid Build Coastguard Workerinstall-static:
86*a67afe4dSAndroid Build Coastguard Worker	@echo "The $@ target is no longer supported by this makefile."
87*a67afe4dSAndroid Build Coastguard Worker	@false
88*a67afe4dSAndroid Build Coastguard Worker
89*a67afe4dSAndroid Build Coastguard Workerinstall-shared:
90*a67afe4dSAndroid Build Coastguard Worker	@echo "The $@ target is no longer supported by this makefile."
91*a67afe4dSAndroid Build Coastguard Worker	@false
92*a67afe4dSAndroid Build Coastguard Worker
93*a67afe4dSAndroid Build Coastguard Workertest: pngtest$(EXEEXT)
94*a67afe4dSAndroid Build Coastguard Worker	./pngtest$(EXEEXT)
95*a67afe4dSAndroid Build Coastguard Worker
96*a67afe4dSAndroid Build Coastguard Workerpngtest$(EXEEXT): pngtest.o libpng.a
97*a67afe4dSAndroid Build Coastguard Worker	$(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
98*a67afe4dSAndroid Build Coastguard Worker
99*a67afe4dSAndroid Build Coastguard Workerclean:
100*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) $(OBJS) libpng.a
101*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) $(LIBSO) $(LIBSOMAJ) pnglibconf.h
102*a67afe4dSAndroid Build Coastguard Worker	$(RM_F) pngtest*.o pngtest$(EXEEXT) pngout.png
103*a67afe4dSAndroid Build Coastguard Worker
104*a67afe4dSAndroid Build Coastguard Workerpng.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105*a67afe4dSAndroid Build Coastguard Workerpngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106*a67afe4dSAndroid Build Coastguard Workerpngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107*a67afe4dSAndroid Build Coastguard Workerpngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108*a67afe4dSAndroid Build Coastguard Workerpngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109*a67afe4dSAndroid Build Coastguard Workerpngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110*a67afe4dSAndroid Build Coastguard Workerpngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111*a67afe4dSAndroid Build Coastguard Workerpngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112*a67afe4dSAndroid Build Coastguard Workerpngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113*a67afe4dSAndroid Build Coastguard Workerpngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114*a67afe4dSAndroid Build Coastguard Workerpngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115*a67afe4dSAndroid Build Coastguard Workerpngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116*a67afe4dSAndroid Build Coastguard Workerpngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117*a67afe4dSAndroid Build Coastguard Workerpngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118*a67afe4dSAndroid Build Coastguard Workerpngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119*a67afe4dSAndroid Build Coastguard Worker
120*a67afe4dSAndroid Build Coastguard Workerpngtest.o:  png.h pngconf.h pnglibconf.h
121