0
|
1 |
# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc'
|
|
2 |
# Copyright (C) 2001-2002, 2006, 2007 Glenn Randers-Pehrson
|
|
3 |
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
4 |
|
|
5 |
# This code is released under the libpng license.
|
|
6 |
# For conditions of distribution and use, see the disclaimer
|
|
7 |
# and license in png.h
|
|
8 |
|
|
9 |
# Library name:
|
|
10 |
LIBNAME=libpng12
|
|
11 |
PNGMAJ = 0
|
|
12 |
PNGMIN = 1.2.40
|
|
13 |
PNGVER = $(PNGMAJ).$(PNGMIN)
|
|
14 |
|
|
15 |
# Shared library names:
|
|
16 |
LIBSO=$(LIBNAME).so
|
|
17 |
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
|
18 |
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
|
19 |
OLDSO=libpng.so
|
|
20 |
OLDSOMAJ=libpng.so.3
|
|
21 |
OLDSOVER=libpng.so.3.$(PNGMIN)
|
|
22 |
|
|
23 |
# Utilities:
|
|
24 |
AR_RC=ar rc
|
|
25 |
CC=cc
|
|
26 |
MKDIR_P=mkdir -p
|
|
27 |
LN_SF=ln -sf
|
|
28 |
RANLIB=echo
|
|
29 |
RM_F=/bin/rm -f
|
|
30 |
|
|
31 |
# Where make install puts libpng.a, libpng12.so, and libpng12/png.h
|
|
32 |
# Prefix must be a full pathname.
|
|
33 |
|
|
34 |
prefix=/usr/local
|
|
35 |
exec_prefix=$(prefix)
|
|
36 |
|
|
37 |
# Where the zlib library and include files are located
|
|
38 |
#ZLIBLIB=/usr/local/lib32
|
|
39 |
#ZLIBINC=/usr/local/include
|
|
40 |
#ZLIBLIB=/usr/local/lib
|
|
41 |
#ZLIBINC=/usr/local/include
|
|
42 |
ZLIBLIB=../zlib
|
|
43 |
ZLIBINC=../zlib
|
|
44 |
|
|
45 |
# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
|
|
46 |
# See "man abi". zlib must be built with the same ABI.
|
|
47 |
ABI=
|
|
48 |
|
|
49 |
WARNMORE=-fullwarn
|
|
50 |
# Note: -KPIC is the default anyhow
|
|
51 |
#CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC -DPNG_NO_MMX_CODE # -g -DPNG_DEBUG=5
|
|
52 |
CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_NO_MMX_CODE
|
|
53 |
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
|
54 |
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
|
55 |
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
|
|
56 |
-set_version sgi$(PNGMAJ).0
|
|
57 |
LDLEGACY=cc $(ABI) -shared -soname $(OLDSOMAJ) \
|
|
58 |
-set_version sgi$3.0
|
|
59 |
# See "man dso" for info about shared objects
|
|
60 |
|
|
61 |
INCPATH=$(prefix)/include
|
|
62 |
LIBPATH=$(exec_prefix)/lib
|
|
63 |
#LIBPATH=$(exec_prefix)/lib32
|
|
64 |
MANPATH=$(prefix)/man
|
|
65 |
BINPATH=$(exec_prefix)/bin
|
|
66 |
|
|
67 |
# override DESTDIR= on the make install command line to easily support
|
|
68 |
# installing into a temporary location. Example:
|
|
69 |
#
|
|
70 |
# make install DESTDIR=/tmp/build/libpng
|
|
71 |
#
|
|
72 |
# If you're going to install into a temporary location
|
|
73 |
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
|
74 |
# you execute make install.
|
|
75 |
DESTDIR=
|
|
76 |
|
|
77 |
DB=$(DESTDIR)$(BINPATH)
|
|
78 |
DI=$(DESTDIR)$(INCPATH)
|
|
79 |
DL=$(DESTDIR)$(LIBPATH)
|
|
80 |
DM=$(DESTDIR)$(MANPATH)
|
|
81 |
|
|
82 |
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|
83 |
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
|
84 |
pngwtran.o pngmem.o pngerror.o pngpread.o
|
|
85 |
|
|
86 |
all: libpng.a pngtest shared libpng.pc libpng-config
|
|
87 |
|
|
88 |
libpng.a: $(OBJS)
|
|
89 |
$(AR_RC) $@ $(OBJS)
|
|
90 |
$(RANLIB) $@
|
|
91 |
|
|
92 |
shared: $(LIBSOVER)
|
|
93 |
|
|
94 |
libpng.pc:
|
|
95 |
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
|
|
96 |
-e s!@exec_prefix@!$(exec_prefix)! \
|
|
97 |
-e s!@libdir@!$(LIBPATH)! \
|
|
98 |
-e s!@includedir@!$(INCPATH)! \
|
|
99 |
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
|
100 |
|
|
101 |
libpng-config:
|
|
102 |
( cat scripts/libpng-config-head.in; \
|
|
103 |
echo prefix=\"$(prefix)\"; \
|
|
104 |
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
|
105 |
echo cppflags=\"-DPNG_NO_MMX_CODE\"; \
|
|
106 |
echo ccopts=\"$(ABI)\"; \
|
|
107 |
echo ldopts=\"$(ABI)\"; \
|
|
108 |
echo L_opts=\"-L$(LIBPATH)\"; \
|
|
109 |
echo libdir=\"$(LIBPATH)\"; \
|
|
110 |
echo libs=\"-lpng12 -lz -lm\"; \
|
|
111 |
cat scripts/libpng-config-body.in ) > libpng-config
|
|
112 |
chmod +x libpng-config
|
|
113 |
|
|
114 |
$(LIBSO): $(LIBSOMAJ)
|
|
115 |
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
|
|
116 |
|
|
117 |
$(LIBSOMAJ): $(LIBSOVER)
|
|
118 |
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
|
|
119 |
|
|
120 |
$(LIBSOVER): $(OBJS)
|
|
121 |
$(LDSHARED) -o $@ $(OBJS)
|
|
122 |
$(RM_F) $(LIBSO) $(LIBSOMAJ)
|
|
123 |
|
|
124 |
$(OLDSOVER): $(OBJS)
|
|
125 |
$(LDLEGACY) -o $@ $(OBJS)
|
|
126 |
|
|
127 |
pngtest: pngtest.o libpng.a
|
|
128 |
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
|
129 |
|
|
130 |
test: pngtest
|
|
131 |
echo
|
|
132 |
echo Testing local static library.
|
|
133 |
./pngtest
|
|
134 |
|
|
135 |
install-headers: png.h pngconf.h
|
|
136 |
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
|
|
137 |
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
|
|
138 |
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
|
139 |
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
|
140 |
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
|
|
141 |
-@$(RM_F) $(DI)/libpng
|
|
142 |
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
|
|
143 |
|
|
144 |
install-static: install-headers libpng.a
|
|
145 |
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
|
146 |
cp libpng.a $(DL)/$(LIBNAME).a
|
|
147 |
chmod 644 $(DL)/$(LIBNAME).a
|
|
148 |
-@$(RM_F) $(DL)/libpng.a
|
|
149 |
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
|
|
150 |
|
|
151 |
install-shared: install-headers $(LIBSOVER) libpng.pc \
|
|
152 |
$(OLDSOVER)
|
|
153 |
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
|
154 |
-@$(RM_F) $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
|
|
155 |
-@$(RM_F) $(DL)/$(LIBSOMAJ)
|
|
156 |
-@$(RM_F) $(DL)/$(OLDSO)
|
|
157 |
-@$(RM_F) $(DL)/$(OLDSOMAJ)
|
|
158 |
-@$(RM_F) $(DL)/$(OLDSOVER)*
|
|
159 |
cp $(LIBSOVER) $(DL)
|
|
160 |
cp $(OLDSOVER) $(DL)
|
|
161 |
chmod 755 $(DL)/$(LIBSOVER)
|
|
162 |
chmod 755 $(DL)/$(OLDSOVER)
|
|
163 |
(cd $(DL); \
|
|
164 |
$(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
|
|
165 |
$(LN_SF) $(OLDSOMAJ) $(OLDSO); \
|
|
166 |
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
|
|
167 |
$(LN_SF) $(LIBSOMAJ) $(LIBSO))
|
|
168 |
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
|
|
169 |
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
|
|
170 |
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
|
|
171 |
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
|
172 |
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
|
173 |
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
|
|
174 |
|
|
175 |
install-man: libpng.3 libpngpf.3 png.5
|
|
176 |
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
|
|
177 |
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
|
|
178 |
-@$(RM_F) $(DM)/man3/libpng.3
|
|
179 |
-@$(RM_F) $(DM)/man3/libpngpf.3
|
|
180 |
cp libpng.3 $(DM)/man3
|
|
181 |
cp libpngpf.3 $(DM)/man3
|
|
182 |
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
|
|
183 |
-@$(RM_F) $(DM)/man5/png.5
|
|
184 |
cp png.5 $(DM)/man5
|
|
185 |
|
|
186 |
install-config: libpng-config
|
|
187 |
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
|
|
188 |
-@$(RM_F) $(DB)/libpng-config
|
|
189 |
-@$(RM_F) $(DB)/$(LIBNAME)-config
|
|
190 |
cp libpng-config $(DB)/$(LIBNAME)-config
|
|
191 |
chmod 755 $(DB)/$(LIBNAME)-config
|
|
192 |
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
|
|
193 |
|
|
194 |
install: install-static install-shared install-man install-config
|
|
195 |
|
|
196 |
# If you installed in $(DESTDIR), test-installed won't work until you
|
|
197 |
# move the library to its final location. Use test-dd to test it
|
|
198 |
# before then.
|
|
199 |
|
|
200 |
test-dd:
|
|
201 |
echo
|
|
202 |
echo Testing installed dynamic shared library in $(DL).
|
|
203 |
$(CC) -I$(DI) -I$(ZLIBINC) \
|
|
204 |
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
|
205 |
-L$(DL) -L$(ZLIBLIB) \
|
|
206 |
-rpath $(ZLIBLIB):$(DL) \
|
|
207 |
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
|
208 |
./pngtestd pngtest.png
|
|
209 |
|
|
210 |
test-installed:
|
|
211 |
echo
|
|
212 |
echo Testing installed dynamic shared library.
|
|
213 |
$(CC) -I$(ZLIBINC) \
|
|
214 |
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
|
215 |
-L$(ZLIBLIB) \
|
|
216 |
-rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
|
|
217 |
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
|
218 |
./pngtesti pngtest.png
|
|
219 |
|
|
220 |
clean:
|
|
221 |
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
|
|
222 |
$(LIBSO) $(LIBSOMAJ)* \
|
|
223 |
$(OLDSOVER) \
|
|
224 |
so_locations
|
|
225 |
|
|
226 |
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
|
227 |
writelock:
|
|
228 |
chmod a-w *.[ch35] $(DOCS) scripts/*
|
|
229 |
|
|
230 |
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
231 |
|
|
232 |
png.o: png.h pngconf.h
|
|
233 |
pngerror.o: png.h pngconf.h
|
|
234 |
pngrio.o: png.h pngconf.h
|
|
235 |
pngwio.o: png.h pngconf.h
|
|
236 |
pngmem.o: png.h pngconf.h
|
|
237 |
pngset.o: png.h pngconf.h
|
|
238 |
pngget.o: png.h pngconf.h
|
|
239 |
pngread.o: png.h pngconf.h
|
|
240 |
pngrtran.o: png.h pngconf.h
|
|
241 |
pngrutil.o: png.h pngconf.h
|
|
242 |
pngtrans.o: png.h pngconf.h
|
|
243 |
pngwrite.o: png.h pngconf.h
|
|
244 |
pngwtran.o: png.h pngconf.h
|
|
245 |
pngwutil.o: png.h pngconf.h
|
|
246 |
pngpread.o: png.h pngconf.h
|
|
247 |
|
|
248 |
pngtest.o: png.h pngconf.h
|