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