1 # makefile for libpng on Solaris 2.x with gcc
2 # Copyright (C) 2020-2022 Cosmin Truta
3 # Copyright (C) 2004, 2006-2008, 2010-2014 Glenn Randers-Pehrson
4 # Contributed by William L. Sebok, based on makefile.linux
5 # Copyright (C) 1998 Greg Roelofs
6 # Copyright (C) 1996, 1997 Andreas Dilger
8 # This code is released under the libpng license.
9 # For conditions of distribution and use, see the disclaimer
10 # and license in png.h
16 # Shared library names:
18 LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
29 # Where the zlib library and include files are located
30 # Changing these to ../zlib poses a security risk. If you want
31 # to have zlib in an adjacent directory, specify the full path instead of "..".
35 ZLIBLIB=/usr/local/lib
36 ZLIBINC=/usr/local/include
38 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
39 -Wmissing-declarations -Wtraditional -Wcast-align \
40 -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
41 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
42 CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g
43 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
45 # Pre-built configuration
46 # See scripts/pnglibconf.mak for more options
47 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
49 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
50 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
51 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
53 OBJSDLL = $(OBJS:.o=.pic.o)
55 .SUFFIXES: .c .o .pic.o
58 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
61 $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
63 all: libpng.a $(LIBSO) pngtest
65 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
66 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
73 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
75 $(LIBSOMAJ): $(OBJSDLL)
76 @case "`type ld`" in *ucb*) \
79 echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
80 echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
81 echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
82 echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
83 echo '## at all. If it is, things are likely to break because of'; \
84 echo '## the libucb dependency that is created.'; \
88 $(LD) -G -h $(LIBSOMAJ) \
89 -o $(LIBSOMAJ) $(OBJSDLL)
91 pngtest: pngtest.o $(LIBSO)
92 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
98 @echo "The $@ target is no longer supported by this makefile."
102 @echo "The $@ target is no longer supported by this makefile."
106 @echo "The $@ target is no longer supported by this makefile."
110 $(RM_F) *.o libpng.a pngtest pngout.png
111 $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
113 # DO NOT DELETE THIS LINE -- make depend depends on it.
115 png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117 pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118 pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119 pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
120 pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
121 pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
122 pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
123 pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
124 pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
125 pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
126 pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
127 pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
128 pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
129 pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
131 pngtest.o: png.h pngconf.h pnglibconf.h