]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
Merge changes from CUPS 1.4svn-r8115.
[thirdparty/cups.git] / filter / Makefile
1 #
2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
3 #
4 # Filter makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007-2008 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 = \
22 $(BANNERTOPS) \
23 commandtops \
24 gziptoany \
25 hpgltops \
26 $(TEXTTOPS) \
27 pstops \
28 $(IMGFILTERS) \
29 $(PDFTOPS) \
30 rastertolabel \
31 rastertoepson \
32 rastertohp
33 LIBTARGETS = \
34 $(LIBCUPSIMAGE) \
35 libcupsimage.a \
36 $(LIB32CUPSIMAGE) \
37 $(LIB64CUPSIMAGE)
38 UNITTARGETS = \
39 rasterbench \
40 testimage \
41 testraster
42 TARGETS = \
43 $(LIBTARGETS) \
44 $(FILTERS)
45
46 HPGLOBJS = hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
47 hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
48 IMAGEOBJS = image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
49 image-photocd.o image-pix.o image-png.o image-pnm.o \
50 image-sgi.o image-sgilib.o image-sun.o image-tiff.o \
51 image-zoom.o image.o error.o interpret.o raster.o
52 IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
53 IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
54 FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
55 OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
56 bannertops.o commandtops.o gziptoany.o imagetops.o \
57 imagetoraster.o common.o pdftops.o pstext.o pstops.o \
58 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
59 testimage.o testraster.o textcommon.o texttops.o
60
61
62 #
63 # Make all targets...
64 #
65
66 all: $(TARGETS)
67
68
69 #
70 # Make library targets...
71 #
72
73 libs: $(LIBTARGETS)
74
75
76 #
77 # Make unit tests...
78 #
79
80 unittests: $(UNITTARGETS)
81
82
83 #
84 # Clean all object files...
85 #
86
87 clean:
88 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
89 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
90 $(RM) -r 32bit 64bit
91
92
93 #
94 # Update dependencies (without system header dependencies...)
95 #
96
97 depend:
98 touch Dependencies.tmp
99 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
100 $(RM) Dependencies
101 cp Dependencies.tmp Dependencies
102 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
103 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
104 $(RM) Dependencies.tmp
105
106
107 #
108 # Install all targets...
109 #
110
111 install: all install-data install-headers install-libs install-exec
112
113
114 #
115 # Install data files...
116 #
117
118 install-data:
119
120
121 #
122 # Install programs...
123 #
124
125 install-exec:
126 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
127 for file in $(FILTERS); do \
128 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
129 done
130 $(RM) $(SERVERBIN)/filter/rastertodymo
131 $(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
132 if test "x$(SYMROOT)" != "x"; then \
133 $(INSTALL_DIR) $(SYMROOT); \
134 for file in $(TARGETS); do \
135 cp $$file $(SYMROOT); \
136 done \
137 fi
138
139
140 #
141 # Install headers...
142 #
143
144 install-headers:
145 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
146 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
147
148
149 #
150 # Install libraries...
151 #
152
153 install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
154 $(INSTALL_DIR) -m 755 $(LIBDIR)
155 $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
156 -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
157 $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
158 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
159 fi
160 -if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
161 $(RM) $(LIBDIR)/libcupsimage.dylib; \
162 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
163 fi
164
165 installstatic:
166 $(INSTALL_DIR) -m 755 $(LIBDIR)
167 $(INSTALL_LIB) libcupsimage.a $(LIBDIR);
168 $(RANLIB) $(LIBDIR)/libcupsimage.a;
169
170 install32bit:
171 $(INSTALL_DIR) -m 755 $(LIB32DIR)
172 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
173 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
174
175 install64bit:
176 $(INSTALL_DIR) -m 755 $(LIB64DIR)
177 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
178 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
179
180
181 #
182 # Uninstall all targets...
183 #
184
185 uninstall: $(UNINSTALL32) $(UNINSTALL64)
186 for file in $(FILTERS); do \
187 $(RM) $(SERVERBIN)/filter/$$file; \
188 done
189 $(RM) $(SERVERBIN)/filter/rastertodymo
190 -$(RMDIR) $(SERVERBIN)/filter
191 -$(RMDIR) $(SERVERBIN)
192 $(RM) $(LIBDIR)/libcupsimage.2.dylib
193 $(RM) $(LIBDIR)/libcupsimage.a
194 $(RM) $(LIBDIR)/libcupsimage.dylib
195 $(RM) $(LIBDIR)/libcupsimage_s.a
196 $(RM) $(LIBDIR)/libcupsimage.sl
197 $(RM) $(LIBDIR)/libcupsimage.sl.2
198 $(RM) $(LIBDIR)/libcupsimage.so
199 $(RM) $(LIBDIR)/libcupsimage.so.2
200 -$(RMDIR) $(LIBDIR)
201 $(RM) $(INCLUDEDIR)/cups/image.h
202 -$(RMDIR) $(INCLUDEDIR)/cups
203
204 uninstall32bit:
205 $(RM) $(LIB32DIR)/libcupsimage.so
206 $(RM) $(LIB32DIR)/libcupsimage.so.2
207 -$(RMDIR) $(LIB32DIR)
208
209 uninstall64bit:
210 $(RM) $(LIB64DIR)/libcupsimage.so
211 $(RM) $(LIB64DIR)/libcupsimage.so.2
212 -$(RMDIR) $(LIB64DIR)
213
214
215 #
216 # Automatic API help files...
217 #
218
219 apihelp:
220 echo Generating CUPS API help files...
221 mxmldoc --section "Programming" --title "Raster API" \
222 --css ../doc/cups-printable.css \
223 --header api-raster.header --intro api-raster.shtml \
224 ../cups/raster.h interpret.c raster.c \
225 >../doc/help/api-raster.html
226
227 framedhelp:
228 echo Generating CUPS API help files...
229 mxmldoc --section "Programming" --title "Raster API" \
230 --framed ../cups/api-raster \
231 --css ../doc/cups-printable.css \
232 --header api-raster.header --intro api-raster.shtml \
233 ../cups/raster.h interpret.c raster.c
234
235
236 #
237 # bannertops
238 #
239
240 bannertops: bannertops.o pstext.o common.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
241 echo Linking $@...
242 $(CC) $(LDFLAGS) -o $@ bannertops.o pstext.o common.o $(LINKCUPSIMAGE) \
243 $(IMGLIBS) $(LIBS)
244
245
246 #
247 # commandtops
248 #
249
250 commandtops: commandtops.o ../cups/$(LIBCUPS)
251 echo Linking $@...
252 $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
253
254
255 #
256 # formtops
257 #
258
259 formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
260 echo Linking $@...
261 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
262
263
264 #
265 # gziptoany
266 #
267
268 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
269 echo Linking $@...
270 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
271
272
273 #
274 # hpgltops
275 #
276
277 hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
278 echo Linking $@...
279 $(CC) $(LDFLAGS) -o $@ $(HPGLOBJS) common.o $(LIBS) -lm
280
281
282 #
283 # libcupsimage.so.2, libcupsimage.sl.2
284 #
285
286 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
287 echo Linking $@...
288 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
289 -L../cups $(LINKCUPS) -lm
290 $(RM) `basename $@ .2`
291 $(LN) $@ `basename $@ .2`
292
293
294 #
295 # 32bit/libcupsimage.so.2
296 #
297
298 32bit/libcupsimage.so.2: $(IMAGE32OBJS)
299 echo Linking 32-bit $@...
300 -mkdir 32bit
301 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
302 -L../cups/32bit $(LINKCUPS) -lm
303
304
305 #
306 # 64bit/libcupsimage.so.2
307 #
308
309 64bit/libcupsimage.so.2: $(IMAGE64OBJS)
310 echo Linking 64-bit $@...
311 -mkdir 64bit
312 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
313 -L../cups/64bit $(LINKCUPS) -lm
314
315
316 #
317 # libcupsimage.2.dylib
318 #
319
320 libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
321 echo Linking $@...
322 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
323 -install_name $(libdir)/$@ \
324 -current_version 2.3.0 \
325 -compatibility_version 2.0.0 \
326 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
327 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
328 $(RM) libcupsimage.dylib
329 $(LN) $@ libcupsimage.dylib
330
331
332 #
333 # libcupsimage_s.a
334 #
335
336 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
337 echo Linking $@...
338 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
339 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
340 $(RM) $@
341 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
342
343
344 #
345 # libcupsimage.la
346 #
347
348 libcupsimage.la: $(IMAGEOBJS)
349 echo Linking $@...
350 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
351 -L../cups $(LINKCUPS) \
352 -rpath $(LIBDIR) -version-info 2:3
353
354
355 #
356 # libcupsimage.a
357 #
358
359 libcupsimage.a: $(IMAGEOBJS)
360 echo Archiving $@...
361 $(RM) $@
362 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
363 $(RANLIB) $@
364
365
366 #
367 # testimage
368 #
369
370 testimage: testimage.o libcupsimage.a ../Makedefs
371 echo Linking $@...
372 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
373 $(IMGLIBS) $(DSOLIBS) $(LIBS)
374
375
376 #
377 # imagetops
378 #
379
380 imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
381 ../cups/$(LIBCUPS)
382 echo Linking $@...
383 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
384 $(IMGLIBS) $(LIBS)
385
386
387 #
388 # imagetoraster
389 #
390
391 imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
392 ../cups/$(LIBCUPS)
393 echo Linking $@...
394 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
395 $(IMGLIBS) $(LIBS)
396
397
398 #
399 # pstops
400 #
401
402 pstops: pstops.o common.o ../cups/$(LIBCUPS)
403 echo Linking $@...
404 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
405
406
407 #
408 # pdftops
409 #
410
411 pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
412 echo Linking $@...
413 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
414
415
416 #
417 # rastertolabel
418 #
419
420 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
421 echo Linking $@...
422 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
423
424
425 #
426 # rastertoepson
427 #
428
429 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
430 echo Linking $@...
431 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
432
433
434 #
435 # rastertohp
436 #
437
438 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
439 echo Linking $@...
440 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
441
442
443 #
444 # testraster
445 #
446
447 testraster: testraster.o ../cups/libcups.a libcupsimage.a
448 echo Linking $@...
449 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
450 ../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
451 $(SSLLIBS) $(LIBGSSAPI)
452 echo Running raster API tests...
453 ./testraster
454
455
456 #
457 # rasterbench
458 #
459
460 rasterbench: rasterbench.o libcupsimage.a
461 echo Linking $@...
462 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
463
464
465 #
466 # texttops
467 #
468
469 texttops: texttops.o textcommon.o common.o \
470 ../cups/$(LIBCUPS)
471 echo Linking $@...
472 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
473
474
475 #
476 # Dependencies...
477 #
478
479 include Dependencies
480
481
482 #
483 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
484 #