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