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