]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
Merge changes from CUPS 1.4svn-r7874.
[thirdparty/cups.git] / filter / Makefile
1 #
2 # "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $"
3 #
4 # Filter makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007-2008 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 commandtops \
23 gziptoany \
24 hpgltops \
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 HPGLOBJS = 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
47 IMAGEOBJS = 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 \
50 image-zoom.o image.o error.o interpret.o raster.o
51 IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
52 IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
53 FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
54 OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
55 commandtops.o gziptoany.o imagetops.o imagetoraster.o common.o \
56 pdftops.o pstops.o \
57 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
58 testimage.o testraster.o textcommon.o texttops.o
59
60
61 #
62 # Make all targets...
63 #
64
65 all: $(TARGETS)
66
67
68 #
69 # Make library targets...
70 #
71
72 libs: $(LIBTARGETS)
73
74
75 #
76 # Make unit tests...
77 #
78
79 unittests: $(UNITTARGETS)
80
81
82 #
83 # Clean all object files...
84 #
85
86 clean:
87 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
88 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
89 $(RM) -r 32bit 64bit
90
91
92 #
93 # Update dependencies (without system header dependencies...)
94 #
95
96 depend:
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
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
103 $(RM) Dependencies.tmp
104
105
106 #
107 # Install all targets...
108 #
109
110 install: all install-data install-headers install-libs install-exec
111
112
113 #
114 # Install data files...
115 #
116
117 install-data:
118
119
120 #
121 # Install programs...
122 #
123
124 install-exec:
125 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
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
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
143 install-headers:
144 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
145 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
146
147
148 #
149 # Install libraries...
150 #
151
152 install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
153 $(INSTALL_DIR) -m 755 $(LIBDIR)
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 \
160 $(RM) $(LIBDIR)/libcupsimage.dylib; \
161 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
162 fi
163
164 installstatic:
165 $(INSTALL_DIR) -m 755 $(LIBDIR)
166 $(INSTALL_LIB) libcupsimage.a $(LIBDIR);
167 $(RANLIB) $(LIBDIR)/libcupsimage.a;
168
169 install32bit:
170 $(INSTALL_DIR) -m 755 $(LIB32DIR)
171 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
172 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
173
174 install64bit:
175 $(INSTALL_DIR) -m 755 $(LIB64DIR)
176 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
177 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
178
179
180 #
181 # Uninstall all targets...
182 #
183
184 uninstall: $(UNINSTALL32) $(UNINSTALL64)
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
201 -$(RMDIR) $(INCLUDEDIR)/cups
202
203 uninstall32bit:
204 $(RM) $(LIB32DIR)/libcupsimage.so
205 $(RM) $(LIB32DIR)/libcupsimage.so.2
206 -$(RMDIR) $(LIB32DIR)
207
208 uninstall64bit:
209 $(RM) $(LIB64DIR)/libcupsimage.so
210 $(RM) $(LIB64DIR)/libcupsimage.so.2
211 -$(RMDIR) $(LIB64DIR)
212
213
214 #
215 # Automatic API help files...
216 #
217
218 apihelp:
219 echo Generating CUPS API help files...
220 mxmldoc --section "Programming" --title "Raster API" \
221 --css ../doc/cups-printable.css \
222 --header api-raster.header --intro api-raster.shtml \
223 ../cups/raster.h interpret.c raster.c \
224 >../doc/help/api-raster.html
225
226 framedhelp:
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 \
232 ../cups/raster.h interpret.c raster.c
233
234
235 #
236 # commandtops
237 #
238
239 commandtops: commandtops.o ../cups/$(LIBCUPS)
240 echo Linking $@...
241 $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
242
243
244 #
245 # formtops
246 #
247
248 formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
249 echo Linking $@...
250 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
251
252
253 #
254 # gziptoany
255 #
256
257 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
258 echo Linking $@...
259 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
260
261
262 #
263 # hpgltops
264 #
265
266 hpgltops: $(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
275 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
276 echo Linking $@...
277 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
278 -L../cups $(LINKCUPS) -lm
279 $(RM) `basename $@ .2`
280 $(LN) $@ `basename $@ .2`
281
282
283 #
284 # 32bit/libcupsimage.so.2
285 #
286
287 32bit/libcupsimage.so.2: $(IMAGE32OBJS)
288 echo Linking 32-bit $@...
289 -mkdir 32bit
290 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
291 -L../cups/32bit $(LINKCUPS) -lm
292
293
294 #
295 # 64bit/libcupsimage.so.2
296 #
297
298 64bit/libcupsimage.so.2: $(IMAGE64OBJS)
299 echo Linking 64-bit $@...
300 -mkdir 64bit
301 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
302 -L../cups/64bit $(LINKCUPS) -lm
303
304
305 #
306 # libcupsimage.2.dylib
307 #
308
309 libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
310 echo Linking $@...
311 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
312 -install_name $(libdir)/$@ \
313 -current_version 2.3.0 \
314 -compatibility_version 2.0.0 \
315 -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
316 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
317 $(RM) libcupsimage.dylib
318 $(LN) $@ libcupsimage.dylib
319
320
321 #
322 # libcupsimage_s.a
323 #
324
325 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
326 echo Linking $@...
327 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
328 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
329 $(RM) $@
330 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
331
332
333 #
334 # libcupsimage.la
335 #
336
337 libcupsimage.la: $(IMAGEOBJS)
338 echo Linking $@...
339 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
340 -L../cups $(LINKCUPS) \
341 -rpath $(LIBDIR) -version-info 2:3
342
343
344 #
345 # libcupsimage.a
346 #
347
348 libcupsimage.a: $(IMAGEOBJS)
349 echo Archiving $@...
350 $(RM) $@
351 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
352 $(RANLIB) $@
353
354
355 #
356 # testimage
357 #
358
359 testimage: 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
369 imagetops: 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
380 imagetoraster: 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
391 pstops: pstops.o common.o ../cups/$(LIBCUPS)
392 echo Linking $@...
393 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
394
395
396 #
397 # pdftops
398 #
399
400 pdftops: pdftops.o common.o ../cups/$(LIBCUPS)
401 echo Linking $@...
402 $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
403
404
405 #
406 # rastertolabel
407 #
408
409 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
410 echo Linking $@...
411 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
412
413
414 #
415 # rastertoepson
416 #
417
418 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
419 echo Linking $@...
420 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
421
422
423 #
424 # rastertohp
425 #
426
427 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
428 echo Linking $@...
429 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
430
431
432 #
433 # testraster
434 #
435
436 testraster: testraster.o ../cups/libcups.a libcupsimage.a
437 echo Linking $@...
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
443
444
445 #
446 # rasterbench
447 #
448
449 rasterbench: rasterbench.o libcupsimage.a
450 echo Linking $@...
451 $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
452
453
454 #
455 # texttops
456 #
457
458 texttops: 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
468 include Dependencies
469
470
471 #
472 # End of "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $".
473 #