90
103
cat scripts/libpng-config-body.in ) > libpng-config
91
104
chmod +x libpng-config
93
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
94
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
96
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
97
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
99
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
100
$(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
101
-o $(LIBNAME).so.$(PNGVER) \
104
libpng.so.3.$(PNGMIN): $(OBJSDLL)
105
$(CC) -shared -Wl,-soname,libpng.so.3 \
106
-o libpng.so.3.$(PNGMIN) \
109
pngtest: pngtest.o $(LIBNAME).so
106
$(LIBSO): $(LIBSOMAJ)
107
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
109
$(LIBSOMAJ): $(LIBSOVER)
110
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
112
$(LIBSOVER): $(OBJSDLL)
113
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOVER) $(OBJSDLL)
115
$(OLDSOVER): $(OBJSDLL)
116
$(CC) -shared -Wl,-soname,$(OLDSOMAJ) \
120
pngtest: pngtest.o $(LIBSO)
110
121
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
112
123
pngtest-static: pngtest.o libpng.a
125
136
install-headers: png.h pngconf.h
126
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
127
-@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
128
139
cp png.h pngconf.h $(DI)/$(LIBNAME)
129
140
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
130
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
131
-@/bin/rm -f $(DI)/libpng
132
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(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)/* .)
134
145
install-static: install-headers libpng.a
135
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
146
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
136
147
cp libpng.a $(DL)/$(LIBNAME).a
137
148
chmod 644 $(DL)/$(LIBNAME).a
138
-@/bin/rm -f $(DL)/libpng.a
139
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
149
-@$(RM_F) $(DL)/libpng.a
150
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
141
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
142
libpng.so.3.$(PNGMIN)
143
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
144
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
145
-@/bin/rm -f $(DL)/libpng.so
146
-@/bin/rm -f $(DL)/libpng.so.3
147
-@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)*
148
cp $(LIBNAME).so.$(PNGVER) $(DL)
149
cp libpng.so.3.$(PNGMIN) $(DL)
150
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
151
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)
153
ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \
154
ln -sf libpng.so.3 libpng.so; \
155
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
156
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
157
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
158
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
159
-@/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
160
172
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
161
173
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
162
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
174
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
164
176
install-man: libpng.3 libpngpf.3 png.5
165
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
166
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
167
-@/bin/rm -f $(DM)/man3/libpng.3
168
-@/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
169
181
cp libpng.3 $(DM)/man3
170
182
cp libpngpf.3 $(DM)/man3
171
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
172
-@/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
173
185
cp png.5 $(DM)/man5
175
187
install-config: libpng-config
176
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
177
-@/bin/rm -f $(DB)/libpng-config
178
-@/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
179
191
cp libpng-config $(DB)/$(LIBNAME)-config
180
192
chmod 755 $(DB)/$(LIBNAME)-config
181
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
193
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
183
195
install: install-static install-shared install-man install-config
185
197
# If you installed in $(DESTDIR), test-installed won't work until you
186
# 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
-L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
207
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
208
./pngtestd pngtest.png
189
211
$(CC) -I$(ZLIBINC) \
190
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
212
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
191
213
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
192
-o pngtesti `$(BINPATH)/libpng12-config --ldflags`
214
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
193
215
./pngtesti pngtest.png
196
/bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \
197
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \
198
libpng.so.3.$(PNGMIN) \
218
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
219
$(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
201
223
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO