]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
Merge changes from CUPS trunk, r6739.
[thirdparty/cups.git] / filter / Makefile
1 #
2 # "$Id: Makefile 6696 2007-07-19 23:27:49Z mike $"
3 #
4 # Filter makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007 by Apple Inc.
7 # Copyright 1997-2006 by Easy Software Products.
8 #
9 # These coded instructions, statements, and computer programs are the
10 # property of Apple Inc. and are protected by Federal copyright
11 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 # which should have been included with this file. If this file is
13 # file is missing or damaged, see the license at "http://www.cups.org/".
14 #
15 # This file is subject to the Apple OS-Developed Software exception.
16 #
17
18 include ../Makedefs
19
20
21 FILTERS = gziptoany hpgltops texttops pstops $(IMGFILTERS) \
22 rastertolabel rastertoepson rastertohp
23 TARGETS = $(FILTERS) \
24 $(LIBCUPSIMAGE) \
25 libcupsimage.a \
26 $(LIB32CUPSIMAGE) \
27 $(LIB64CUPSIMAGE) \
28 rasterbench \
29 testimage \
30 testraster
31
32 HPGLOBJS = hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
33 hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
34 IMAGEOBJS = image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
35 image-photocd.o image-pix.o image-png.o image-pnm.o \
36 image-sgi.o image-sgilib.o image-sun.o image-tiff.o \
37 image-zoom.o image.o error.o interpret.o raster.o
38 IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
39 IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
40 FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
41 OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
42 gziptoany.o imagetops.o imagetoraster.o common.o pstops.o \
43 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
44 testimage.o testraster.o textcommon.o texttops.o
45
46
47 #
48 # Make all targets...
49 #
50
51 all: $(TARGETS)
52
53
54 #
55 # Clean all object files...
56 #
57
58 clean:
59 $(RM) $(OBJS) $(TARGETS)
60 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
61 $(RM) -r 32bit 64bit
62
63
64 #
65 # Update dependencies (without system header dependencies...)
66 #
67
68 depend:
69 touch Dependencies.tmp
70 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
71 $(RM) Dependencies
72 cp Dependencies.tmp Dependencies
73 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
74 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
75 $(RM) Dependencies.tmp
76
77
78 #
79 # Install all targets...
80 #
81
82 install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
83 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
84 for file in $(FILTERS); do \
85 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
86 done
87 $(RM) $(SERVERBIN)/filter/rastertodymo
88 $(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
89 $(INSTALL_DIR) -m 755 $(LIBDIR)
90 $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
91 -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
92 $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
93 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
94 fi
95 -if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
96 $(STRIP) -x $(LIBDIR)/$(LIBCUPSIMAGE); \
97 $(RM) $(LIBDIR)/libcupsimage.dylib; \
98 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
99 fi
100 if test "x$(SYMROOT)" != "x"; then \
101 $(INSTALL_DIR) $(SYMROOT); \
102 for file in $(TARGETS); do \
103 cp $$file $(SYMROOT); \
104 done \
105 fi
106
107 installstatic:
108 $(INSTALL_DIR) -m 755 $(LIBDIR)
109 $(INSTALL_LIB) libcupsimage.a $(LIBDIR);
110 $(RANLIB) $(LIBDIR)/libcupsimage.a;
111
112 installhdrs:
113 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
114 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
115 $(INSTALL_DATA) raster.h $(INCLUDEDIR)/cups
116
117 install32bit:
118 $(INSTALL_DIR) -m 755 $(LIB32DIR)
119 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
120 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
121
122 install64bit:
123 $(INSTALL_DIR) -m 755 $(LIB64DIR)
124 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
125 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
126
127
128 #
129 # Uninstall all targets...
130 #
131
132 uninstall: $(UNINSTALL32) $(UNINSTALL64)
133 for file in $(FILTERS); do \
134 $(RM) $(SERVERBIN)/filter/$$file; \
135 done
136 $(RM) $(SERVERBIN)/filter/rastertodymo
137 -$(RMDIR) $(SERVERBIN)/filter
138 -$(RMDIR) $(SERVERBIN)
139 $(RM) $(LIBDIR)/libcupsimage.2.dylib
140 $(RM) $(LIBDIR)/libcupsimage.a
141 $(RM) $(LIBDIR)/libcupsimage.dylib
142 $(RM) $(LIBDIR)/libcupsimage_s.a
143 $(RM) $(LIBDIR)/libcupsimage.sl
144 $(RM) $(LIBDIR)/libcupsimage.sl.2
145 $(RM) $(LIBDIR)/libcupsimage.so
146 $(RM) $(LIBDIR)/libcupsimage.so.2
147 -$(RMDIR) $(LIBDIR)
148 $(RM) $(INCLUDEDIR)/cups/image.h
149 $(RM) $(INCLUDEDIR)/cups/raster.h
150 -$(RMDIR) $(INCLUDEDIR)/cups
151
152 uninstall32bit:
153 $(RM) $(LIB32DIR)/libcupsimage.so
154 $(RM) $(LIB32DIR)/libcupsimage.so.2
155 -$(RMDIR) $(LIB32DIR)
156
157 uninstall64bit:
158 $(RM) $(LIB64DIR)/libcupsimage.so
159 $(RM) $(LIB64DIR)/libcupsimage.so.2
160 -$(RMDIR) $(LIB64DIR)
161
162
163 #
164 # Automatic API help files...
165 #
166
167 apihelp:
168 echo Generating CUPS API help files...
169 mxmldoc --section "Programming" --title "Raster API" \
170 --intro api-raster.shtml \
171 raster.h interpret.c raster.c >../doc/help/api-raster.html
172
173
174 #
175 # formtops
176 #
177
178 formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
179 echo Linking $@...
180 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
181
182
183 #
184 # gziptoany
185 #
186
187 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
188 echo Linking $@...
189 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
190
191
192 #
193 # hpgltops
194 #
195
196 hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
197 echo Linking $@...
198 $(CC) $(LDFLAGS) -o $@ $(HPGLOBJS) common.o $(LIBS) -lm
199
200
201 #
202 # libcupsimage.so.2, libcupsimage.sl.2
203 #
204
205 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
206 echo Linking $@...
207 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
208 -L../cups $(LINKCUPS) -lm
209 $(RM) `basename $@ .2`
210 $(LN) $@ `basename $@ .2`
211
212
213 #
214 # 32bit/libcupsimage.so.2
215 #
216
217 32bit/libcupsimage.so.2: $(IMAGE32OBJS)
218 echo Linking 32-bit $@...
219 -mkdir 32bit
220 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
221 -L../cups/32bit $(LINKCUPS) -lm
222
223
224 #
225 # 64bit/libcupsimage.so.2
226 #
227
228 64bit/libcupsimage.so.2: $(IMAGE64OBJS)
229 echo Linking 64-bit $@...
230 -mkdir 64bit
231 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
232 -L../cups/64bit $(LINKCUPS) -lm
233
234
235 #
236 # libcupsimage.2.dylib
237 #
238
239 libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
240 echo Linking $@...
241 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
242 -install_name $(libdir)/$@ \
243 -current_version 2.3.0 \
244 -compatibility_version 2.0.0 \
245 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
246 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
247 $(RM) libcupsimage.dylib
248 $(LN) $@ libcupsimage.dylib
249
250
251 #
252 # libcupsimage_s.a
253 #
254
255 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
256 echo Linking $@...
257 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
258 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
259 $(RM) $@
260 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
261
262
263 #
264 # libcupsimage.la
265 #
266
267 libcupsimage.la: $(IMAGEOBJS)
268 echo Linking $@...
269 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
270 -L../cups $(LINKCUPS) \
271 -rpath $(LIBDIR) -version-info 2:3
272
273
274 #
275 # libcupsimage.a
276 #
277
278 libcupsimage.a: $(IMAGEOBJS)
279 echo Archiving $@...
280 $(RM) $@
281 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
282 $(RANLIB) $@
283
284
285 #
286 # testimage
287 #
288
289 testimage: testimage.o libcupsimage.a ../Makedefs
290 echo Linking $@...
291 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
292 $(IMGLIBS) $(DSOLIBS) $(LIBS)
293
294
295 #
296 # imagetops
297 #
298
299 imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
300 ../cups/$(LIBCUPS)
301 echo Linking $@...
302 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
303 $(IMGLIBS) $(LIBS)
304
305
306 #
307 # imagetoraster
308 #
309
310 imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
311 ../cups/$(LIBCUPS)
312 echo Linking $@...
313 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
314 $(IMGLIBS) $(LIBS)
315
316
317 #
318 # pstops
319 #
320
321 pstops: pstops.o common.o ../cups/$(LIBCUPS)
322 echo Linking $@...
323 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
324
325
326 #
327 # rastertolabel
328 #
329
330 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
331 echo Linking $@...
332 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
333
334
335 #
336 # rastertoepson
337 #
338
339 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
340 echo Linking $@...
341 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
342
343
344 #
345 # rastertohp
346 #
347
348 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
349 echo Linking $@...
350 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
351
352
353 #
354 # testraster
355 #
356
357 testraster: testraster.o ../cups/libcups.a libcupsimage.a
358 echo Linking $@...
359 $(CC) $(LDFLAGS) -o $@ testraster.o libcupsimage.a ../cups/libcups.a \
360 $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) $(SSLLIBS) $(LIBGSSAPI)
361
362
363 #
364 # rasterbench
365 #
366
367 rasterbench: rasterbench.o libcupsimage.a
368 echo Linking $@...
369 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
370
371
372 #
373 # texttops
374 #
375
376 texttops: texttops.o textcommon.o common.o \
377 ../cups/$(LIBCUPS)
378 echo Linking $@...
379 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
380
381
382 #
383 # Dependencies...
384 #
385
386 include Dependencies
387
388
389 #
390 # End of "$Id: Makefile 6696 2007-07-19 23:27:49Z mike $".
391 #