16
16
# SHAREDLIB=libz.sl
22
PNGVER = $(PNGMAJ).$(PNGMIN)
24
# Shared library names:
26
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
27
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
30
OLDSOVER=libpng.sl.3.$(PNGMIN)
19
CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
20
# Caution: be sure you have built zlib with the same CFLAGS.
21
CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
22
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
28
PNGVER = $(PNGMAJ).$(PNGMIN)
31
40
# where make install puts libpng.a, libpng12.sl, and png.h
33
43
INCPATH=$(prefix)/include
44
LIBPATH=$(exec_prefix)/lib
35
45
MANPATH=$(prefix)/man
46
BINPATH=$(exec_prefix)/bin
48
CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
49
# Caution: be sure you have built zlib with the same CFLAGS.
50
CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
51
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
38
53
# override DESTDIR= on the make install command line to easily support
39
54
# installing into a temporary location. Example:
103
118
install-headers: png.h pngconf.h
104
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
105
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
119
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
120
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
106
121
cp png.h pngconf.h $(DI)/$(LIBNAME)
107
122
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
108
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
109
-@/bin/rm -f $(DI)/libpng
110
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
123
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
124
-@$(RM_F) $(DI)/libpng
125
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
112
127
install-static: install-headers libpng.a
113
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
128
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
114
129
cp libpng.a $(DL)/$(LIBNAME).a
115
130
chmod 644 $(DL)/$(LIBNAME).a
116
-@/bin/rm -f $(DL)/libpng.a
117
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
131
-@$(RM_F) $(DL)/libpng.a
132
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
119
install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc \
120
libpng.sl.3.$(PNGMIN)
121
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
122
-@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGVER)* $(DL)/$(LIBNAME).sl
123
-@/bin/rm -f $(DL)/libpng.sl
124
-@/bin/rm -f $(DL)/libpng.sl.3
125
-@/bin/rm -f $(DL)/libpng.sl.3.$(PNGMIN)*
126
cp $(LIBNAME).sl.$(PNGVER) $(DL)
127
cp libpng.sl.3.$(PNGMIN) $(DL)
128
chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER)
129
chmod 755 $(DL)/libpng.sl.3.$(PNGMIN)
134
install-shared: install-headers $(LIBSOVER) libpng.pc \
136
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
137
-@$(RM_F) $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
138
-@$(RM_F) $(DL)/$(LIBSOMAJ)
139
-@$(RM_F) $(DL)/$(OLDSO)
140
-@$(RM_F) $(DL)/$(OLDSOMAJ)
141
-@$(RM_F) $(DL)/$(OLDSOVER)*
144
chmod 755 $(DL)/$(LIBSOVER)
145
chmod 755 $(DL)/$(OLDSOVER)
131
ln -sf libpng.sl.3.$(PNGMIN) libpng.sl.3; \
132
ln -sf libpng.sl.3 libpng.sl; \
133
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
134
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
135
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
136
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
137
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
147
$(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
148
$(LN_SF) $(OLDSOMAJ) $(OLDSO); \
149
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
150
$(LN_SF) $(LIBSOMAJ) $(LIBSO))
151
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
152
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
153
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
138
154
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
139
155
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
140
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
156
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
142
158
install-man: libpng.3 libpngpf.3 png.5
143
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
144
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
145
-@/bin/rm -f $(DM)/man3/libpng.3
146
-@/bin/rm -f $(DM)/man3/libpngpf.3
159
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
160
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
161
-@$(RM_F) $(DM)/man3/libpng.3
162
-@$(RM_F) $(DM)/man3/libpngpf.3
147
163
cp libpng.3 $(DM)/man3
148
164
cp libpngpf.3 $(DM)/man3
149
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
150
-@/bin/rm -f $(DM)/man5/png.5
165
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
166
-@$(RM_F) $(DM)/man5/png.5
151
167
cp png.5 $(DM)/man5
153
169
install-config: libpng-config
154
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
155
-@/bin/rm -f $(DB)/libpng-config
156
-@/bin/rm -f $(DB)/$(LIBNAME)-config
170
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
171
-@$(RM_F) $(DB)/libpng-config
172
-@$(RM_F) $(DB)/$(LIBNAME)-config
157
173
cp libpng-config $(DB)/$(LIBNAME)-config
158
174
chmod 755 $(DB)/$(LIBNAME)-config
159
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
175
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
161
177
install: install-static install-shared install-man install-config
163
179
# If you installed in $(DESTDIR), test-installed won't work until you
164
# move the library to its final location.
180
# move the library to its final location. Use test-dd to test it
185
echo Testing installed dynamic shared library in $(DL).
186
$(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \
187
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
188
-L$(DL) -L$(ZLIBLIB) \
189
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
190
./pngtestd pngtest.png
168
194
echo Testing installed dynamic shared library.
169
195
$(CC) $(CCFLAGS) \
170
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
196
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
172
-o pngtesti `$(BINPATH)/libpng12-config --ldflags`
198
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
173
199
./pngtesti pngtest.png
176
/bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \
177
libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \
178
libpng.sl.3.$(PNGMIN) \
202
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
203
libpng-config $(LIBSO) $(LIBSOMAJ)* \
181
207
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO