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