]> git.ipfire.org Git - thirdparty/cups.git/blob - driver/Makefile
Merge changes from CUPS 1.5svn-r9105.
[thirdparty/cups.git] / driver / Makefile
1 #
2 # "$Id$"
3 #
4 # Makefile for the CUPS base drivers.
5 #
6 # Copyright 2007-2010 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 FILTERS = \
55 commandtoescpx \
56 commandtopclx \
57 rastertoescpx \
58 rastertopclx
59 TARGETS = \
60 $(LIBTARGETS) \
61 $(FILTERS)
62
63
64 #
65 # Make everything...
66 #
67
68 all: $(TARGETS)
69
70
71 #
72 # Make library targets...
73 #
74
75 libs: $(LIBTARGETS)
76
77
78 #
79 # Make unit tests...
80 #
81
82 unittests: $(UNITTARGETS)
83
84
85 #
86 # Clean everything...
87 #
88
89 clean:
90 $(RM) $(OBJS) core
91 $(RM) *.bck core.*
92 $(RM) $(TARGETS) $(UNITTARGETS)
93 $(RM) -r test
94 $(RM) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
95
96
97 #
98 # Update dependencies...
99 #
100
101 depend:
102 makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1
103
104
105 #
106 # Install all targets...
107 #
108
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:
124 $(INSTALL_DIR) $(SERVERBIN)/filter
125 for file in $(FILTERS); do \
126 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
127 done
128 if test "x$(SYMROOT)" != "x"; then \
129 $(INSTALL_DIR) $(SYMROOT); \
130 for file in $(FILTERS); do \
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
143 $(INSTALL_DATA) driver.h $(INCLUDEDIR)/cups
144
145
146 #
147 # Install libraries...
148 #
149
150 install-libs: $(INSTALLSTATIC)
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 \
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)
169 $(INSTALL_LIB) -m 755 libcupsdriver.a $(LIBDIR)
170 $(RANLIB) $(LIBDIR)/libcupsdriver.a
171 $(CHMOD) 555 $(LIBDIR)/libcupsdriver.a
172
173
174 #
175 # Uninstall...
176 #
177
178 uninstall:
179 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
180 $(RM) $(SERVERBIN)/filter/$$file; \
181 done
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)
191 $(RM) $(INCLUDEDIR)/cups/driver.h
192 -$(RMDIR) $(INCLUDEDIR)/cups
193
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 \
204 api-driver.xml \
205 driver.h $(LIBOBJS:.o=.c) >../doc/help/api-driver.html
206 mxmldoc --tokens help/api-driver.html >../doc/help/api-driver.tokens
207 $(RM) api-driver.xml
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
222 commandtopclx: commandtopclx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
223 echo Linking $@...
224 $(CC) $(LDFLAGS) -o $@ commandtopclx.o -L. -lcupsdriver $(LIBS)
225
226
227 #
228 # commandtoescpx, the ESC/P command printer driver.
229 #
230
231 commandtoescpx: commandtoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
232 echo Linking $@...
233 $(CC) $(LDFLAGS) -o $@ commandtoescpx.o -L. -lcupsdriver $(LIBS)
234
235
236 #
237 # rastertoescpx, the ESC/P raster printer driver.
238 #
239
240 rastertoescpx: rastertoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
241 echo Linking $@...
242 $(CC) $(LDFLAGS) -o $@ rastertoescpx.o -L. -lcupsdriver \
243 $(LINKCUPSIMAGE) $(LIBS)
244
245
246 #
247 # rastertopclx, the ESC/P raster printer driver.
248 #
249
250 rastertopclx: rastertopclx.o pcl-common.o $(LIBCUPSDRIVER) \
251 ../cups/$(LIBCUPS)
252 echo Linking $@...
253 $(CC) $(LDFLAGS) -o $@ rastertopclx.o pcl-common.o -L. -lcupsdriver \
254 $(LINKCUPSIMAGE) $(LIBS)
255
256
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
268 #
269 # testcmyk, test cmyk separation functions.
270 #
271
272 testcmyk: test testcmyk.o libcupsdriver.a ../cups/$(LIBCUPSSTATIC)
273 echo Linking $@...
274 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcmyk.o libcupsdriver.a \
275 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
276 $(COMMONLIBS) $(LIBZ)
277 echo Running CMYK API tests...
278 ./testcmyk > test/testcmyk.log
279
280
281 #
282 # testdither, test dithering functions.
283 #
284
285 testdither: test testdither.o libcupsdriver.a ../cups/$(LIBCUPSSTATIC)
286 echo Linking $@...
287 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testdither.o libcupsdriver.a \
288 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
289 $(COMMONLIBS) $(LIBZ)
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
299
300
301 #
302 # testrgb, test RGB separation functions.
303 #
304
305 testrgb: test testrgb.o libcupsdriver.a ../cups/$(LIBCUPSSTATIC)
306 echo Linking $@...
307 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testrgb.o libcupsdriver.a \
308 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
309 $(COMMONLIBS) $(LIBZ)
310 echo Running RGB API tests...
311 ./testrgb > test/testrgb.log 2>&1 || echo "RGB tests failed!"
312
313
314 #
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
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
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 #