]> git.ipfire.org Git - thirdparty/cups.git/blob - driver/Makefile
Merge changes from CUPS trunk, r7566.
[thirdparty/cups.git] / driver / Makefile
1 #
2 # "$Id$"
3 #
4 # Makefile for the CUPS base drivers.
5 #
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 2002-2005 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
16 #
17 # Include standard definitions...
18 #
19
20 include ../Makedefs
21
22
23 #
24 # Object files...
25 #
26
27 LIBOBJS = \
28 attr.o \
29 check.o \
30 cmyk.o \
31 dither.o \
32 lut.o \
33 pack.o \
34 rgb.o \
35 srgb.o
36 LIB32OBJS = $(LIBOBJS:.o=.32.o)
37 LIB64OBJS = $(LIBOBJS:.o=.64.o)
38
39 OBJS = \
40 commandtoescpx.o \
41 commandtopclx.o \
42 rastertoescpx.o \
43 rastertopclx.o \
44 pcl-common.o \
45 testcmyk.o \
46 testdither.o \
47 testrgb.o \
48 $(LIBOBJS) \
49 $(LIB32OBJS) \
50 $(LIB64OBJS)
51
52 LIBTARGETS = \
53 $(LIBCUPSDRIVER) \
54 $(LIB32CUPSDRIVER) \
55 $(LIB64CUPSDRIVER) \
56 libcupsdriver.a \
57 testcmyk \
58 testdither \
59 testrgb
60 TARGETS = \
61 $(LIBTARGETS) \
62 commandtoescpx \
63 commandtopclx \
64 rastertoescpx \
65 rastertopclx
66
67
68 #
69 # Make everything...
70 #
71
72 all: $(TARGETS)
73
74
75 #
76 # Make library targets...
77 #
78
79 libs: $(LIBTARGETS)
80
81
82 #
83 # Clean everything...
84 #
85
86 clean:
87 $(RM) $(OBJS) core
88 $(RM) *.bck core.*
89 $(RM) $(TARGETS)
90 $(RM) -r images
91 $(RM) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
92 $(RM) -r 32bit 64bit
93
94
95 #
96 # Update dependencies...
97 #
98
99 depend:
100 touch Dependencies.tmp
101 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
102 $(RM) Dependencies
103 cp Dependencies.tmp Dependencies
104 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
105 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
106 $(RM) Dependencies.tmp
107
108
109 #
110 # Install all targets...
111 #
112
113 install: all install-data install-headers install-libs install-exec
114
115
116 #
117 # Install data files...
118 #
119
120 install-data:
121
122
123 #
124 # Install programs...
125 #
126
127 install-exec:
128 $(INSTALL_DIR) $(SERVERBIN)/filter
129 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
130 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
131 done
132 if test "x$(SYMROOT)" != "x"; then \
133 $(INSTALL_DIR) $(SYMROOT); \
134 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
135 cp $$file $(SYMROOT); \
136 done \
137 fi
138
139
140 #
141 # Install headers...
142 #
143
144 install-headers:
145 echo Installing header files in $(INCLUDEDIR)/cups...
146 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
147 $(INSTALL_DATA) driver.h $(INCLUDEDIR)/cups
148
149
150 #
151 # Install libraries...
152 #
153
154 install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
155 echo Installing libraries in $(LIBDIR)...
156 $(INSTALL_DIR) -m 755 $(LIBDIR)
157 $(INSTALL_LIB) $(LIBCUPSDRIVER) $(LIBDIR)
158 if test $(LIBCUPSDRIVER) = "libcupsdriver.so.1" -o $(LIBCUPSDRIVER) = "libcupsdriver.sl.1"; then \
159 $(RM) $(LIBDIR)/`basename $(LIBCUPSDRIVER) .1`; \
160 $(LN) $(LIBCUPSDRIVER) $(LIBDIR)/`basename $(LIBCUPSDRIVER) .1`; \
161 fi
162 if test $(LIBCUPSDRIVER) = "libcupsdriver.1.dylib"; then \
163 $(RM) $(LIBDIR)/libcupsdriver.dylib; \
164 $(LN) $(LIBCUPSDRIVER) $(LIBDIR)/libcupsdriver.dylib; \
165 fi
166 if test "x$(SYMROOT)" != "x"; then \
167 $(INSTALL_DIR) $(SYMROOT); \
168 cp $(LIBCUPSDRIVER) $(SYMROOT); \
169 fi
170
171 installstatic:
172 $(INSTALL_DIR) -m 755 $(LIBDIR)
173 $(INSTALL_LIB) libcupsdriver.a $(LIBDIR)
174 $(RANLIB) $(LIBDIR)/libcupsdriver.a
175
176 install32bit:
177 echo Installing libraries in $(LIB32DIR)...
178 $(INSTALL_DIR) -m 755 $(LIB32DIR)
179 $(INSTALL_LIB) 32bit/libcupsdriver.so.1 $(LIB32DIR)/libcupsdriver.so.1
180 $(LN) libcupsdriver.so.1 $(LIB32DIR)/libcupsdriver.so
181
182 install64bit:
183 echo Installing libraries in $(LIB64DIR)...
184 $(INSTALL_DIR) -m 755 $(LIB64DIR)
185 $(INSTALL_LIB) 64bit/libcupsdriver.so.1 $(LIB64DIR)/libcupsdriver.so.1
186 $(LN) libcupsdriver.so.1 $(LIB64DIR)/libcupsdriver.so
187
188
189 #
190 # Uninstall...
191 #
192
193 uninstall: $(UNINSTALL32) $(UNINSTALL64)
194 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
195 $(RM) $(SERVERBIN)/filter/$$file; \
196 done
197 $(RM) $(LIBDIR)/libcupsdriver.1.dylib
198 $(RM) $(LIBDIR)/libcupsdriver.a
199 $(RM) $(LIBDIR)/libcupsdriver.dylib
200 $(RM) $(LIBDIR)/libcupsdriver_s.a
201 $(RM) $(LIBDIR)/libcupsdriver.sl
202 $(RM) $(LIBDIR)/libcupsdriver.sl.1
203 $(RM) $(LIBDIR)/libcupsdriver.so
204 $(RM) $(LIBDIR)/libcupsdriver.so.1
205 -$(RMDIR) $(LIBDIR)
206 $(RM) $(INCLUDEDIR)/cups/driver.h
207 -$(RMDIR) $(INCLUDEDIR)/cups
208
209 uninstall32bit:
210 $(RM) $(LIB32DIR)/libcupsdriver.so
211 $(RM) $(LIB32DIR)/libcupsdriver.so.1
212 -$(RMDIR) $(LIB32DIR)
213
214 uninstall64bit:
215 $(RM) $(LIB64DIR)/libcupsdriver.so
216 $(RM) $(LIB64DIR)/libcupsdriver.so.1
217 -$(RMDIR) $(LIB64DIR)
218
219
220 #
221 # Automatic API help files...
222 #
223
224 apihelp:
225 mxmldoc --section "Programming" \
226 --title "Printer Driver API" \
227 --css ../doc/cups-printable.css \
228 --header api-driver.header --intro api-driver.shtml \
229 driver.h $(LIBOBJS:.o=.c) >../doc/help/api-driver.html
230
231 framedhelp:
232 mxmldoc --framed api-driver \
233 --section "Programming" \
234 --title "Printer Driver API" \
235 --css ../doc/cups-printable.css \
236 --header api-driver.header --intro api-driver.shtml \
237 driver.h $(LIBOBJS:.o=.c)
238
239
240 #
241 # commandtopclx, the PCL command printer driver.
242 #
243
244 commandtopclx: commandtopclx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
245 echo Linking $@...
246 $(CC) $(LDFLAGS) -o $@ commandtopclx.o -L. -lcupsdriver $(LIBS)
247
248
249 #
250 # commandtoescpx, the ESC/P command printer driver.
251 #
252
253 commandtoescpx: commandtoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
254 echo Linking $@...
255 $(CC) $(LDFLAGS) -o $@ commandtoescpx.o -L. -lcupsdriver $(LIBS)
256
257
258 #
259 # rastertoescpx, the ESC/P raster printer driver.
260 #
261
262 rastertoescpx: rastertoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
263 echo Linking $@...
264 $(CC) $(LDFLAGS) -o $@ rastertoescpx.o -L. -lcupsdriver \
265 $(LINKCUPSIMAGE) $(LIBS)
266
267
268 #
269 # rastertopclx, the ESC/P raster printer driver.
270 #
271
272 rastertopclx: rastertopclx.o pcl-common.o $(LIBCUPSDRIVER) \
273 ../cups/$(LIBCUPS)
274 echo Linking $@...
275 $(CC) $(LDFLAGS) -o $@ rastertopclx.o pcl-common.o -L. -lcupsdriver \
276 $(LINKCUPSIMAGE) $(LIBS)
277
278
279 #
280 # testcmyk, test cmyk separation functions.
281 #
282
283 testcmyk: testcmyk.o libcupsdriver.a ../cups/libcups.a
284 echo Linking $@...
285 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcmyk.o libcupsdriver.a \
286 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
287 if test ! -d test; then \
288 mkdir test; \
289 fi
290 echo Running CMYK API tests...
291 ./testcmyk > test/testcmyk.log
292
293
294 #
295 # testdither, test dithering functions.
296 #
297
298 testdither: testdither.o libcupsdriver.a ../cups/libcups.a
299 echo Linking $@...
300 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testdither.o libcupsdriver.a \
301 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
302 if test ! -d test; then \
303 mkdir test; \
304 fi
305 echo Running dither API tests...
306 ./testdither > test/0-255.pgm 2>test/0-255.log
307 ./testdither 0 127 255 > test/0-127-255.pgm 2>test/0-127-255.log
308 ./testdither 0 85 170 255 > test/0-85-170-255.pgm 2>test/0-85-170-255.log
309 ./testdither 0 63 127 170 198 227 255 > test/0-63-127-170-198-227-255.pgm 2>test/0-63-127-170-198-227-255.log
310 ./testdither 0 210 383 > test/0-210-383.pgm 2>test/0-210-383.log
311 ./testdither 0 82 255 > test/0-82-255.pgm 2>test/0-82-255.log
312 ./testdither 0 510 > test/0-510.pgm 2>test/0-510.log
313 ./testdither 0 1020 > test/0-1020.pgm 2>test/0-1020.log
314
315
316 #
317 # testrgb, test RGB separation functions.
318 #
319
320 testrgb: testrgb.o libcupsdriver.a ../cups/libcups.a
321 echo Linking $@...
322 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testrgb.o libcupsdriver.a \
323 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
324 if test ! -d test; then \
325 mkdir test; \
326 fi
327 echo Running RGB API tests...
328 ./testrgb > test/testrgb.log 2>&1 || echo "RGB tests failed!"
329
330
331 #
332 # libcupsdriver.so.1, libcupsdriver.sl.1
333 #
334
335 libcupsdriver.so.1 libcupsdriver.sl.1: $(LIBOBJS)
336 echo Linking $@...
337 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
338 $(RM) `basename $@ .1`
339 $(LN) $@ `basename $@ .1`
340
341
342 #
343 # 32bit/libcupsdriver.so.1
344 #
345
346 32bit/libcupsdriver.so.1: $(LIB32OBJS)
347 echo Linking 32-bit $@...
348 -mkdir 32bit
349 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS)
350 $(RM) 32bit/libcupsdriver.so
351 $(LN) libcupsdriver.so.1 32bit/libcupsdriver.so
352
353
354 #
355 # 64bit/libcupsdriver.so.1
356 #
357
358 64bit/libcupsdriver.so.1: $(LIB64OBJS)
359 echo Linking 64-bit $@...
360 -mkdir 64bit
361 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS)
362 $(RM) 64bit/libcupsdriver.so
363 $(LN) libcupsdriver.so.1 64bit/libcupsdriver.so
364
365
366 #
367 # libcupsdriver.1.dylib
368 #
369
370 libcupsdriver.1.dylib: $(LIBOBJS) libcupsdriver.exp
371 echo Linking $@...
372 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
373 -install_name $(libdir)/$@ \
374 -current_version 1.0.0 \
375 -compatibility_version 1.0.0 \
376 -exported_symbols_list libcupsdriver.exp \
377 $(LIBOBJS) $(LIBS)
378 $(RM) libcupsdriver.dylib
379 $(LN) $@ libcupsdriver.dylib
380
381
382 #
383 # libcupsdriver_s.a
384 #
385
386 libcupsdriver_s.a: $(LIBOBJS)
387 echo Creating $@...
388 $(DSO) $(DSOFLAGS) -o libcupsdriver_s.o $(LIBOBJS) $(LIBS)
389 $(RM) $@
390 $(AR) $(ARFLAGS) $@ libcupsdriver_s.o
391
392
393 #
394 # libcupsdriver.la
395 #
396
397 libcupsdriver.la: $(LIBOBJS)
398 echo Linking $@...
399 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
400 -version-info 1:0 $(LIBS)
401
402
403 #
404 # libcupsdriver.a
405 #
406
407 libcupsdriver.a: $(LIBOBJS)
408 echo Archiving $@...
409 $(RM) $@
410 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
411 $(RANLIB) $@
412
413
414 #
415 # Include dependencies...
416 #
417
418 include Dependencies
419
420
421 #
422 # End of "$Id$".
423 #