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