]> git.ipfire.org Git - thirdparty/cups.git/blob - driver/Makefile
Merge changes from CUPS 1.4svn-r7607.
[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 test
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 # test, make a common test subdirectory for the other test programs.
281 #
282
283 test:
284 if test ! -d test; then \
285 rm -rf test; \
286 mkdir test; \
287 fi
288
289
290 #
291 # testcmyk, test cmyk separation functions.
292 #
293
294 testcmyk: test testcmyk.o libcupsdriver.a ../cups/libcups.a
295 echo Linking $@...
296 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcmyk.o libcupsdriver.a \
297 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
298 echo Running CMYK API tests...
299 ./testcmyk > test/testcmyk.log
300
301
302 #
303 # testdither, test dithering functions.
304 #
305
306 testdither: test testdither.o libcupsdriver.a ../cups/libcups.a
307 echo Linking $@...
308 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testdither.o libcupsdriver.a \
309 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
310 echo Running dither API tests...
311 ./testdither > test/0-255.pgm 2>test/0-255.log
312 ./testdither 0 127 255 > test/0-127-255.pgm 2>test/0-127-255.log
313 ./testdither 0 85 170 255 > test/0-85-170-255.pgm 2>test/0-85-170-255.log
314 ./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
315 ./testdither 0 210 383 > test/0-210-383.pgm 2>test/0-210-383.log
316 ./testdither 0 82 255 > test/0-82-255.pgm 2>test/0-82-255.log
317 ./testdither 0 510 > test/0-510.pgm 2>test/0-510.log
318 ./testdither 0 1020 > test/0-1020.pgm 2>test/0-1020.log
319
320
321 #
322 # testrgb, test RGB separation functions.
323 #
324
325 testrgb: test testrgb.o libcupsdriver.a ../cups/libcups.a
326 echo Linking $@...
327 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testrgb.o libcupsdriver.a \
328 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
329 echo Running RGB API tests...
330 ./testrgb > test/testrgb.log 2>&1 || echo "RGB tests failed!"
331
332
333 #
334 # libcupsdriver.so.1, libcupsdriver.sl.1
335 #
336
337 libcupsdriver.so.1 libcupsdriver.sl.1: $(LIBOBJS)
338 echo Linking $@...
339 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
340 $(RM) `basename $@ .1`
341 $(LN) $@ `basename $@ .1`
342
343
344 #
345 # 32bit/libcupsdriver.so.1
346 #
347
348 32bit/libcupsdriver.so.1: $(LIB32OBJS)
349 echo Linking 32-bit $@...
350 -mkdir 32bit
351 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS)
352 $(RM) 32bit/libcupsdriver.so
353 $(LN) libcupsdriver.so.1 32bit/libcupsdriver.so
354
355
356 #
357 # 64bit/libcupsdriver.so.1
358 #
359
360 64bit/libcupsdriver.so.1: $(LIB64OBJS)
361 echo Linking 64-bit $@...
362 -mkdir 64bit
363 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS)
364 $(RM) 64bit/libcupsdriver.so
365 $(LN) libcupsdriver.so.1 64bit/libcupsdriver.so
366
367
368 #
369 # libcupsdriver.1.dylib
370 #
371
372 libcupsdriver.1.dylib: $(LIBOBJS) libcupsdriver.exp
373 echo Linking $@...
374 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
375 -install_name $(libdir)/$@ \
376 -current_version 1.0.0 \
377 -compatibility_version 1.0.0 \
378 -exported_symbols_list libcupsdriver.exp \
379 $(LIBOBJS) $(LIBS)
380 $(RM) libcupsdriver.dylib
381 $(LN) $@ libcupsdriver.dylib
382
383
384 #
385 # libcupsdriver_s.a
386 #
387
388 libcupsdriver_s.a: $(LIBOBJS)
389 echo Creating $@...
390 $(DSO) $(DSOFLAGS) -o libcupsdriver_s.o $(LIBOBJS) $(LIBS)
391 $(RM) $@
392 $(AR) $(ARFLAGS) $@ libcupsdriver_s.o
393
394
395 #
396 # libcupsdriver.la
397 #
398
399 libcupsdriver.la: $(LIBOBJS)
400 echo Linking $@...
401 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
402 -version-info 1:0 $(LIBS)
403
404
405 #
406 # libcupsdriver.a
407 #
408
409 libcupsdriver.a: $(LIBOBJS)
410 echo Archiving $@...
411 $(RM) $@
412 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
413 $(RANLIB) $@
414
415
416 #
417 # Include dependencies...
418 #
419
420 include Dependencies
421
422
423 #
424 # End of "$Id$".
425 #