1
1
# makefile for libpng on Solaris 9 (beta) with Forte cc
2
2
# Updated by Chad Schrock for Solaris 9
3
3
# Contributed by William L. Sebok, based on makefile.linux
4
# Copyright (C) 2002 Glenn Randers-Pehrson
4
# Copyright (C) 2002, 2006 Glenn Randers-Pehrson
5
5
# Copyright (C) 1998-2001 Greg Roelofs
6
6
# Copyright (C) 1996-1997 Andreas Dilger
7
7
# For conditions of distribution and use, see copyright notice in png.h
12
PNGVER = $(PNGMAJ).$(PNGMIN)
15
# Shared library names:
17
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
18
LIBSOVER=$(LIBNAME).so.$(PNGVER)
21
OLDSOVER=libpng.so.3.$(PNGMIN)
9
24
# gcc 2.95 doesn't work.
12
# Where make install puts libpng.a, libpng.so*, and png.h
32
# Where make install puts libpng.a, $(OLDSO)*, and png.h
15
36
# Where the zlib library and include files are located
16
37
# Changing these to ../zlib poses a security risk. If you want
110
$(LD) -G -h $(LIBNAME).so.$(PNGMAJ) \
111
-o $(LIBNAME).so.$(PNGVER) $(OBJSDLL)
113
libpng.so.3.$(PNGMIN): $(OBJS)
114
$(LD) -G -h libpng.so.3 \
115
-o libpng.so.3.$(PNGMIN) $(OBJSDLL)
117
pngtest: pngtest.o $(LIBNAME).so
123
$(LD) -G -h $(LIBSOMAJ) \
124
-o $(LIBSOVER) $(OBJSDLL)
127
$(LD) -G -h $(OLDSOMAJ) \
128
-o $(OLDSOVER) $(OBJSDLL)
130
pngtest: pngtest.o $(LIBSO)
118
131
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
123
136
install-headers: png.h pngconf.h
124
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
125
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
137
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
138
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
126
139
cp png.h pngconf.h $(DI)/$(LIBNAME)
127
140
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
128
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
129
-@/bin/rm -f $(DI)/libpng
130
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
141
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
142
-@$(RM_F) $(DI)/libpng
143
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
132
145
install-static: install-headers libpng.a
133
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
146
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
134
147
cp libpng.a $(DL)/$(LIBNAME).a
135
148
chmod 644 $(DL)/$(LIBNAME).a
136
-@/bin/rm -f $(DL)/libpng.a
137
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
149
-@$(RM_F) $(DL)/libpng.a
150
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
139
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
140
libpng.so.3.$(PNGMIN)
141
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
142
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
143
-@/bin/rm -f $(DL)/libpng.so
144
-@/bin/rm -f $(DL)/libpng.so.3
145
-@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)*
146
cp $(LIBNAME).so.$(PNGVER) $(DL)
147
cp libpng.so.3.$(PNGMIN) $(DL)
148
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
149
chmod 755 $(DL)/libpng.so.3.$(PNGMIN)
152
install-shared: install-headers $(LIBSOVER) libpng.pc \
154
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
155
-@$(RM_F) $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
156
-@$(RM_F) $(DL)/$(LIBSOMAJ)
157
-@$(RM_F) $(DL)/$(OLDSO)
158
-@$(RM_F) $(DL)/$(OLDSOMAJ)
159
-@$(RM_F) $(DL)/$(OLDSOVER)*
162
chmod 755 $(DL)/$(LIBSOVER)
163
chmod 755 $(DL)/$(OLDSOVER)
151
ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \
152
ln -f -s libpng.so.3 libpng.so; \
153
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
154
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
155
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
156
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
157
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
165
$(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
166
$(LN_SF) $(OLDSOMAJ) $(OLDSO); \
167
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
168
$(LN_SF) $(LIBSOMAJ) $(LIBSO))
169
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
170
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
171
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
158
172
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
159
173
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
160
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
174
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
162
176
install-man: libpng.3 libpngpf.3 png.5
163
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
164
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
165
-@/bin/rm -f $(DM)/man3/libpng.3
166
-@/bin/rm -f $(DM)/man3/libpngpf.3
177
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
178
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
179
-@$(RM_F) $(DM)/man3/libpng.3
180
-@$(RM_F) $(DM)/man3/libpngpf.3
167
181
cp libpng.3 $(DM)/man3
168
182
cp libpngpf.3 $(DM)/man3
169
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
170
-@/bin/rm -f $(DM)/man5/png.5
183
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
184
-@$(RM_F) $(DM)/man5/png.5
171
185
cp png.5 $(DM)/man5
173
187
install-config: libpng-config
174
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
175
-@/bin/rm -f $(DB)/libpng-config
176
-@/bin/rm -f $(DB)/$(LIBNAME)-config
188
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
189
-@$(RM_F) $(DB)/libpng-config
190
-@$(RM_F) $(DB)/$(LIBNAME)-config
177
191
cp libpng-config $(DB)/$(LIBNAME)-config
178
192
chmod 755 $(DB)/$(LIBNAME)-config
179
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
193
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
181
195
install: install-static install-shared install-man install-config
183
197
# If you installed in $(DESTDIR), test-installed won't work until you
184
# move the library to its final location.
198
# move the library to its final location. Use test-dd to test it
203
echo Testing installed dynamic shared library in $(DL).
204
$(CC) -I$(DI) -I$(ZLIBINC) \
205
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
206
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
207
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
208
./pngtestd pngtest.png
188
212
echo Testing installed dynamic shared library.
189
213
$(CC) -I$(ZLIBINC) \
190
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
191
-o pngtesti `$(BINPATH)/libpng12-config --ldflags` \
214
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
215
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
192
216
-L$(ZLIBLIB) -R$(ZLIBLIB)
193
217
./pngtesti pngtest.png
196
/bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \
197
libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
198
libpng.so.3.$(PNGMIN) \
220
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
221
libpng-config $(LIBSO) $(LIBSOMAJ)* \
201
225
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO