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