]>
Commit | Line | Data |
---|---|---|
0272a10d VZ |
1 | # makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product. |
2 | # Copyright (C) 1999-2002, 2006 Glenn Randers-Pehrson | |
3 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42 | |
4 | # contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard | |
5 | # For conditions of distribution and use, see copyright notice in png.h | |
6 | ||
7 | # Where the zlib library and include files are located | |
8 | ZLIBLIB=/opt/zlib/lib | |
9 | ZLIBINC=/opt/zlib/include | |
10 | ||
11 | # Note that if you plan to build a libpng shared library, zlib must also | |
12 | # be a shared library, which zlib's configure does not do. After running | |
13 | # zlib's configure, edit the appropriate lines of makefile to read: | |
14 | # CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \ | |
15 | # LDSHARED=ld -b | |
16 | # SHAREDLIB=libz.sl | |
17 | ||
18 | # Library name: | |
19 | LIBNAME = libpng12 | |
20 | PNGMAJ = 0 | |
21 | PNGMIN = 1.2.20 | |
22 | PNGVER = $(PNGMAJ).$(PNGMIN) | |
23 | ||
24 | # Shared library names: | |
25 | LIBSO=$(LIBNAME).sl | |
26 | LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) | |
27 | LIBSOVER=$(LIBNAME).sl.$(PNGVER) | |
28 | OLDSO=libpng.sl | |
29 | OLDSOMAJ=libpng.sl.3 | |
30 | OLDSOVER=libpng.sl.3.$(PNGMIN) | |
31 | ||
32 | # Utilities: | |
33 | AR_RC=ar rc | |
34 | CC=cc | |
35 | MKDIR_P=mkdir -p | |
36 | LN_SF=ln -sf | |
37 | RANLIB=ranlib | |
38 | RM_F=/bin/rm -f | |
39 | ||
40 | # where make install puts libpng.a, libpng12.sl, and png.h | |
41 | prefix=/opt/libpng | |
42 | exec_prefix=$(prefix) | |
43 | INCPATH=$(prefix)/include | |
44 | LIBPATH=$(exec_prefix)/lib | |
45 | MANPATH=$(prefix)/man | |
46 | BINPATH=$(exec_prefix)/bin | |
47 | ||
48 | CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -DPNG_NO_MMX_CODE | |
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 | |
52 | ||
53 | # override DESTDIR= on the make install command line to easily support | |
54 | # installing into a temporary location. Example: | |
55 | # | |
56 | # make install DESTDIR=/tmp/build/libpng | |
57 | # | |
58 | # If you're going to install into a temporary location | |
59 | # via DESTDIR, $(DESTDIR)$(prefix) must already exist before | |
60 | # you execute make install. | |
61 | DESTDIR= | |
62 | ||
63 | DB=$(DESTDIR)$(BINPATH) | |
64 | DI=$(DESTDIR)$(INCPATH) | |
65 | DL=$(DESTDIR)$(LIBPATH) | |
66 | DM=$(DESTDIR)$(MANPATH) | |
67 | ||
68 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ | |
69 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ | |
70 | pngwtran.o pngmem.o pngerror.o pngpread.o | |
71 | ||
72 | OBJSDLL = $(OBJS:.o=.pic.o) | |
73 | ||
74 | .SUFFIXES: .c .o .pic.o | |
75 | ||
76 | .c.pic.o: | |
77 | $(CC) -c $(CFLAGS) +z -o $@ $*.c | |
78 | ||
79 | all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config | |
80 | ||
81 | libpng.a: $(OBJS) | |
82 | $(AR_RC) $@ $(OBJS) | |
83 | $(RANLIB) $@ | |
84 | ||
85 | libpng.pc: | |
86 | cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc | |
87 | ||
88 | libpng-config: | |
89 | ( cat scripts/libpng-config-head.in; \ | |
90 | echo prefix=\"$(prefix)\"; \ | |
91 | echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ | |
92 | echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \ | |
93 | echo L_opts=\"-L$(LIBPATH)\"; \ | |
94 | echo libs=\"-lpng12 -lz -lm\"; \ | |
95 | cat scripts/libpng-config-body.in ) > libpng-config | |
96 | chmod +x libpng-config | |
97 | ||
98 | $(LIBSO): $(LIBSOMAJ) | |
99 | $(LN_SF) $(LIBSOMAJ) $(LIBSO) | |
100 | ||
101 | $(LIBSOMAJ): $(LIBSOVER) | |
102 | $(LN_SF) $(LIBSOVER) $(LIBSOMAJ) | |
103 | ||
104 | $(LIBSOVER): $(OBJSDLL) | |
105 | $(LD) -b +s \ | |
106 | +h $(LIBSOMAJ) -o $(LIBSOVER) $(OBJSDLL) | |
107 | ||
108 | $(OLDSOVER): $(OBJSDLL) | |
109 | $(LD) -b +s \ | |
110 | +h $(OLDSOMAJ) -o $(OLDSOVER) $(OBJSDLL) | |
111 | ||
112 | pngtest: pngtest.o libpng.a | |
113 | $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS) | |
114 | ||
115 | test: pngtest | |
116 | ./pngtest | |
117 | ||
118 | install-headers: png.h pngconf.h | |
119 | -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi | |
120 | -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi | |
121 | cp png.h pngconf.h $(DI)/$(LIBNAME) | |
122 | chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h | |
123 | -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h | |
124 | -@$(RM_F) $(DI)/libpng | |
125 | (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) | |
126 | ||
127 | install-static: install-headers libpng.a | |
128 | -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi | |
129 | cp libpng.a $(DL)/$(LIBNAME).a | |
130 | chmod 644 $(DL)/$(LIBNAME).a | |
131 | -@$(RM_F) $(DL)/libpng.a | |
132 | (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a) | |
133 | ||
134 | install-shared: install-headers $(LIBSOVER) libpng.pc \ | |
135 | $(OLDSOVER) | |
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)* | |
142 | cp $(LIBSOVER) $(DL) | |
143 | cp $(OLDSOVER) $(DL) | |
144 | chmod 755 $(DL)/$(LIBSOVER) | |
145 | chmod 755 $(DL)/$(OLDSOVER) | |
146 | (cd $(DL); \ | |
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 | |
154 | cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc | |
155 | chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc | |
156 | (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc) | |
157 | ||
158 | install-man: libpng.3 libpngpf.3 png.5 | |
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 | |
163 | cp libpng.3 $(DM)/man3 | |
164 | cp libpngpf.3 $(DM)/man3 | |
165 | -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi | |
166 | -@$(RM_F) $(DM)/man5/png.5 | |
167 | cp png.5 $(DM)/man5 | |
168 | ||
169 | install-config: libpng-config | |
170 | -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi | |
171 | -@$(RM_F) $(DB)/libpng-config | |
172 | -@$(RM_F) $(DB)/$(LIBNAME)-config | |
173 | cp libpng-config $(DB)/$(LIBNAME)-config | |
174 | chmod 755 $(DB)/$(LIBNAME)-config | |
175 | (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config) | |
176 | ||
177 | install: install-static install-shared install-man install-config | |
178 | ||
179 | # If you installed in $(DESTDIR), test-installed won't work until you | |
180 | # move the library to its final location. Use test-dd to test it | |
181 | # before then. | |
182 | ||
183 | test-dd: | |
184 | echo | |
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 | |
191 | ||
192 | test-installed: | |
193 | echo | |
194 | echo Testing installed dynamic shared library. | |
195 | $(CC) $(CCFLAGS) \ | |
196 | `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \ | |
197 | -L$(ZLIBLIB) \ | |
198 | -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` | |
199 | ./pngtesti pngtest.png | |
200 | ||
201 | clean: | |
202 | $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ | |
203 | libpng-config $(LIBSO) $(LIBSOMAJ)* \ | |
204 | $(OLDSOVER) \ | |
205 | libpng.pc | |
206 | ||
207 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO | |
208 | writelock: | |
209 | chmod a-w *.[ch35] $(DOCS) scripts/* | |
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 |