]> git.tdb.fi Git - ext/libpng.git/blob - scripts/makefile.solaris
Import libpng 1.6.39
[ext/libpng.git] / scripts / makefile.solaris
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
7 #
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
11
12 # Library name:
13 LIBNAME=libpng16
14 PNGMAJ=16
15
16 # Shared library names:
17 LIBSO=$(LIBNAME).so
18 LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
19
20 # Utilities:
21 CC=gcc
22 AR_RC=ar rc
23 RANLIB=echo
24 MKDIR_P=mkdir -p
25 LN_SF=ln -f -s
26 CP=cp
27 RM_F=/bin/rm -f
28
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 "..".
32 #ZLIBLIB=../zlib
33 #ZLIBINC=../zlib
34
35 ZLIBLIB=/usr/local/lib
36 ZLIBINC=/usr/local/include
37
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
44
45 # Pre-built configuration
46 # See scripts/pnglibconf.mak for more options
47 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
48
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
52
53 OBJSDLL = $(OBJS:.o=.pic.o)
54
55 .SUFFIXES:      .c .o .pic.o
56
57 .c.o:
58         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
59
60 .c.pic.o:
61         $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
62
63 all: libpng.a $(LIBSO) pngtest
64
65 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
66         $(CP) $(PNGLIBCONF_H_PREBUILT) $@
67
68 libpng.a: $(OBJS)
69         $(AR_RC) $@ $(OBJS)
70         $(RANLIB) $@
71
72 $(LIBSO): $(LIBSOMAJ)
73         $(LN_SF) $(LIBSOMAJ) $(LIBSO)
74
75 $(LIBSOMAJ): $(OBJSDLL)
76         @case "`type ld`" in *ucb*) \
77         echo; \
78         echo '## WARNING:'; \
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.'; \
85         echo; \
86         ;; \
87         esac
88         $(LD) -G -h $(LIBSOMAJ) \
89          -o $(LIBSOMAJ) $(OBJSDLL)
90
91 pngtest: pngtest.o $(LIBSO)
92         $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
93
94 test: pngtest
95         ./pngtest
96
97 install:
98         @echo "The $@ target is no longer supported by this makefile."
99         @false
100
101 install-static:
102         @echo "The $@ target is no longer supported by this makefile."
103         @false
104
105 install-shared:
106         @echo "The $@ target is no longer supported by this makefile."
107         @false
108
109 clean:
110         $(RM_F) *.o libpng.a pngtest pngout.png
111         $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
112
113 # DO NOT DELETE THIS LINE -- make depend depends on it.
114
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
130
131 pngtest.o: png.h pngconf.h pnglibconf.h