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