]> git.ipfire.org Git - thirdparty/cups.git/blame - filter/Makefile
Merge changes from CUPS 1.4svn-r8540.
[thirdparty/cups.git] / filter / Makefile
CommitLineData
ef416fc2 1#
b19ccc9e 2# "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
ef416fc2 3#
4# Filter makefile for the Common UNIX Printing System (CUPS).
5#
c168a833 6# Copyright 2007-2009 by Apple Inc.
bd7854cb 7# Copyright 1997-2006 by Easy Software Products.
ef416fc2 8#
9# These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14#
15# This file is subject to the Apple OS-Developed Software exception.
16#
17
18include ../Makedefs
19
b86bc4cf 20
c9fc04c6 21FILTERS = \
e6013cfa 22 $(BANNERTOPS) \
c9fc04c6
MS
23 commandtops \
24 gziptoany \
25 hpgltops \
e6013cfa 26 $(TEXTTOPS) \
c9fc04c6
MS
27 pstops \
28 $(IMGFILTERS) \
29 $(PDFTOPS) \
30 rastertolabel \
31 rastertoepson \
32 rastertohp
33LIBTARGETS = \
e1d6a774 34 $(LIBCUPSIMAGE) \
35 libcupsimage.a \
36 $(LIB32CUPSIMAGE) \
5f64df29
MS
37 $(LIB64CUPSIMAGE)
38UNITTARGETS = \
39 rasterbench \
40 testimage \
e1d6a774 41 testraster
c9fc04c6
MS
42TARGETS = \
43 $(LIBTARGETS) \
5f64df29 44 $(FILTERS)
ef416fc2 45
46HPGLOBJS = 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
48IMAGEOBJS = 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 \
f7deaa1a 51 image-zoom.o image.o error.o interpret.o raster.o
e1d6a774 52IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
53IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
ef416fc2 54FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
55OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
1f6f3dbc 56 bannertops.o commandtops.o gziptoany.o imagetops.o \
cda47a96 57 imagetoraster.o common.o pdftops.o pstext.o pstops.o \
ed486911 58 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
e1d6a774 59 testimage.o testraster.o textcommon.o texttops.o
ef416fc2 60
61
62#
63# Make all targets...
64#
65
e1d6a774 66all: $(TARGETS)
ef416fc2 67
68
c9fc04c6
MS
69#
70# Make library targets...
71#
72
73libs: $(LIBTARGETS)
74
75
5f64df29
MS
76#
77# Make unit tests...
78#
79
80unittests: $(UNITTARGETS)
81
82
ef416fc2 83#
84# Clean all object files...
85#
86
87clean:
5f64df29 88 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
e1d6a774 89 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
f301802f 90 $(RM) -r 32bit 64bit
ef416fc2 91
92
93#
94# Update dependencies (without system header dependencies...)
95#
96
97depend:
e1d6a774 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
ac884b6a
MS
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
e1d6a774 104 $(RM) Dependencies.tmp
ef416fc2 105
106
107#
108# Install all targets...
109#
110
50fe7201
MS
111install: all install-data install-headers install-libs install-exec
112
113
114#
115# Install data files...
116#
117
118install-data:
119
120
121#
122# Install programs...
123#
124
125install-exec:
bd7854cb 126 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
ef416fc2 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
50fe7201
MS
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
144install-headers:
145 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
146 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
147
148
149#
150# Install libraries...
151#
152
153install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
923edb68 154 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 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 \
ef416fc2 161 $(RM) $(LIBDIR)/libcupsimage.dylib; \
162 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
163 fi
923edb68 164
165installstatic:
166 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 167 $(INSTALL_LIB) libcupsimage.a $(LIBDIR);
168 $(RANLIB) $(LIBDIR)/libcupsimage.a;
ef416fc2 169
e1d6a774 170install32bit:
171 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 172 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
ed486911 173 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
e1d6a774 174
175install64bit:
176 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 177 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
ed486911 178 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
e1d6a774 179
ef416fc2 180
757d2cad 181#
182# Uninstall all targets...
183#
184
e1d6a774 185uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 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
757d2cad 202 -$(RMDIR) $(INCLUDEDIR)/cups
203
e1d6a774 204uninstall32bit:
205 $(RM) $(LIB32DIR)/libcupsimage.so
206 $(RM) $(LIB32DIR)/libcupsimage.so.2
207 -$(RMDIR) $(LIB32DIR)
208
209uninstall64bit:
210 $(RM) $(LIB64DIR)/libcupsimage.so
211 $(RM) $(LIB64DIR)/libcupsimage.so.2
212 -$(RMDIR) $(LIB64DIR)
213
757d2cad 214
b423cd4c 215#
216# Automatic API help files...
217#
218
219apihelp:
220 echo Generating CUPS API help files...
221 mxmldoc --section "Programming" --title "Raster API" \
5a738aea
MS
222 --css ../doc/cups-printable.css \
223 --header api-raster.header --intro api-raster.shtml \
ac884b6a
MS
224 ../cups/raster.h interpret.c raster.c \
225 >../doc/help/api-raster.html
8b450588
MS
226 mxmldoc --section "Programming" \
227 --title "Developing PostScript Printer Drivers" \
228 --css ../doc/cups-printable.css \
229 --header postscript-driver.header \
230 --intro postscript-driver.shtml \
231 >../doc/help/postscript-driver.html
232 mxmldoc --section "Programming" \
233 --title "Introduction to the PPD Compiler" \
234 --css ../doc/cups-printable.css \
235 --header ppd-compiler.header \
236 --intro ppd-compiler.shtml \
237 >../doc/help/ppd-compiler.html
238 mxmldoc --section "Programming" \
239 --title "Developing Raster Printer Drivers" \
240 --css ../doc/cups-printable.css \
241 --header raster-driver.header \
242 --intro raster-driver.shtml \
243 >../doc/help/raster-driver.html
b423cd4c 244
5a738aea
MS
245framedhelp:
246 echo Generating CUPS API help files...
247 mxmldoc --section "Programming" --title "Raster API" \
248 --framed ../cups/api-raster \
249 --css ../doc/cups-printable.css \
250 --header api-raster.header --intro api-raster.shtml \
ac884b6a 251 ../cups/raster.h interpret.c raster.c
8b450588
MS
252 mxmldoc --section "Programming" \
253 --title "Developing PostScript Printer Drivers" \
254 --framed ../cups/postscript-driver \
255 --css ../doc/cups-printable.css \
256 --header postscript-driver.header \
257 --intro postscript-driver.shtml
258 mxmldoc --section "Programming" \
259 --title "Introduction to the PPD Compiler" \
260 --framed ../cups/ppd-compiler \
261 --css ../doc/cups-printable.css \
262 --header ppd-compiler.header \
263 --intro ppd-compiler.shtml
264 mxmldoc --section "Programming" \
265 --title "Developing Raster Printer Drivers" \
266 --framed ../cups/raster-driver \
267 --css ../doc/cups-printable.css \
268 --header raster-driver.header \
269 --intro raster-driver.shtml
270
271docsets:
272 echo Generating CUPS API documentation sets...
273 ../tools/makedocset --docset org.cups.raster.docset \
274 --title "Raster API" \
275 --header api-raster.header --intro api-raster.shtml \
276 ../cups/raster.h interpret.c raster.c
277 ../tools/makedocset --docset org.cups.postscript-driver.docset \
278 --title "Developing PostScript Printer Drivers" \
279 --header postscript-driver.header \
280 --intro postscript-driver.shtml
281 ../tools/makedocset --docset org.cups.ppd-compiler.docset \
282 --title "Introduction to the PPD Compiler" \
283 --header ppd-compiler.header \
284 --intro ppd-compiler.shtml
285 ../tools/makedocset --docset org.cups.raster-driver.docset \
286 --title "Developing Raster Printer Drivers" \
287 --header raster-driver.header \
288 --intro raster-driver.shtml
5a738aea 289
b423cd4c 290
1f6f3dbc
MS
291#
292# bannertops
293#
294
cda47a96 295bannertops: bannertops.o pstext.o common.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
1f6f3dbc 296 echo Linking $@...
cda47a96
MS
297 $(CC) $(LDFLAGS) -o $@ bannertops.o pstext.o common.o $(LINKCUPSIMAGE) \
298 $(IMGLIBS) $(LIBS)
1f6f3dbc
MS
299
300
7a14d768
MS
301#
302# commandtops
303#
304
305commandtops: commandtops.o ../cups/$(LIBCUPS)
306 echo Linking $@...
307 $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
308
309
ef416fc2 310#
311# formtops
312#
313
314formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
315 echo Linking $@...
316 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
317
318
319#
320# gziptoany
321#
322
323gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
324 echo Linking $@...
325 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
326
327
328#
329# hpgltops
330#
331
332hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
333 echo Linking $@...
334 $(CC) $(LDFLAGS) -o $@ $(HPGLOBJS) common.o $(LIBS) -lm
335
336
337#
338# libcupsimage.so.2, libcupsimage.sl.2
339#
340
341libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
342 echo Linking $@...
a74454a7 343 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
344 -L../cups $(LINKCUPS) -lm
ef416fc2 345 $(RM) `basename $@ .2`
346 $(LN) $@ `basename $@ .2`
347
348
e1d6a774 349#
f301802f 350# 32bit/libcupsimage.so.2
e1d6a774 351#
352
f301802f 35332bit/libcupsimage.so.2: $(IMAGE32OBJS)
e1d6a774 354 echo Linking 32-bit $@...
f301802f 355 -mkdir 32bit
356 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
357 -L../cups/32bit $(LINKCUPS) -lm
e1d6a774 358
359
360#
f301802f 361# 64bit/libcupsimage.so.2
e1d6a774 362#
363
f301802f 36464bit/libcupsimage.so.2: $(IMAGE64OBJS)
e1d6a774 365 echo Linking 64-bit $@...
f301802f 366 -mkdir 64bit
367 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
368 -L../cups/64bit $(LINKCUPS) -lm
e1d6a774 369
370
ef416fc2 371#
372# libcupsimage.2.dylib
373#
374
355e94dc 375libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
ef416fc2 376 echo Linking $@...
e1d6a774 377 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 378 -install_name $(libdir)/$@ \
f7deaa1a 379 -current_version 2.3.0 \
ef416fc2 380 -compatibility_version 2.0.0 \
cc0d019f 381 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
ef416fc2 382 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
383 $(RM) libcupsimage.dylib
384 $(LN) $@ libcupsimage.dylib
385
386
387#
388# libcupsimage_s.a
389#
390
a74454a7 391libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
ef416fc2 392 echo Linking $@...
e1d6a774 393 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
394 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
ef416fc2 395 $(RM) $@
396 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
397
398
399#
400# libcupsimage.la
401#
402
403libcupsimage.la: $(IMAGEOBJS)
404 echo Linking $@...
e1d6a774 405 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
a74454a7 406 -L../cups $(LINKCUPS) \
f7deaa1a 407 -rpath $(LIBDIR) -version-info 2:3
ef416fc2 408
409
410#
411# libcupsimage.a
412#
413
414libcupsimage.a: $(IMAGEOBJS)
415 echo Archiving $@...
416 $(RM) $@
417 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
418 $(RANLIB) $@
419
420
421#
422# testimage
423#
424
425testimage: testimage.o libcupsimage.a ../Makedefs
426 echo Linking $@...
427 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
428 $(IMGLIBS) $(DSOLIBS) $(LIBS)
429
430
431#
432# imagetops
433#
434
435imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
436 ../cups/$(LIBCUPS)
437 echo Linking $@...
438 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
439 $(IMGLIBS) $(LIBS)
440
441
442#
443# imagetoraster
444#
445
446imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
447 ../cups/$(LIBCUPS)
448 echo Linking $@...
449 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
450 $(IMGLIBS) $(LIBS)
451
452
453#
454# pstops
455#
456
457pstops: pstops.o common.o ../cups/$(LIBCUPS)
458 echo Linking $@...
bd7854cb 459 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
ef416fc2 460
461
91c84a35
MS
462#
463# pdftops
464#
465
466pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
467 echo Linking $@...
468 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
469
470
ef416fc2 471#
472# rastertolabel
473#
474
475rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
476 echo Linking $@...
477 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
478
479
480#
481# rastertoepson
482#
483
484rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
485 echo Linking $@...
486 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
487
488
489#
490# rastertohp
491#
492
493rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
494 echo Linking $@...
495 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
496
497
498#
499# testraster
500#
501
b86bc4cf 502testraster: testraster.o ../cups/libcups.a libcupsimage.a
ef416fc2 503 echo Linking $@...
c9fc04c6
MS
504 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
505 ../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
c168a833 506 $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
c9fc04c6
MS
507 echo Running raster API tests...
508 ./testraster
ef416fc2 509
510
ed486911 511#
512# rasterbench
513#
514
f7deaa1a 515rasterbench: rasterbench.o libcupsimage.a
ed486911 516 echo Linking $@...
f7deaa1a 517 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
ed486911 518
519
ef416fc2 520#
521# texttops
522#
523
524texttops: texttops.o textcommon.o common.o \
525 ../cups/$(LIBCUPS)
526 echo Linking $@...
527 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
528
529
530#
531# Dependencies...
532#
533
534include Dependencies
535
536
537#
b19ccc9e 538# End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
ef416fc2 539#