1 # makefile for libpng using MSYS/gcc (shared, static library)
2 # Copyright (C) 2019-2022 Cosmin Truta
3 # Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
5 # Portions taken from makefile.linux and makefile.gcc:
6 # Copyright (C) 2000 Cosmin Truta
7 # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
8 # Glenn Randers-Pehrson
9 # Copyright (C) 1996, 1997 Andreas Dilger
10 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
12 # This code is released under the libpng license.
13 # For conditions of distribution and use, see the disclaimer
14 # and license in png.h
20 # Shared library names:
22 LIBSOMAJ=$(LIBNAME).dll.$(PNGMAJ)
24 # Where the zlib library and include files are located.
27 ZLIBLIB=/usr/local/lib
28 ZLIBINC=/usr/local/include
30 # Compiler, linker, lib and other tools
40 CPPFLAGS = # -DPNG_DEBUG=5
41 CFLAGS = -O2 -Wall -Wextra -Wundef # -g
48 # Pre-built configuration
49 # See scripts/pnglibconf.mak for more options
50 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
53 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
54 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
55 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
60 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
61 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
64 $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
66 static: libpng.a pngtest$(EXEEXT)
69 $(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSO)
72 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
75 $(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ)
82 @echo "The $@ target is no longer supported by this makefile."
86 @echo "The $@ target is no longer supported by this makefile."
90 @echo "The $@ target is no longer supported by this makefile."
93 test: pngtest$(EXEEXT)
96 pngtest$(EXEEXT): pngtest.o libpng.a
97 $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
100 $(RM_F) $(OBJS) libpng.a
101 $(RM_F) $(LIBSO) $(LIBSOMAJ) pnglibconf.h
102 $(RM_F) pngtest*.o pngtest$(EXEEXT) pngout.png
104 png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105 pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106 pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107 pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108 pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109 pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110 pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111 pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112 pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113 pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114 pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115 pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117 pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118 pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
120 pngtest.o: png.h pngconf.h pnglibconf.h