Debian Codegraph @

compat/libpng/scripts/makefile.solaris

raw
1 # makefile for libpng on Solaris 2.x with gcc
2 # Copyright (C) 2018-2025 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=ar
23 RANLIB=echo
24 LN_SF=ln -f -s
25 CP=cp
26 RM_F=/bin/rm -f
27
28 # Where the zlib library and include files are located
29 # Changing these to ../zlib poses a security risk. If you want
30 # to have zlib in an adjacent directory, specify the full path instead of "..".
31 #ZLIBLIB=../zlib
32 #ZLIBINC=../zlib
33
34 ZLIBLIB=/usr/local/lib
35 ZLIBINC=/usr/local/include
36
37 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
38 CFLAGS=-O # -g
39 ARFLAGS=rc
40 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
41
42 # Pre-built configuration
43 # See scripts/pnglibconf.mak for more options
44 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
45
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
49
50 OBJSDLL = $(OBJS:.o=.pic.o)
51
52 .SUFFIXES: .c .o .pic.o
53
54 .c.o:
55 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
56
57 .c.pic.o:
58 $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
59
60 all: libpng.a $(LIBSO) pngtest
61
62 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
63 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
64
65 libpng.a: $(OBJS)
66 $(AR) $(ARFLAGS) $@ $(OBJS)
67 $(RANLIB) $@
68
69 $(LIBSO): $(LIBSOMAJ)
70 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
71
72 $(LIBSOMAJ): $(OBJSDLL)
73 @case "`type ld`" in *ucb*) \
74 echo; \
75 echo '## WARNING:'; \
76 echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
77 echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
78 echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
79 echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
80 echo '## at all. If it is, things are likely to break because of'; \
81 echo '## the libucb dependency that is created.'; \
82 echo; \
83 ;; \
84 esac
85 $(LD) -G -h $(LIBSOMAJ) \
86 -o $(LIBSOMAJ) $(OBJSDLL)
87
88 pngtest: pngtest.o $(LIBSO)
89 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
90
91 test: pngtest
92 ./pngtest
93
94 install:
95 @echo "The $@ target is no longer supported by this makefile."
96 @false
97
98 install-static:
99 @echo "The $@ target is no longer supported by this makefile."
100 @false
101
102 install-shared:
103 @echo "The $@ target is no longer supported by this makefile."
104 @false
105
106 clean:
107 $(RM_F) *.o libpng.a pngtest pngout.png
108 $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
109
110 # DO NOT DELETE THIS LINE -- make depend depends on it.
111
112 png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113 pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114 pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115 pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117 pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118 pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119 pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
120 pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
121 pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
122 pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
123 pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
124 pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
125 pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
126 pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
127
128 pngtest.o: png.h pngconf.h pnglibconf.h