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