Imported Upstream version 1.6.39
[platform/upstream/libpng.git] / scripts / makefile.so9
1 # makefile for libpng on Solaris 9 (beta) with Forte cc
2 # Updated by Chad Schrock for Solaris 9
3 # Contributed by William L. Sebok, based on makefile.linux
4 # Copyright (C) 2020-2022 Cosmin Truta
5 # Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
6 # Copyright (C) 1998-2001 Greg Roelofs
7 # Copyright (C) 1996-1997 Andreas Dilger
8 #
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
12
13 # Library name:
14 LIBNAME=libpng16
15 PNGMAJ=16
16
17 # Shared library names:
18 LIBSO=$(LIBNAME).so
19 LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
20
21 # Utilities:
22 # gcc 2.95 doesn't work.
23 CC=cc
24 AR_RC=ar rc
25 RANLIB=echo
26 MKDIR_P=mkdir -p
27 LN_SF=ln -f -s
28 CP=cp
29 RM_F=/bin/rm -f
30
31 # Where the zlib library and include files are located
32 # Changing these to ../zlib poses a security risk.  If you want
33 # to have zlib in an adjacent directory, specify the full path instead of "..".
34 #ZLIBLIB=../zlib
35 #ZLIBINC=../zlib
36 #ZLIBLIB=/usr/local/lib
37 #ZLIBINC=/usr/local/include
38 #Use the preinstalled zlib that comes with Solaris 9:
39 ZLIBLIB=/usr/lib
40 ZLIBINC=/usr/include
41
42 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
43 CFLAGS=-O3
44 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
45
46 # Pre-built configuration
47 # See scripts/pnglibconf.mak for more options
48 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
49
50 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
51        pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
52        pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
53
54 OBJSDLL = $(OBJS:.o=.pic.o)
55
56 .SUFFIXES:      .c .o .pic.o
57
58 .c.o:
59         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
60
61 .c.pic.o:
62         $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
63
64 all: libpng.a $(LIBSO) pngtest
65
66 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
67         $(CP) $(PNGLIBCONF_H_PREBUILT) $@
68
69 libpng.a: $(OBJS)
70         $(AR_RC) $@ $(OBJS)
71         $(RANLIB) $@
72
73 $(LIBSO): $(LIBSOMAJ)
74         $(LN_SF) $(LIBSOMAJ) $(LIBSO)
75
76 $(LIBSOMAJ): $(OBJSDLL)
77         @case "`type ld`" in *ucb*) \
78         echo; \
79         echo '## WARNING:'; \
80         echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
81         echo '## and /usr/ucb/ld.  If they do, you need to adjust your PATH'; \
82         echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
83         echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
84         echo '## at all.  If it is, things are likely to break because of'; \
85         echo '## the libucb dependency that is created.'; \
86         echo; \
87         ;; \
88         esac
89         $(LD) -G -h $(LIBSOMAJ) \
90          -o $(LIBSOMAJ) $(OBJSDLL)
91
92 pngtest: pngtest.o $(LIBSO)
93         $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
94
95 test: pngtest
96         ./pngtest
97
98 install:
99         @echo "The $@ target is no longer supported by this makefile."
100         @false
101
102 install-static:
103         @echo "The $@ target is no longer supported by this makefile."
104         @false
105
106 install-shared:
107         @echo "The $@ target is no longer supported by this makefile."
108         @false
109
110 clean:
111         $(RM_F) *.o libpng.a pngtest pngout.png
112         $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
113
114 # DO NOT DELETE THIS LINE -- make depend depends on it.
115
116 png.o      png.pic.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117 pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118 pngget.o   pngget.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119 pngmem.o   pngmem.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
120 pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
121 pngread.o  pngread.pic.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
122 pngrio.o   pngrio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
123 pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
124 pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
125 pngset.o   pngset.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
126 pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
127 pngwio.o   pngwio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
128 pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
129 pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
130 pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
131
132 pngtest.o: png.h pngconf.h pnglibconf.h