]> git.ipfire.org Git - thirdparty/cups.git/blame - driver/Makefile
Merge changes from CUPS 1.4svn-r8088, the real official 1.4b1!
[thirdparty/cups.git] / driver / Makefile
CommitLineData
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
20include ../Makedefs
21
22
23#
24# Object files...
25#
26
27LIBOBJS = \
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
36LIB32OBJS = $(LIBOBJS:.o=.32.o)
37LIB64OBJS = $(LIBOBJS:.o=.64.o)
ac884b6a
MS
38
39OBJS = \
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 51
c9fc04c6 52LIBTARGETS = \
50fe7201
MS
53 $(LIBCUPSDRIVER) \
54 $(LIB32CUPSDRIVER) \
55 $(LIB64CUPSDRIVER) \
9a4f8274
MS
56 libcupsdriver.a
57UNITTARGETS = \
ac884b6a
MS
58 testcmyk \
59 testdither \
60 testrgb
c9fc04c6
MS
61TARGETS = \
62 $(LIBTARGETS) \
63 commandtoescpx \
64 commandtopclx \
65 rastertoescpx \
66 rastertopclx
ac884b6a
MS
67
68
69#
70# Make everything...
71#
72
73all: $(TARGETS)
74
75
c9fc04c6
MS
76#
77# Make library targets...
78#
79
80libs: $(LIBTARGETS)
81
82
5f64df29
MS
83#
84# Make unit tests...
85#
86
9a4f8274 87unittests: $(UNITTARGETS)
5f64df29
MS
88
89
ac884b6a
MS
90#
91# Clean everything...
92#
93
94clean:
95 $(RM) $(OBJS) core
96 $(RM) *.bck core.*
9a4f8274 97 $(RM) $(TARGETS) $(UNITTARGETS)
bdd6c45b 98 $(RM) -r test
50fe7201
MS
99 $(RM) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
100 $(RM) -r 32bit 64bit
ac884b6a
MS
101
102
103#
104# Update dependencies...
105#
106
107depend:
50fe7201
MS
108 touch Dependencies.tmp
109 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
110 $(RM) Dependencies
111 cp Dependencies.tmp Dependencies
112 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
113 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
114 $(RM) Dependencies.tmp
ac884b6a
MS
115
116
117#
50fe7201 118# Install all targets...
ac884b6a
MS
119#
120
50fe7201
MS
121install: all install-data install-headers install-libs install-exec
122
123
124#
125# Install data files...
126#
127
128install-data:
129
130
131#
132# Install programs...
133#
134
135install-exec:
ac884b6a
MS
136 $(INSTALL_DIR) $(SERVERBIN)/filter
137 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
138 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
139 done
50fe7201
MS
140 if test "x$(SYMROOT)" != "x"; then \
141 $(INSTALL_DIR) $(SYMROOT); \
142 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
143 cp $$file $(SYMROOT); \
144 done \
145 fi
146
147
148#
149# Install headers...
150#
151
152install-headers:
153 echo Installing header files in $(INCLUDEDIR)/cups...
154 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
ac884b6a
MS
155 $(INSTALL_DATA) driver.h $(INCLUDEDIR)/cups
156
157
50fe7201
MS
158#
159# Install libraries...
160#
161
162install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
163 echo Installing libraries in $(LIBDIR)...
164 $(INSTALL_DIR) -m 755 $(LIBDIR)
165 $(INSTALL_LIB) $(LIBCUPSDRIVER) $(LIBDIR)
166 if test $(LIBCUPSDRIVER) = "libcupsdriver.so.1" -o $(LIBCUPSDRIVER) = "libcupsdriver.sl.1"; then \
167 $(RM) $(LIBDIR)/`basename $(LIBCUPSDRIVER) .1`; \
168 $(LN) $(LIBCUPSDRIVER) $(LIBDIR)/`basename $(LIBCUPSDRIVER) .1`; \
169 fi
170 if test $(LIBCUPSDRIVER) = "libcupsdriver.1.dylib"; then \
50fe7201
MS
171 $(RM) $(LIBDIR)/libcupsdriver.dylib; \
172 $(LN) $(LIBCUPSDRIVER) $(LIBDIR)/libcupsdriver.dylib; \
173 fi
174 if test "x$(SYMROOT)" != "x"; then \
175 $(INSTALL_DIR) $(SYMROOT); \
176 cp $(LIBCUPSDRIVER) $(SYMROOT); \
177 fi
178
179installstatic:
180 $(INSTALL_DIR) -m 755 $(LIBDIR)
181 $(INSTALL_LIB) libcupsdriver.a $(LIBDIR)
182 $(RANLIB) $(LIBDIR)/libcupsdriver.a
183
184install32bit:
185 echo Installing libraries in $(LIB32DIR)...
186 $(INSTALL_DIR) -m 755 $(LIB32DIR)
187 $(INSTALL_LIB) 32bit/libcupsdriver.so.1 $(LIB32DIR)/libcupsdriver.so.1
188 $(LN) libcupsdriver.so.1 $(LIB32DIR)/libcupsdriver.so
189
190install64bit:
191 echo Installing libraries in $(LIB64DIR)...
192 $(INSTALL_DIR) -m 755 $(LIB64DIR)
193 $(INSTALL_LIB) 64bit/libcupsdriver.so.1 $(LIB64DIR)/libcupsdriver.so.1
194 $(LN) libcupsdriver.so.1 $(LIB64DIR)/libcupsdriver.so
195
196
ac884b6a
MS
197#
198# Uninstall...
199#
200
50fe7201 201uninstall: $(UNINSTALL32) $(UNINSTALL64)
ac884b6a
MS
202 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx; do \
203 $(RM) $(SERVERBIN)/filter/$$file; \
204 done
50fe7201
MS
205 $(RM) $(LIBDIR)/libcupsdriver.1.dylib
206 $(RM) $(LIBDIR)/libcupsdriver.a
207 $(RM) $(LIBDIR)/libcupsdriver.dylib
208 $(RM) $(LIBDIR)/libcupsdriver_s.a
209 $(RM) $(LIBDIR)/libcupsdriver.sl
210 $(RM) $(LIBDIR)/libcupsdriver.sl.1
211 $(RM) $(LIBDIR)/libcupsdriver.so
212 $(RM) $(LIBDIR)/libcupsdriver.so.1
213 -$(RMDIR) $(LIBDIR)
ac884b6a 214 $(RM) $(INCLUDEDIR)/cups/driver.h
50fe7201
MS
215 -$(RMDIR) $(INCLUDEDIR)/cups
216
217uninstall32bit:
218 $(RM) $(LIB32DIR)/libcupsdriver.so
219 $(RM) $(LIB32DIR)/libcupsdriver.so.1
220 -$(RMDIR) $(LIB32DIR)
221
222uninstall64bit:
223 $(RM) $(LIB64DIR)/libcupsdriver.so
224 $(RM) $(LIB64DIR)/libcupsdriver.so.1
225 -$(RMDIR) $(LIB64DIR)
ac884b6a
MS
226
227
228#
229# Automatic API help files...
230#
231
232apihelp:
233 mxmldoc --section "Programming" \
234 --title "Printer Driver API" \
235 --css ../doc/cups-printable.css \
236 --header api-driver.header --intro api-driver.shtml \
237 driver.h $(LIBOBJS:.o=.c) >../doc/help/api-driver.html
238
239framedhelp:
240 mxmldoc --framed api-driver \
241 --section "Programming" \
242 --title "Printer Driver API" \
243 --css ../doc/cups-printable.css \
244 --header api-driver.header --intro api-driver.shtml \
245 driver.h $(LIBOBJS:.o=.c)
246
247
248#
249# commandtopclx, the PCL command printer driver.
250#
251
50fe7201 252commandtopclx: commandtopclx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
ac884b6a 253 echo Linking $@...
50fe7201 254 $(CC) $(LDFLAGS) -o $@ commandtopclx.o -L. -lcupsdriver $(LIBS)
ac884b6a
MS
255
256
257#
258# commandtoescpx, the ESC/P command printer driver.
259#
260
50fe7201 261commandtoescpx: commandtoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
ac884b6a 262 echo Linking $@...
50fe7201 263 $(CC) $(LDFLAGS) -o $@ commandtoescpx.o -L. -lcupsdriver $(LIBS)
ac884b6a
MS
264
265
266#
267# rastertoescpx, the ESC/P raster printer driver.
268#
269
50fe7201 270rastertoescpx: rastertoescpx.o $(LIBCUPSDRIVER) ../cups/$(LIBCUPS)
ac884b6a 271 echo Linking $@...
50fe7201 272 $(CC) $(LDFLAGS) -o $@ rastertoescpx.o -L. -lcupsdriver \
ac884b6a
MS
273 $(LINKCUPSIMAGE) $(LIBS)
274
275
276#
277# rastertopclx, the ESC/P raster printer driver.
278#
279
50fe7201 280rastertopclx: rastertopclx.o pcl-common.o $(LIBCUPSDRIVER) \
ac884b6a
MS
281 ../cups/$(LIBCUPS)
282 echo Linking $@...
50fe7201 283 $(CC) $(LDFLAGS) -o $@ rastertopclx.o pcl-common.o -L. -lcupsdriver \
ac884b6a
MS
284 $(LINKCUPSIMAGE) $(LIBS)
285
286
bdd6c45b
MS
287#
288# test, make a common test subdirectory for the other test programs.
289#
290
291test:
292 if test ! -d test; then \
293 rm -rf test; \
294 mkdir test; \
295 fi
296
297
ac884b6a
MS
298#
299# testcmyk, test cmyk separation functions.
300#
301
bdd6c45b 302testcmyk: test testcmyk.o libcupsdriver.a ../cups/libcups.a
ac884b6a 303 echo Linking $@...
c9fc04c6
MS
304 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcmyk.o libcupsdriver.a \
305 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
306 echo Running CMYK API tests...
307 ./testcmyk > test/testcmyk.log
ac884b6a
MS
308
309
310#
311# testdither, test dithering functions.
312#
313
bdd6c45b 314testdither: test testdither.o libcupsdriver.a ../cups/libcups.a
ac884b6a 315 echo Linking $@...
c9fc04c6
MS
316 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testdither.o libcupsdriver.a \
317 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
318 echo Running dither API tests...
319 ./testdither > test/0-255.pgm 2>test/0-255.log
320 ./testdither 0 127 255 > test/0-127-255.pgm 2>test/0-127-255.log
321 ./testdither 0 85 170 255 > test/0-85-170-255.pgm 2>test/0-85-170-255.log
322 ./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
323 ./testdither 0 210 383 > test/0-210-383.pgm 2>test/0-210-383.log
324 ./testdither 0 82 255 > test/0-82-255.pgm 2>test/0-82-255.log
325 ./testdither 0 510 > test/0-510.pgm 2>test/0-510.log
326 ./testdither 0 1020 > test/0-1020.pgm 2>test/0-1020.log
ac884b6a
MS
327
328
329#
330# testrgb, test RGB separation functions.
331#
332
bdd6c45b 333testrgb: test testrgb.o libcupsdriver.a ../cups/libcups.a
ac884b6a 334 echo Linking $@...
c9fc04c6
MS
335 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testrgb.o libcupsdriver.a \
336 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6 337 echo Running RGB API tests...
a0f6818e 338 ./testrgb > test/testrgb.log 2>&1 || echo "RGB tests failed!"
ac884b6a
MS
339
340
341#
50fe7201
MS
342# libcupsdriver.so.1, libcupsdriver.sl.1
343#
344
345libcupsdriver.so.1 libcupsdriver.sl.1: $(LIBOBJS)
346 echo Linking $@...
347 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
348 $(RM) `basename $@ .1`
349 $(LN) $@ `basename $@ .1`
350
351
352#
353# 32bit/libcupsdriver.so.1
354#
355
35632bit/libcupsdriver.so.1: $(LIB32OBJS)
357 echo Linking 32-bit $@...
358 -mkdir 32bit
359 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS)
360 $(RM) 32bit/libcupsdriver.so
361 $(LN) libcupsdriver.so.1 32bit/libcupsdriver.so
362
363
364#
365# 64bit/libcupsdriver.so.1
366#
367
36864bit/libcupsdriver.so.1: $(LIB64OBJS)
369 echo Linking 64-bit $@...
370 -mkdir 64bit
371 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS)
372 $(RM) 64bit/libcupsdriver.so
373 $(LN) libcupsdriver.so.1 64bit/libcupsdriver.so
374
375
376#
377# libcupsdriver.1.dylib
378#
379
380libcupsdriver.1.dylib: $(LIBOBJS) libcupsdriver.exp
381 echo Linking $@...
382 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
383 -install_name $(libdir)/$@ \
384 -current_version 1.0.0 \
385 -compatibility_version 1.0.0 \
386 -exported_symbols_list libcupsdriver.exp \
387 $(LIBOBJS) $(LIBS)
388 $(RM) libcupsdriver.dylib
389 $(LN) $@ libcupsdriver.dylib
390
391
392#
393# libcupsdriver_s.a
394#
395
396libcupsdriver_s.a: $(LIBOBJS)
397 echo Creating $@...
398 $(DSO) $(DSOFLAGS) -o libcupsdriver_s.o $(LIBOBJS) $(LIBS)
399 $(RM) $@
400 $(AR) $(ARFLAGS) $@ libcupsdriver_s.o
401
402
403#
404# libcupsdriver.la
405#
406
407libcupsdriver.la: $(LIBOBJS)
408 echo Linking $@...
409 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
410 -version-info 1:0 $(LIBS)
411
412
413#
414# libcupsdriver.a
ac884b6a
MS
415#
416
417libcupsdriver.a: $(LIBOBJS)
418 echo Archiving $@...
419 $(RM) $@
420 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
421 $(RANLIB) $@
422
423
424#
425# Include dependencies...
426#
427
428include Dependencies
429
430
431#
432# End of "$Id$".
433#