]>
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 \ | |
154 | $(STRIP) -x $(LIBDIR)/$(LIBCUPSDRIVER); \ | |
155 | $(RM) $(LIBDIR)/libcupsdriver.dylib; \ | |
156 | $(LN) $(LIBCUPSDRIVER) $(LIBDIR)/libcupsdriver.dylib; \ | |
157 | fi | |
158 | if test "x$(SYMROOT)" != "x"; then \ | |
159 | $(INSTALL_DIR) $(SYMROOT); \ | |
160 | cp $(LIBCUPSDRIVER) $(SYMROOT); \ | |
161 | fi | |
162 | ||
163 | installstatic: | |
164 | $(INSTALL_DIR) -m 755 $(LIBDIR) | |
165 | $(INSTALL_LIB) libcupsdriver.a $(LIBDIR) | |
166 | $(RANLIB) $(LIBDIR)/libcupsdriver.a | |
167 | ||
168 | install32bit: | |
169 | echo Installing libraries in $(LIB32DIR)... | |
170 | $(INSTALL_DIR) -m 755 $(LIB32DIR) | |
171 | $(INSTALL_LIB) 32bit/libcupsdriver.so.1 $(LIB32DIR)/libcupsdriver.so.1 | |
172 | $(LN) libcupsdriver.so.1 $(LIB32DIR)/libcupsdriver.so | |
173 | ||
174 | install64bit: | |
175 | echo Installing libraries in $(LIB64DIR)... | |
176 | $(INSTALL_DIR) -m 755 $(LIB64DIR) | |
177 | $(INSTALL_LIB) 64bit/libcupsdriver.so.1 $(LIB64DIR)/libcupsdriver.so.1 | |
178 | $(LN) libcupsdriver.so.1 $(LIB64DIR)/libcupsdriver.so | |
179 | ||
180 | ||
ac884b6a MS |
181 | # |
182 | # Uninstall... | |
183 | # | |
184 | ||
50fe7201 | 185 | uninstall: $(UNINSTALL32) $(UNINSTALL64) |
ac884b6a MS |
186 | for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \ |
187 | $(RM) $(SERVERBIN)/filter/$$file; \ | |
188 | done | |
50fe7201 MS |
189 | $(RM) $(LIBDIR)/libcupsdriver.1.dylib |
190 | $(RM) $(LIBDIR)/libcupsdriver.a | |
191 | $(RM) $(LIBDIR)/libcupsdriver.dylib | |
192 | $(RM) $(LIBDIR)/libcupsdriver_s.a | |
193 | $(RM) $(LIBDIR)/libcupsdriver.sl | |
194 | $(RM) $(LIBDIR)/libcupsdriver.sl.1 | |
195 | $(RM) $(LIBDIR)/libcupsdriver.so | |
196 | $(RM) $(LIBDIR)/libcupsdriver.so.1 | |
197 | -$(RMDIR) $(LIBDIR) | |
ac884b6a | 198 | $(RM) $(INCLUDEDIR)/cups/driver.h |
50fe7201 MS |
199 | -$(RMDIR) $(INCLUDEDIR)/cups |
200 | ||
201 | uninstall32bit: | |
202 | $(RM) $(LIB32DIR)/libcupsdriver.so | |
203 | $(RM) $(LIB32DIR)/libcupsdriver.so.1 | |
204 | -$(RMDIR) $(LIB32DIR) | |
205 | ||
206 | uninstall64bit: | |
207 | $(RM) $(LIB64DIR)/libcupsdriver.so | |
208 | $(RM) $(LIB64DIR)/libcupsdriver.so.1 | |
209 | -$(RMDIR) $(LIB64DIR) | |
ac884b6a MS |
210 | |
211 | ||
212 | # | |
213 | # Automatic API help files... | |
214 | # | |
215 | ||
216 | apihelp: | |
217 | mxmldoc --section "Programming" \ | |
218 | --title "Printer Driver API" \ | |
219 | --css ../doc/cups-printable.css \ | |
220 | --header api-driver.header --intro api-driver.shtml \ | |
221 | driver.h $(LIBOBJS:.o=.c) >../doc/help/api-driver.html | |
222 | ||
223 | framedhelp: | |
224 | mxmldoc --framed api-driver \ | |
225 | --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) | |
230 | ||
231 | ||
232 | # | |
233 | # commandtopclx, the PCL command printer driver. | |
234 | # | |
235 | ||
50fe7201 | 236 | commandtopclx: commandtopclx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS) |
ac884b6a | 237 | echo Linking $@... |
50fe7201 | 238 | $(CC) $(LDFLAGS) -o $@ commandtopclx.o -L. -lcupsdriver $(LIBS) |
ac884b6a MS |
239 | |
240 | ||
241 | # | |
242 | # commandtoescpx, the ESC/P command printer driver. | |
243 | # | |
244 | ||
50fe7201 | 245 | commandtoescpx: commandtoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS) |
ac884b6a | 246 | echo Linking $@... |
50fe7201 | 247 | $(CC) $(LDFLAGS) -o $@ commandtoescpx.o -L. -lcupsdriver $(LIBS) |
ac884b6a MS |
248 | |
249 | ||
250 | # | |
251 | # rastertoescpx, the ESC/P raster printer driver. | |
252 | # | |
253 | ||
50fe7201 | 254 | rastertoescpx: rastertoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS) |
ac884b6a | 255 | echo Linking $@... |
50fe7201 | 256 | $(CC) $(LDFLAGS) -o $@ rastertoescpx.o -L. -lcupsdriver \ |
ac884b6a MS |
257 | $(LINKCUPSIMAGE) $(LIBS) |
258 | ||
259 | ||
260 | # | |
261 | # rastertopclx, the ESC/P raster printer driver. | |
262 | # | |
263 | ||
50fe7201 | 264 | rastertopclx: rastertopclx.o pcl-common.o $(LIBCUPSDRIVER) \ |
ac884b6a MS |
265 | ../cups/$(LIBCUPS) |
266 | echo Linking $@... | |
50fe7201 | 267 | $(CC) $(LDFLAGS) -o $@ rastertopclx.o pcl-common.o -L. -lcupsdriver \ |
ac884b6a MS |
268 | $(LINKCUPSIMAGE) $(LIBS) |
269 | ||
270 | ||
271 | # | |
272 | # testcmyk, test cmyk separation functions. | |
273 | # | |
274 | ||
275 | testcmyk: testcmyk.o libcupsdriver.a ../cups/libcups.a | |
276 | echo Linking $@... | |
277 | $(CC) $(LDFLAGS) -o $@ testcmyk.o libcupsdriver.a ../cups/libcups.a \ | |
278 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) | |
279 | if test ! -d test; then \ | |
280 | mkdir test; \ | |
281 | fi | |
282 | ./testcmyk > test/testcmyk.log 2>&1 | |
283 | ||
284 | ||
285 | # | |
286 | # testdither, test dithering functions. | |
287 | # | |
288 | ||
289 | testdither: testdither.o libcupsdriver.a ../cups/libcups.a | |
290 | echo Linking $@... | |
291 | $(CC) $(LDFLAGS) -o $@ testdither.o libcupsdriver.a ../cups/libcups.a \ | |
292 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) | |
293 | if test ! -d test; then \ | |
294 | mkdir test; \ | |
295 | fi | |
296 | ./testdither > test/0-255.pgm 2>test/0-255.log | |
297 | ./testdither 0 127 255 > test/0-127-255.pgm 2>test/0-127-255.log | |
298 | ./testdither 0 85 170 255 > test/0-85-170-255.pgm 2>test/0-85-170-255.log | |
299 | ./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 | |
300 | ./testdither 0 210 383 > test/0-210-383.pgm 2>test/0-210-383.log | |
301 | ./testdither 0 82 255 > test/0-82-255.pgm 2>test/0-82-255.log | |
302 | ./testdither 0 510 > test/0-510.pgm 2>test/0-510.log | |
303 | ./testdither 0 1020 > test/0-1020.pgm 2>test/0-1020.log | |
304 | ||
305 | ||
306 | # | |
307 | # testrgb, test RGB separation functions. | |
308 | # | |
309 | ||
310 | testrgb: testrgb.o libcupsdriver.a ../cups/libcups.a | |
311 | echo Linking $@... | |
312 | $(CC) $(LDFLAGS) -o $@ testrgb.o libcupsdriver.a ../cups/libcups.a \ | |
313 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) | |
314 | if test ! -d test; then \ | |
315 | mkdir test; \ | |
316 | fi | |
317 | ./testrgb > test/testrgb.log 2>&1 | |
318 | ||
319 | ||
320 | # | |
50fe7201 MS |
321 | # libcupsdriver.so.1, libcupsdriver.sl.1 |
322 | # | |
323 | ||
324 | libcupsdriver.so.1 libcupsdriver.sl.1: $(LIBOBJS) | |
325 | echo Linking $@... | |
326 | $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS) | |
327 | $(RM) `basename $@ .1` | |
328 | $(LN) $@ `basename $@ .1` | |
329 | ||
330 | ||
331 | # | |
332 | # 32bit/libcupsdriver.so.1 | |
333 | # | |
334 | ||
335 | 32bit/libcupsdriver.so.1: $(LIB32OBJS) | |
336 | echo Linking 32-bit $@... | |
337 | -mkdir 32bit | |
338 | $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS) | |
339 | $(RM) 32bit/libcupsdriver.so | |
340 | $(LN) libcupsdriver.so.1 32bit/libcupsdriver.so | |
341 | ||
342 | ||
343 | # | |
344 | # 64bit/libcupsdriver.so.1 | |
345 | # | |
346 | ||
347 | 64bit/libcupsdriver.so.1: $(LIB64OBJS) | |
348 | echo Linking 64-bit $@... | |
349 | -mkdir 64bit | |
350 | $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS) | |
351 | $(RM) 64bit/libcupsdriver.so | |
352 | $(LN) libcupsdriver.so.1 64bit/libcupsdriver.so | |
353 | ||
354 | ||
355 | # | |
356 | # libcupsdriver.1.dylib | |
357 | # | |
358 | ||
359 | libcupsdriver.1.dylib: $(LIBOBJS) libcupsdriver.exp | |
360 | echo Linking $@... | |
361 | $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \ | |
362 | -install_name $(libdir)/$@ \ | |
363 | -current_version 1.0.0 \ | |
364 | -compatibility_version 1.0.0 \ | |
365 | -exported_symbols_list libcupsdriver.exp \ | |
366 | $(LIBOBJS) $(LIBS) | |
367 | $(RM) libcupsdriver.dylib | |
368 | $(LN) $@ libcupsdriver.dylib | |
369 | ||
370 | ||
371 | # | |
372 | # libcupsdriver_s.a | |
373 | # | |
374 | ||
375 | libcupsdriver_s.a: $(LIBOBJS) | |
376 | echo Creating $@... | |
377 | $(DSO) $(DSOFLAGS) -o libcupsdriver_s.o $(LIBOBJS) $(LIBS) | |
378 | $(RM) $@ | |
379 | $(AR) $(ARFLAGS) $@ libcupsdriver_s.o | |
380 | ||
381 | ||
382 | # | |
383 | # libcupsdriver.la | |
384 | # | |
385 | ||
386 | libcupsdriver.la: $(LIBOBJS) | |
387 | echo Linking $@... | |
388 | $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \ | |
389 | -version-info 1:0 $(LIBS) | |
390 | ||
391 | ||
392 | # | |
393 | # libcupsdriver.a | |
ac884b6a MS |
394 | # |
395 | ||
396 | libcupsdriver.a: $(LIBOBJS) | |
397 | echo Archiving $@... | |
398 | $(RM) $@ | |
399 | $(AR) $(ARFLAGS) $@ $(LIBOBJS) | |
400 | $(RANLIB) $@ | |
401 | ||
402 | ||
403 | # | |
404 | # Include dependencies... | |
405 | # | |
406 | ||
407 | include Dependencies | |
408 | ||
409 | ||
410 | # | |
411 | # End of "$Id$". | |
412 | # |