1 # makefile for libpng using gcc (generic, static library)
2 # Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
3 # Copyright (C) 2008, 2014 Glenn Randers-Pehrson
4 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
6 # This code is released under the libpng license.
7 # For conditions of distribution and use, see the disclaimer
10 # Location of the zlib library and include files
14 # Compiler, linker, lib and other tools
22 # Compiler and linker flags
23 NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
24 -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
25 WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
26 -Wmissing-declarations -Wtraditional -Wcast-align \
27 -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
29 CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
30 CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
31 LDFLAGS = -L$(ZLIBLIB) # -g
37 # Pre-built configuration
38 # See scripts/pnglibconf.mak for more options
39 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
42 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
43 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
44 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
49 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
50 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
53 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
55 static: libpng.a pngtest$(EXEEXT)
58 @echo This is a generic makefile that cannot create shared libraries.
59 @echo Please use a configuration that is specific to your platform.
66 test: pngtest$(EXEEXT)
69 pngtest$(EXEEXT): pngtest.o libpng.a
70 $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
73 $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
75 png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
76 pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
77 pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78 pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
79 pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
80 pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
81 pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
82 pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
83 pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
84 pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
85 pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
86 pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
87 pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
88 pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
89 pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
91 pngtest.o: png.h pngconf.h pnglibconf.h