]> git.ipfire.org Git - thirdparty/cups.git/blame - filter/Makefile
Merge changes from CUPS 1.4svn-r7994.
[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#
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) \
1f6f3dbc
MS
55 bannertops.o commandtops.o gziptoany.o imagetops.o \
56 imagetoraster.o common.o 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
1f6f3dbc
MS
235#
236# bannertops
237#
238
239bannertops: bannertops.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
240 echo Linking $@...
241 $(CC) $(LDFLAGS) -o $@ bannertops.o $(LIBS)
242
243
7a14d768
MS
244#
245# commandtops
246#
247
248commandtops: commandtops.o ../cups/$(LIBCUPS)
249 echo Linking $@...
250 $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
251
252
ef416fc2 253#
254# formtops
255#
256
257formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
258 echo Linking $@...
259 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
260
261
262#
263# gziptoany
264#
265
266gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
267 echo Linking $@...
268 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
269
270
271#
272# hpgltops
273#
274
275hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
276 echo Linking $@...
277 $(CC) $(LDFLAGS) -o $@ $(HPGLOBJS) common.o $(LIBS) -lm
278
279
280#
281# libcupsimage.so.2, libcupsimage.sl.2
282#
283
284libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
285 echo Linking $@...
a74454a7 286 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
287 -L../cups $(LINKCUPS) -lm
ef416fc2 288 $(RM) `basename $@ .2`
289 $(LN) $@ `basename $@ .2`
290
291
e1d6a774 292#
f301802f 293# 32bit/libcupsimage.so.2
e1d6a774 294#
295
f301802f 29632bit/libcupsimage.so.2: $(IMAGE32OBJS)
e1d6a774 297 echo Linking 32-bit $@...
f301802f 298 -mkdir 32bit
299 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
300 -L../cups/32bit $(LINKCUPS) -lm
e1d6a774 301
302
303#
f301802f 304# 64bit/libcupsimage.so.2
e1d6a774 305#
306
f301802f 30764bit/libcupsimage.so.2: $(IMAGE64OBJS)
e1d6a774 308 echo Linking 64-bit $@...
f301802f 309 -mkdir 64bit
310 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
311 -L../cups/64bit $(LINKCUPS) -lm
e1d6a774 312
313
ef416fc2 314#
315# libcupsimage.2.dylib
316#
317
355e94dc 318libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
ef416fc2 319 echo Linking $@...
e1d6a774 320 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 321 -install_name $(libdir)/$@ \
f7deaa1a 322 -current_version 2.3.0 \
ef416fc2 323 -compatibility_version 2.0.0 \
cc0d019f 324 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
ef416fc2 325 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
326 $(RM) libcupsimage.dylib
327 $(LN) $@ libcupsimage.dylib
328
329
330#
331# libcupsimage_s.a
332#
333
a74454a7 334libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
ef416fc2 335 echo Linking $@...
e1d6a774 336 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
337 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
ef416fc2 338 $(RM) $@
339 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
340
341
342#
343# libcupsimage.la
344#
345
346libcupsimage.la: $(IMAGEOBJS)
347 echo Linking $@...
e1d6a774 348 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
a74454a7 349 -L../cups $(LINKCUPS) \
f7deaa1a 350 -rpath $(LIBDIR) -version-info 2:3
ef416fc2 351
352
353#
354# libcupsimage.a
355#
356
357libcupsimage.a: $(IMAGEOBJS)
358 echo Archiving $@...
359 $(RM) $@
360 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
361 $(RANLIB) $@
362
363
364#
365# testimage
366#
367
368testimage: testimage.o libcupsimage.a ../Makedefs
369 echo Linking $@...
370 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
371 $(IMGLIBS) $(DSOLIBS) $(LIBS)
372
373
374#
375# imagetops
376#
377
378imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
379 ../cups/$(LIBCUPS)
380 echo Linking $@...
381 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
382 $(IMGLIBS) $(LIBS)
383
384
385#
386# imagetoraster
387#
388
389imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
390 ../cups/$(LIBCUPS)
391 echo Linking $@...
392 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
393 $(IMGLIBS) $(LIBS)
394
395
396#
397# pstops
398#
399
400pstops: pstops.o common.o ../cups/$(LIBCUPS)
401 echo Linking $@...
bd7854cb 402 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
ef416fc2 403
404
91c84a35
MS
405#
406# pdftops
407#
408
409pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
410 echo Linking $@...
411 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
412
413
ef416fc2 414#
415# rastertolabel
416#
417
418rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
419 echo Linking $@...
420 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
421
422
423#
424# rastertoepson
425#
426
427rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
428 echo Linking $@...
429 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
430
431
432#
433# rastertohp
434#
435
436rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
437 echo Linking $@...
438 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
439
440
441#
442# testraster
443#
444
b86bc4cf 445testraster: testraster.o ../cups/libcups.a libcupsimage.a
ef416fc2 446 echo Linking $@...
c9fc04c6
MS
447 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
448 ../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
449 $(SSLLIBS) $(LIBGSSAPI)
450 echo Running raster API tests...
451 ./testraster
ef416fc2 452
453
ed486911 454#
455# rasterbench
456#
457
f7deaa1a 458rasterbench: rasterbench.o libcupsimage.a
ed486911 459 echo Linking $@...
f7deaa1a 460 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
ed486911 461
462
ef416fc2 463#
464# texttops
465#
466
467texttops: texttops.o textcommon.o common.o \
468 ../cups/$(LIBCUPS)
469 echo Linking $@...
470 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
471
472
473#
474# Dependencies...
475#
476
477include Dependencies
478
479
480#
b19ccc9e 481# End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
ef416fc2 482#