1 # makefile for libpng on Darwin / macOS
2 # Copyright (C) 2020-2022 Cosmin Truta
3 # Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
4 # Copyright (C) 2001 Christoph Pfisterer
5 # derived from makefile.linux:
6 # Copyright (C) 1998, 1999 Greg Roelofs
7 # Copyright (C) 1996, 1997 Andreas Dilger
9 # This code is released under the libpng license.
10 # For conditions of distribution and use, see the disclaimer
11 # and license in png.h
13 # Where the zlib library and include files are located
21 # Shared library names:
22 LIBSO=$(LIBNAME).dylib
23 LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
34 NOHWOPT=-DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
35 -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
37 CPPFLAGS=-I$(ZLIBINC) $(DEFS)
38 CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef
39 LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
41 # Pre-built configuration
42 # See scripts/pnglibconf.mak for more options
43 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
46 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
47 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
48 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
50 OBJSDLL = $(OBJS:.o=.pic.o)
52 .SUFFIXES: .c .o .pic.o
55 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
58 $(CC) -c $(CPPFLAGS) $(CFLAGS) -fno-common -o $@ $*.c
60 all: libpng.a $(LIBSO) pngtest
62 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
63 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
70 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
72 $(LIBSOMAJ): $(OBJSDLL)
74 -current_version 16 -compatibility_version 16 \
76 $(OBJSDLL) -L$(ZLIBLIB) -lz
78 pngtest: pngtest.o $(LIBSO)
79 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
85 @echo "The $@ target is no longer supported by this makefile."
89 @echo "The $@ target is no longer supported by this makefile."
93 @echo "The $@ target is no longer supported by this makefile."
97 $(RM_F) *.o libpng.a pngtest pngout.png
98 $(RM_F) $(LIBNAME).*dylib pnglibconf.h
100 # DO NOT DELETE THIS LINE -- make depend depends on it.
102 png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
103 pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
104 pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105 pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106 pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107 pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108 pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109 pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110 pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111 pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112 pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113 pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114 pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115 pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118 pngtest.o: png.h pngconf.h pnglibconf.h