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