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