]> git.ipfire.org Git - thirdparty/cups.git/blame - filter/Makefile
Merge changes from CUPS 1.5svn-r9675.
[thirdparty/cups.git] / filter / Makefile
CommitLineData
ef416fc2 1#
b19ccc9e 2# "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
ef416fc2 3#
07ed0e9a 4# Filter makefile for CUPS.
ef416fc2 5#
07ed0e9a 6# Copyright 2007-2011 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 \
e6013cfa 25 $(TEXTTOPS) \
c9fc04c6
MS
26 pstops \
27 $(IMGFILTERS) \
28 $(PDFTOPS) \
c9fc04c6 29 rastertoepson \
07ed0e9a
MS
30 rastertohp \
31 rastertolabel \
32 rastertopwg
c9fc04c6 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
ef416fc2 46IMAGEOBJS = 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 \
f7deaa1a 49 image-zoom.o image.o error.o interpret.o raster.o
e1d6a774 50IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
51IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
f8b3a85b 52OBJS = $(IMAGEOBJS) \
1f6f3dbc 53 bannertops.o commandtops.o gziptoany.o imagetops.o \
cda47a96 54 imagetoraster.o common.o pdftops.o pstext.o pstops.o \
ed486911 55 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
07ed0e9a 56 rastertopwg.o testimage.o testraster.o textcommon.o texttops.o
ef416fc2 57
58
59#
60# Make all targets...
61#
62
e1d6a774 63all: $(TARGETS)
ef416fc2 64
65
c9fc04c6
MS
66#
67# Make library targets...
68#
69
70libs: $(LIBTARGETS)
71
72
5f64df29
MS
73#
74# Make unit tests...
75#
76
77unittests: $(UNITTARGETS)
78
79
ef416fc2 80#
81# Clean all object files...
82#
83
84clean:
5f64df29 85 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
e1d6a774 86 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
f301802f 87 $(RM) -r 32bit 64bit
ef416fc2 88
89
90#
91# Update dependencies (without system header dependencies...)
92#
93
94depend:
e1d6a774 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
ac884b6a
MS
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
e1d6a774 101 $(RM) Dependencies.tmp
ef416fc2 102
103
104#
105# Install all targets...
106#
107
50fe7201
MS
108install: all install-data install-headers install-libs install-exec
109
110
111#
112# Install data files...
113#
114
115install-data:
116
117
118#
119# Install programs...
120#
121
122install-exec:
bd7854cb 123 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
ef416fc2 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
50fe7201
MS
129 if test "x$(SYMROOT)" != "x"; then \
130 $(INSTALL_DIR) $(SYMROOT); \
f8b3a85b 131 for file in $(FILTERS); do \
50fe7201
MS
132 cp $$file $(SYMROOT); \
133 done \
134 fi
135
136
137#
138# Install headers...
139#
140
141install-headers:
142 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
143 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
144
145
146#
147# Install libraries...
148#
149
150install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
923edb68 151 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 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 \
ef416fc2 158 $(RM) $(LIBDIR)/libcupsimage.dylib; \
159 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
160 fi
f8b3a85b
MS
161 if test "x$(SYMROOT)" != "x"; then \
162 $(INSTALL_DIR) $(SYMROOT); \
163 cp $(LIBCUPSIMAGE) $(SYMROOT); \
164 fi
923edb68 165
166installstatic:
167 $(INSTALL_DIR) -m 755 $(LIBDIR)
97c9a8d7
MS
168 $(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR)
169 $(RANLIB) $(LIBDIR)/libcupsimage.a
170 $(CHMOD) 555 $(LIBDIR)/libcupsimage.a
ef416fc2 171
e1d6a774 172install32bit:
173 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 174 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
ed486911 175 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
e1d6a774 176
177install64bit:
178 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 179 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
ed486911 180 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
e1d6a774 181
ef416fc2 182
757d2cad 183#
184# Uninstall all targets...
185#
186
e1d6a774 187uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 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
757d2cad 204 -$(RMDIR) $(INCLUDEDIR)/cups
205
e1d6a774 206uninstall32bit:
207 $(RM) $(LIB32DIR)/libcupsimage.so
208 $(RM) $(LIB32DIR)/libcupsimage.so.2
209 -$(RMDIR) $(LIB32DIR)
210
211uninstall64bit:
212 $(RM) $(LIB64DIR)/libcupsimage.so
213 $(RM) $(LIB64DIR)/libcupsimage.so.2
214 -$(RMDIR) $(LIB64DIR)
215
757d2cad 216
b423cd4c 217#
218# Automatic API help files...
219#
220
221apihelp:
222 echo Generating CUPS API help files...
223 mxmldoc --section "Programming" --title "Raster API" \
5a738aea
MS
224 --css ../doc/cups-printable.css \
225 --header api-raster.header --intro api-raster.shtml \
f11a948a 226 api-raster.xml \
ac884b6a
MS
227 ../cups/raster.h interpret.c raster.c \
228 >../doc/help/api-raster.html
f11a948a
MS
229 mxmldoc --tokens help/api-raster.html api-raster.xml >../doc/help/api-raster.tokens
230 $(RM) api-raster.xml
8b450588
MS
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
10d09e33
MS
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
b423cd4c 255
5a738aea
MS
256framedhelp:
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 \
ac884b6a 262 ../cups/raster.h interpret.c raster.c
8b450588
MS
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
10d09e33
MS
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 \
8b450588 287
b423cd4c 288
1f6f3dbc
MS
289#
290# bannertops
291#
292
cda47a96 293bannertops: bannertops.o pstext.o common.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
1f6f3dbc 294 echo Linking $@...
cda47a96
MS
295 $(CC) $(LDFLAGS) -o $@ bannertops.o pstext.o common.o $(LINKCUPSIMAGE) \
296 $(IMGLIBS) $(LIBS)
1f6f3dbc
MS
297
298
7a14d768
MS
299#
300# commandtops
301#
302
303commandtops: commandtops.o ../cups/$(LIBCUPS)
304 echo Linking $@...
305 $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
306
307
ef416fc2 308#
309# gziptoany
310#
311
312gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
313 echo Linking $@...
314 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
315
316
ef416fc2 317#
318# libcupsimage.so.2, libcupsimage.sl.2
319#
320
321libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
322 echo Linking $@...
a74454a7 323 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
324 -L../cups $(LINKCUPS) -lm
ef416fc2 325 $(RM) `basename $@ .2`
326 $(LN) $@ `basename $@ .2`
327
328
e1d6a774 329#
f301802f 330# 32bit/libcupsimage.so.2
e1d6a774 331#
332
f301802f 33332bit/libcupsimage.so.2: $(IMAGE32OBJS)
e1d6a774 334 echo Linking 32-bit $@...
f301802f 335 -mkdir 32bit
336 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
337 -L../cups/32bit $(LINKCUPS) -lm
e1d6a774 338
339
340#
f301802f 341# 64bit/libcupsimage.so.2
e1d6a774 342#
343
f301802f 34464bit/libcupsimage.so.2: $(IMAGE64OBJS)
e1d6a774 345 echo Linking 64-bit $@...
f301802f 346 -mkdir 64bit
347 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
348 -L../cups/64bit $(LINKCUPS) -lm
e1d6a774 349
350
ef416fc2 351#
352# libcupsimage.2.dylib
353#
354
355e94dc 355libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
ef416fc2 356 echo Linking $@...
e1d6a774 357 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 358 -install_name $(libdir)/$@ \
f7deaa1a 359 -current_version 2.3.0 \
ef416fc2 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
a74454a7 370libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
ef416fc2 371 echo Linking $@...
e1d6a774 372 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
373 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
ef416fc2 374 $(RM) $@
375 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
376
377
378#
379# libcupsimage.la
380#
381
382libcupsimage.la: $(IMAGEOBJS)
383 echo Linking $@...
e1d6a774 384 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
a74454a7 385 -L../cups $(LINKCUPS) \
f7deaa1a 386 -rpath $(LIBDIR) -version-info 2:3
ef416fc2 387
388
389#
390# libcupsimage.a
391#
392
393libcupsimage.a: $(IMAGEOBJS)
394 echo Archiving $@...
395 $(RM) $@
396 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
397 $(RANLIB) $@
398
399
400#
401# testimage
402#
403
404testimage: 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
414imagetops: 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
425imagetoraster: 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
436pstops: pstops.o common.o ../cups/$(LIBCUPS)
437 echo Linking $@...
bd7854cb 438 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
ef416fc2 439
440
91c84a35
MS
441#
442# pdftops
443#
444
445pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
446 echo Linking $@...
447 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
448
449
ef416fc2 450#
451# rastertoepson
452#
453
454rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
455 echo Linking $@...
456 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
457
458
459#
460# rastertohp
461#
462
463rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
464 echo Linking $@...
465 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
466
467
07ed0e9a
MS
468#
469# rastertolabel
470#
471
472rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
473 echo Linking $@...
474 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
475
476
477#
478# rastertopwg
479#
480
481rastertopwg: rastertopwg.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
482 echo Linking $@...
483 $(CC) $(LDFLAGS) -o $@ rastertopwg.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
484
485
ef416fc2 486#
487# testraster
488#
489
6d2f911b 490testraster: testraster.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
ef416fc2 491 echo Linking $@...
c9fc04c6 492 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
6d2f911b 493 ../cups/$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
c168a833 494 $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
c9fc04c6
MS
495 echo Running raster API tests...
496 ./testraster
ef416fc2 497
498
ed486911 499#
500# rasterbench
501#
502
f7deaa1a 503rasterbench: rasterbench.o libcupsimage.a
ed486911 504 echo Linking $@...
f7deaa1a 505 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
ed486911 506
507
ef416fc2 508#
509# texttops
510#
511
512texttops: 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#
07ed0e9a 521
ef416fc2 522include Dependencies
523
524
525#
b19ccc9e 526# End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
ef416fc2 527#