]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
Merge changes from CUPS 1.5svn-r9000.
[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-2010 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 rastertolabel \
30 rastertoepson \
31 rastertohp
32 LIBTARGETS = \
33 $(LIBCUPSIMAGE) \
34 libcupsimage.a \
35 $(LIB32CUPSIMAGE) \
36 $(LIB64CUPSIMAGE)
37 UNITTARGETS = \
38 rasterbench \
39 testimage \
40 testraster
41 TARGETS = \
42 $(LIBTARGETS) \
43 $(FILTERS)
44
45 IMAGEOBJS = image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
46 image-photocd.o image-pix.o image-png.o image-pnm.o \
47 image-sgi.o image-sgilib.o image-sun.o image-tiff.o \
48 image-zoom.o image.o error.o interpret.o raster.o
49 IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
50 IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
51 OBJS = $(IMAGEOBJS) \
52 bannertops.o commandtops.o gziptoany.o imagetops.o \
53 imagetoraster.o common.o pdftops.o pstext.o pstops.o \
54 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
55 testimage.o testraster.o textcommon.o texttops.o
56
57
58 #
59 # Make all targets...
60 #
61
62 all: $(TARGETS)
63
64
65 #
66 # Make library targets...
67 #
68
69 libs: $(LIBTARGETS)
70
71
72 #
73 # Make unit tests...
74 #
75
76 unittests: $(UNITTARGETS)
77
78
79 #
80 # Clean all object files...
81 #
82
83 clean:
84 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
85 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
86 $(RM) -r 32bit 64bit
87
88
89 #
90 # Update dependencies (without system header dependencies...)
91 #
92
93 depend:
94 touch Dependencies.tmp
95 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
96 $(RM) Dependencies
97 cp Dependencies.tmp Dependencies
98 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
99 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
100 $(RM) Dependencies.tmp
101
102
103 #
104 # Install all targets...
105 #
106
107 install: all install-data install-headers install-libs install-exec
108
109
110 #
111 # Install data files...
112 #
113
114 install-data:
115
116
117 #
118 # Install programs...
119 #
120
121 install-exec:
122 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
123 for file in $(FILTERS); do \
124 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
125 done
126 $(RM) $(SERVERBIN)/filter/rastertodymo
127 $(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
128 if test "x$(SYMROOT)" != "x"; then \
129 $(INSTALL_DIR) $(SYMROOT); \
130 for file in $(FILTERS); do \
131 cp $$file $(SYMROOT); \
132 done \
133 fi
134
135
136 #
137 # Install headers...
138 #
139
140 install-headers:
141 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
142 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
143
144
145 #
146 # Install libraries...
147 #
148
149 install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
150 $(INSTALL_DIR) -m 755 $(LIBDIR)
151 $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
152 -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
153 $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
154 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
155 fi
156 -if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
157 $(RM) $(LIBDIR)/libcupsimage.dylib; \
158 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
159 fi
160 if test "x$(SYMROOT)" != "x"; then \
161 $(INSTALL_DIR) $(SYMROOT); \
162 cp $(LIBCUPSIMAGE) $(SYMROOT); \
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 # gziptoany
297 #
298
299 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
300 echo Linking $@...
301 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
302
303
304 #
305 # libcupsimage.so.2, libcupsimage.sl.2
306 #
307
308 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
309 echo Linking $@...
310 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
311 -L../cups $(LINKCUPS) -lm
312 $(RM) `basename $@ .2`
313 $(LN) $@ `basename $@ .2`
314
315
316 #
317 # 32bit/libcupsimage.so.2
318 #
319
320 32bit/libcupsimage.so.2: $(IMAGE32OBJS)
321 echo Linking 32-bit $@...
322 -mkdir 32bit
323 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
324 -L../cups/32bit $(LINKCUPS) -lm
325
326
327 #
328 # 64bit/libcupsimage.so.2
329 #
330
331 64bit/libcupsimage.so.2: $(IMAGE64OBJS)
332 echo Linking 64-bit $@...
333 -mkdir 64bit
334 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
335 -L../cups/64bit $(LINKCUPS) -lm
336
337
338 #
339 # libcupsimage.2.dylib
340 #
341
342 libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
343 echo Linking $@...
344 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
345 -install_name $(libdir)/$@ \
346 -current_version 2.3.0 \
347 -compatibility_version 2.0.0 \
348 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
349 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
350 $(RM) libcupsimage.dylib
351 $(LN) $@ libcupsimage.dylib
352
353
354 #
355 # libcupsimage_s.a
356 #
357
358 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
359 echo Linking $@...
360 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
361 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
362 $(RM) $@
363 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
364
365
366 #
367 # libcupsimage.la
368 #
369
370 libcupsimage.la: $(IMAGEOBJS)
371 echo Linking $@...
372 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
373 -L../cups $(LINKCUPS) \
374 -rpath $(LIBDIR) -version-info 2:3
375
376
377 #
378 # libcupsimage.a
379 #
380
381 libcupsimage.a: $(IMAGEOBJS)
382 echo Archiving $@...
383 $(RM) $@
384 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
385 $(RANLIB) $@
386
387
388 #
389 # testimage
390 #
391
392 testimage: testimage.o libcupsimage.a ../Makedefs
393 echo Linking $@...
394 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
395 $(IMGLIBS) $(DSOLIBS) $(LIBS)
396
397
398 #
399 # imagetops
400 #
401
402 imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
403 ../cups/$(LIBCUPS)
404 echo Linking $@...
405 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
406 $(IMGLIBS) $(LIBS)
407
408
409 #
410 # imagetoraster
411 #
412
413 imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
414 ../cups/$(LIBCUPS)
415 echo Linking $@...
416 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
417 $(IMGLIBS) $(LIBS)
418
419
420 #
421 # pstops
422 #
423
424 pstops: pstops.o common.o ../cups/$(LIBCUPS)
425 echo Linking $@...
426 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
427
428
429 #
430 # pdftops
431 #
432
433 pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
434 echo Linking $@...
435 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
436
437
438 #
439 # rastertolabel
440 #
441
442 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
443 echo Linking $@...
444 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
445
446
447 #
448 # rastertoepson
449 #
450
451 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
452 echo Linking $@...
453 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
454
455
456 #
457 # rastertohp
458 #
459
460 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
461 echo Linking $@...
462 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
463
464
465 #
466 # testraster
467 #
468
469 testraster: testraster.o ../cups/libcups.a libcupsimage.a
470 echo Linking $@...
471 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
472 ../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
473 $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
474 echo Running raster API tests...
475 ./testraster
476
477
478 #
479 # rasterbench
480 #
481
482 rasterbench: rasterbench.o libcupsimage.a
483 echo Linking $@...
484 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
485
486
487 #
488 # texttops
489 #
490
491 texttops: texttops.o textcommon.o common.o \
492 ../cups/$(LIBCUPS)
493 echo Linking $@...
494 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
495
496
497 #
498 # Dependencies...
499 #
500
501 include Dependencies
502
503
504 #
505 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
506 #