4 # Makefile for the CUPS base drivers.
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 2002-2005 by Easy Software Products.
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/".
17 # Include standard definitions...
36 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
37 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
76 # Make library targets...
91 $(RM
) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
96 # Update dependencies...
100 touch Dependencies.tmp
101 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
103 cp Dependencies.tmp Dependencies
104 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
105 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
106 $(RM
) Dependencies.tmp
110 # Install all targets...
113 install: all install-data install-headers install-libs install-exec
117 # Install data files...
124 # Install programs...
128 $(INSTALL_DIR
) $(SERVERBIN
)/filter
129 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
130 $(INSTALL_BIN
) $$file $(SERVERBIN
)/filter; \
132 if
test "x$(SYMROOT)" != "x"; then \
133 $(INSTALL_DIR
) $(SYMROOT
); \
134 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
135 cp
$$file $(SYMROOT
); \
145 echo Installing header files in
$(INCLUDEDIR
)/cups...
146 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
147 $(INSTALL_DATA
) driver.h
$(INCLUDEDIR
)/cups
151 # Install libraries...
154 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
155 echo Installing libraries in
$(LIBDIR
)...
156 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
157 $(INSTALL_LIB
) $(LIBCUPSDRIVER
) $(LIBDIR
)
158 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.so.1" -o
$(LIBCUPSDRIVER
) = "libcupsdriver.sl.1"; then \
159 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
160 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
162 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.1.dylib"; then \
163 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
; \
164 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/libcupsdriver.dylib
; \
166 if
test "x$(SYMROOT)" != "x"; then \
167 $(INSTALL_DIR
) $(SYMROOT
); \
168 cp
$(LIBCUPSDRIVER
) $(SYMROOT
); \
172 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
173 $(INSTALL_LIB
) libcupsdriver.a
$(LIBDIR
)
174 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
177 echo Installing libraries in
$(LIB32DIR
)...
178 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
179 $(INSTALL_LIB
) 32bit
/libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
.1
180 $(LN
) libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
183 echo Installing libraries in
$(LIB64DIR
)...
184 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
185 $(INSTALL_LIB
) 64bit
/libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
.1
186 $(LN
) libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
193 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
194 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
195 $(RM
) $(SERVERBIN
)/filter/$$file; \
197 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
198 $(RM
) $(LIBDIR
)/libcupsdriver.a
199 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
200 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
201 $(RM
) $(LIBDIR
)/libcupsdriver.sl
202 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
203 $(RM
) $(LIBDIR
)/libcupsdriver.so
204 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
206 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
207 -$(RMDIR
) $(INCLUDEDIR
)/cups
210 $(RM
) $(LIB32DIR
)/libcupsdriver.so
211 $(RM
) $(LIB32DIR
)/libcupsdriver.so
.1
212 -$(RMDIR
) $(LIB32DIR
)
215 $(RM
) $(LIB64DIR
)/libcupsdriver.so
216 $(RM
) $(LIB64DIR
)/libcupsdriver.so
.1
217 -$(RMDIR
) $(LIB64DIR
)
221 # Automatic API help files...
225 mxmldoc
--section
"Programming" \
226 --title
"Printer Driver API" \
227 --css ..
/doc
/cups-printable.css \
228 --header api-driver.header
--intro api-driver.shtml \
229 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
232 mxmldoc
--framed api-driver \
233 --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
)
241 # commandtopclx, the PCL command printer driver.
244 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
246 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
250 # commandtoescpx, the ESC/P command printer driver.
253 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
255 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
259 # rastertoescpx, the ESC/P raster printer driver.
262 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
264 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
265 $(LINKCUPSIMAGE
) $(LIBS
)
269 # rastertopclx, the ESC/P raster printer driver.
272 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
275 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
276 $(LINKCUPSIMAGE
) $(LIBS
)
280 # testcmyk, test cmyk separation functions.
283 testcmyk
: testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
285 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a \
286 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
287 if
test ! -d
test; then \
290 echo Running CMYK API tests...
291 .
/testcmyk
> test/testcmyk.log
295 # testdither, test dithering functions.
298 testdither
: testdither.o libcupsdriver.a ..
/cups
/libcups.a
300 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a \
301 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
302 if
test ! -d
test; then \
305 echo Running dither API tests...
306 .
/testdither
> test/0-255.pgm
2>test/0-255.log
307 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
308 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
309 .
/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
310 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
311 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
312 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
313 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
317 # testrgb, test RGB separation functions.
320 testrgb
: testrgb.o libcupsdriver.a ..
/cups
/libcups.a
322 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a \
323 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
324 if
test ! -d
test; then \
327 echo Running RGB API tests...
328 .
/testrgb
> test/testrgb.log
2>&1 || echo
"RGB tests failed!"
332 # libcupsdriver.so.1, libcupsdriver.sl.1
335 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
337 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
338 $(RM
) `basename $@ .1`
339 $(LN
) $@
`basename $@ .1`
343 # 32bit/libcupsdriver.so.1
346 32bit
/libcupsdriver.so
.1: $(LIB32OBJS
)
347 echo Linking
32-bit
$@...
349 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
350 $(RM
) 32bit
/libcupsdriver.so
351 $(LN
) libcupsdriver.so
.1 32bit
/libcupsdriver.so
355 # 64bit/libcupsdriver.so.1
358 64bit
/libcupsdriver.so
.1: $(LIB64OBJS
)
359 echo Linking
64-bit
$@...
361 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
362 $(RM
) 64bit
/libcupsdriver.so
363 $(LN
) libcupsdriver.so
.1 64bit
/libcupsdriver.so
367 # libcupsdriver.1.dylib
370 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
372 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
373 -install_name
$(libdir)/$@ \
374 -current_version
1.0.0 \
375 -compatibility_version
1.0.0 \
376 -exported_symbols_list libcupsdriver.exp \
378 $(RM
) libcupsdriver.dylib
379 $(LN
) $@ libcupsdriver.dylib
386 libcupsdriver_s.a
: $(LIBOBJS
)
388 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
390 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
397 libcupsdriver.la
: $(LIBOBJS
)
399 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
400 -version-info
1:0 $(LIBS
)
407 libcupsdriver.a
: $(LIBOBJS
)
410 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
415 # Include dependencies...