]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
Import changes from CUPS 1.4svn-r8704.
[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-2009 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) -m 755 libcupsimage.a $(LIBDIR)
168 $(RANLIB) $(LIBDIR)/libcupsimage.a
169 $(CHMOD) 555 $(LIBDIR)/libcupsimage.a
170
171 install32bit:
172 $(INSTALL_DIR) -m 755 $(LIB32DIR)
173 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
174 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
175
176 install64bit:
177 $(INSTALL_DIR) -m 755 $(LIB64DIR)
178 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
179 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
180
181
182 #
183 # Uninstall all targets...
184 #
185
186 uninstall: $(UNINSTALL32) $(UNINSTALL64)
187 for file in $(FILTERS); do \
188 $(RM) $(SERVERBIN)/filter/$$file; \
189 done
190 $(RM) $(SERVERBIN)/filter/rastertodymo
191 -$(RMDIR) $(SERVERBIN)/filter
192 -$(RMDIR) $(SERVERBIN)
193 $(RM) $(LIBDIR)/libcupsimage.2.dylib
194 $(RM) $(LIBDIR)/libcupsimage.a
195 $(RM) $(LIBDIR)/libcupsimage.dylib
196 $(RM) $(LIBDIR)/libcupsimage_s.a
197 $(RM) $(LIBDIR)/libcupsimage.sl
198 $(RM) $(LIBDIR)/libcupsimage.sl.2
199 $(RM) $(LIBDIR)/libcupsimage.so
200 $(RM) $(LIBDIR)/libcupsimage.so.2
201 -$(RMDIR) $(LIBDIR)
202 $(RM) $(INCLUDEDIR)/cups/image.h
203 -$(RMDIR) $(INCLUDEDIR)/cups
204
205 uninstall32bit:
206 $(RM) $(LIB32DIR)/libcupsimage.so
207 $(RM) $(LIB32DIR)/libcupsimage.so.2
208 -$(RMDIR) $(LIB32DIR)
209
210 uninstall64bit:
211 $(RM) $(LIB64DIR)/libcupsimage.so
212 $(RM) $(LIB64DIR)/libcupsimage.so.2
213 -$(RMDIR) $(LIB64DIR)
214
215
216 #
217 # Automatic API help files...
218 #
219
220 apihelp:
221 echo Generating CUPS API help files...
222 mxmldoc --section "Programming" --title "Raster API" \
223 --css ../doc/cups-printable.css \
224 --header api-raster.header --intro api-raster.shtml \
225 api-raster.xml \
226 ../cups/raster.h interpret.c raster.c \
227 >../doc/help/api-raster.html
228 mxmldoc --tokens help/api-raster.html api-raster.xml >../doc/help/api-raster.tokens
229 $(RM) api-raster.xml
230 mxmldoc --section "Programming" \
231 --title "Developing PostScript Printer Drivers" \
232 --css ../doc/cups-printable.css \
233 --header postscript-driver.header \
234 --intro postscript-driver.shtml \
235 >../doc/help/postscript-driver.html
236 mxmldoc --section "Programming" \
237 --title "Introduction to the PPD Compiler" \
238 --css ../doc/cups-printable.css \
239 --header ppd-compiler.header \
240 --intro ppd-compiler.shtml \
241 >../doc/help/ppd-compiler.html
242 mxmldoc --section "Programming" \
243 --title "Developing Raster Printer Drivers" \
244 --css ../doc/cups-printable.css \
245 --header raster-driver.header \
246 --intro raster-driver.shtml \
247 >../doc/help/raster-driver.html
248
249 framedhelp:
250 echo Generating CUPS API help files...
251 mxmldoc --section "Programming" --title "Raster API" \
252 --framed ../cups/api-raster \
253 --css ../doc/cups-printable.css \
254 --header api-raster.header --intro api-raster.shtml \
255 ../cups/raster.h interpret.c raster.c
256 mxmldoc --section "Programming" \
257 --title "Developing PostScript Printer Drivers" \
258 --framed ../cups/postscript-driver \
259 --css ../doc/cups-printable.css \
260 --header postscript-driver.header \
261 --intro postscript-driver.shtml
262 mxmldoc --section "Programming" \
263 --title "Introduction to the PPD Compiler" \
264 --framed ../cups/ppd-compiler \
265 --css ../doc/cups-printable.css \
266 --header ppd-compiler.header \
267 --intro ppd-compiler.shtml
268 mxmldoc --section "Programming" \
269 --title "Developing Raster Printer Drivers" \
270 --framed ../cups/raster-driver \
271 --css ../doc/cups-printable.css \
272 --header raster-driver.header \
273 --intro raster-driver.shtml
274
275
276 #
277 # bannertops
278 #
279
280 bannertops: bannertops.o pstext.o common.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
281 echo Linking $@...
282 $(CC) $(LDFLAGS) -o $@ bannertops.o pstext.o common.o $(LINKCUPSIMAGE) \
283 $(IMGLIBS) $(LIBS)
284
285
286 #
287 # commandtops
288 #
289
290 commandtops: commandtops.o ../cups/$(LIBCUPS)
291 echo Linking $@...
292 $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
293
294
295 #
296 # formtops
297 #
298
299 formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
300 echo Linking $@...
301 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
302
303
304 #
305 # gziptoany
306 #
307
308 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
309 echo Linking $@...
310 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
311
312
313 #
314 # hpgltops
315 #
316
317 hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
318 echo Linking $@...
319 $(CC) $(LDFLAGS) -o $@ $(HPGLOBJS) common.o $(LIBS) -lm
320
321
322 #
323 # libcupsimage.so.2, libcupsimage.sl.2
324 #
325
326 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
327 echo Linking $@...
328 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
329 -L../cups $(LINKCUPS) -lm
330 $(RM) `basename $@ .2`
331 $(LN) $@ `basename $@ .2`
332
333
334 #
335 # 32bit/libcupsimage.so.2
336 #
337
338 32bit/libcupsimage.so.2: $(IMAGE32OBJS)
339 echo Linking 32-bit $@...
340 -mkdir 32bit
341 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
342 -L../cups/32bit $(LINKCUPS) -lm
343
344
345 #
346 # 64bit/libcupsimage.so.2
347 #
348
349 64bit/libcupsimage.so.2: $(IMAGE64OBJS)
350 echo Linking 64-bit $@...
351 -mkdir 64bit
352 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
353 -L../cups/64bit $(LINKCUPS) -lm
354
355
356 #
357 # libcupsimage.2.dylib
358 #
359
360 libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
361 echo Linking $@...
362 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
363 -install_name $(libdir)/$@ \
364 -current_version 2.3.0 \
365 -compatibility_version 2.0.0 \
366 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
367 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
368 $(RM) libcupsimage.dylib
369 $(LN) $@ libcupsimage.dylib
370
371
372 #
373 # libcupsimage_s.a
374 #
375
376 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
377 echo Linking $@...
378 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
379 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
380 $(RM) $@
381 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
382
383
384 #
385 # libcupsimage.la
386 #
387
388 libcupsimage.la: $(IMAGEOBJS)
389 echo Linking $@...
390 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
391 -L../cups $(LINKCUPS) \
392 -rpath $(LIBDIR) -version-info 2:3
393
394
395 #
396 # libcupsimage.a
397 #
398
399 libcupsimage.a: $(IMAGEOBJS)
400 echo Archiving $@...
401 $(RM) $@
402 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
403 $(RANLIB) $@
404
405
406 #
407 # testimage
408 #
409
410 testimage: testimage.o libcupsimage.a ../Makedefs
411 echo Linking $@...
412 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
413 $(IMGLIBS) $(DSOLIBS) $(LIBS)
414
415
416 #
417 # imagetops
418 #
419
420 imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
421 ../cups/$(LIBCUPS)
422 echo Linking $@...
423 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
424 $(IMGLIBS) $(LIBS)
425
426
427 #
428 # imagetoraster
429 #
430
431 imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
432 ../cups/$(LIBCUPS)
433 echo Linking $@...
434 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
435 $(IMGLIBS) $(LIBS)
436
437
438 #
439 # pstops
440 #
441
442 pstops: pstops.o common.o ../cups/$(LIBCUPS)
443 echo Linking $@...
444 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
445
446
447 #
448 # pdftops
449 #
450
451 pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
452 echo Linking $@...
453 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
454
455
456 #
457 # rastertolabel
458 #
459
460 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
461 echo Linking $@...
462 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
463
464
465 #
466 # rastertoepson
467 #
468
469 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
470 echo Linking $@...
471 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
472
473
474 #
475 # rastertohp
476 #
477
478 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
479 echo Linking $@...
480 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
481
482
483 #
484 # testraster
485 #
486
487 testraster: testraster.o ../cups/libcups.a libcupsimage.a
488 echo Linking $@...
489 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
490 ../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
491 $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
492 echo Running raster API tests...
493 ./testraster
494
495
496 #
497 # rasterbench
498 #
499
500 rasterbench: rasterbench.o libcupsimage.a
501 echo Linking $@...
502 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
503
504
505 #
506 # texttops
507 #
508
509 texttops: texttops.o textcommon.o common.o \
510 ../cups/$(LIBCUPS)
511 echo Linking $@...
512 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
513
514
515 #
516 # Dependencies...
517 #
518
519 include Dependencies
520
521
522 #
523 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
524 #