1# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc' 2# Copyright (C) 2020-2024 Cosmin Truta 3# Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson 4# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 5# 6# This code is released under the libpng license. 7# For conditions of distribution and use, see the disclaimer 8# and license in png.h 9 10# Library name: 11LIBNAME=libpng16 12PNGMAJ=16 13 14# Shared library names: 15LIBSO=$(LIBNAME).so 16LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) 17 18# Utilities: 19CC=gcc 20AR=ar 21RANLIB=echo 22LN_SF=ln -sf 23CP=cp 24RM_F=/bin/rm -f 25 26# Where the zlib library and include files are located 27#ZLIBLIB=/usr/local/lib32 28#ZLIBINC=/usr/local/include 29#ZLIBLIB=/usr/local/lib 30#ZLIBINC=/usr/local/include 31ZLIBLIB=../zlib 32ZLIBINC=../zlib 33 34# ABI can be blank to use default for your system, -32, -o32, -n32, or -64 35# See "man abi". zlib must be built with the same ABI. 36ABI= 37 38WARNMORE= 39CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 40CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g 41ARFLAGS=rc 42LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g 43LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \ 44 -set_version sgi$(PNGMAJ).0 45# See "man dso" for info about shared objects 46 47# Pre-built configuration 48# See scripts/pnglibconf.mak for more options 49PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt 50 51OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ 52 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \ 53 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o 54 55.c.o: 56 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< 57 58all: libpng.a pngtest shared 59 60pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) 61 $(CP) $(PNGLIBCONF_H_PREBUILT) $@ 62 63libpng.a: $(OBJS) 64 $(AR) $(ARFLAGS) $@ $(OBJS) 65 $(RANLIB) $@ 66 67shared: $(LIBSOMAJ) 68 69$(LIBSO): $(LIBSOMAJ) 70 $(LN_SF) $(LIBSOMAJ) $(LIBSO) 71 72$(LIBSOMAJ): $(OBJS) 73 $(LDSHARED) -o $@ $(OBJS) 74 $(RM_F) $(LIBSO) $(LIBSOMAJ) 75 76pngtest: pngtest.o libpng.a 77 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) 78 79test: pngtest 80 echo 81 echo Testing local static library. 82 ./pngtest 83 84install: 85 @echo "The $@ target is no longer supported by this makefile." 86 @false 87 88install-static: 89 @echo "The $@ target is no longer supported by this makefile." 90 @false 91 92install-shared: 93 @echo "The $@ target is no longer supported by this makefile." 94 @false 95 96clean: 97 $(RM_F) libpng.a pngtest pngout.png 98 $(RM_F) so_locations $(LIBSO) $(LIBSOMAJ)* pnglibconf.h 99 100# DO NOT DELETE THIS LINE -- make depend depends on it. 101 102png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 103pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 104pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 105pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 106pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 107pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 108pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 109pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 110pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 111pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 112pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 113pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 114pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 115pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 116pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 117 118pngtest.o: png.h pngconf.h pnglibconf.h 119