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