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
)
82 $(RM
) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
87 # Update dependencies...
91 touch Dependencies.tmp
92 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
94 cp Dependencies.tmp Dependencies
95 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
96 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
97 $(RM
) Dependencies.tmp
101 # Install all targets...
104 install: all install-data install-headers install-libs install-exec
108 # Install data files...
115 # Install programs...
119 $(INSTALL_DIR
) $(SERVERBIN
)/filter
120 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
121 $(INSTALL_BIN
) $$file $(SERVERBIN
)/filter; \
123 if
test "x$(SYMROOT)" != "x"; then \
124 $(INSTALL_DIR
) $(SYMROOT
); \
125 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
126 cp
$$file $(SYMROOT
); \
136 echo Installing header files in
$(INCLUDEDIR
)/cups...
137 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
138 $(INSTALL_DATA
) driver.h
$(INCLUDEDIR
)/cups
142 # Install libraries...
145 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
146 echo Installing libraries in
$(LIBDIR
)...
147 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
148 $(INSTALL_LIB
) $(LIBCUPSDRIVER
) $(LIBDIR
)
149 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.so.1" -o
$(LIBCUPSDRIVER
) = "libcupsdriver.sl.1"; then \
150 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
151 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
153 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.1.dylib"; then \
154 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
; \
155 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/libcupsdriver.dylib
; \
157 if
test "x$(SYMROOT)" != "x"; then \
158 $(INSTALL_DIR
) $(SYMROOT
); \
159 cp
$(LIBCUPSDRIVER
) $(SYMROOT
); \
163 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
164 $(INSTALL_LIB
) libcupsdriver.a
$(LIBDIR
)
165 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
168 echo Installing libraries in
$(LIB32DIR
)...
169 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
170 $(INSTALL_LIB
) 32bit
/libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
.1
171 $(LN
) libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
174 echo Installing libraries in
$(LIB64DIR
)...
175 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
176 $(INSTALL_LIB
) 64bit
/libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
.1
177 $(LN
) libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
184 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
185 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
186 $(RM
) $(SERVERBIN
)/filter/$$file; \
188 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
189 $(RM
) $(LIBDIR
)/libcupsdriver.a
190 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
191 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
192 $(RM
) $(LIBDIR
)/libcupsdriver.sl
193 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
194 $(RM
) $(LIBDIR
)/libcupsdriver.so
195 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
197 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
198 -$(RMDIR
) $(INCLUDEDIR
)/cups
201 $(RM
) $(LIB32DIR
)/libcupsdriver.so
202 $(RM
) $(LIB32DIR
)/libcupsdriver.so
.1
203 -$(RMDIR
) $(LIB32DIR
)
206 $(RM
) $(LIB64DIR
)/libcupsdriver.so
207 $(RM
) $(LIB64DIR
)/libcupsdriver.so
.1
208 -$(RMDIR
) $(LIB64DIR
)
212 # Automatic API help files...
216 mxmldoc
--section
"Programming" \
217 --title
"Printer Driver API" \
218 --css ..
/doc
/cups-printable.css \
219 --header api-driver.header
--intro api-driver.shtml \
220 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
223 mxmldoc
--framed api-driver \
224 --section
"Programming" \
225 --title
"Printer Driver API" \
226 --css ..
/doc
/cups-printable.css \
227 --header api-driver.header
--intro api-driver.shtml \
228 driver.h
$(LIBOBJS
:.o
=.c
)
232 # commandtopclx, the PCL command printer driver.
235 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
237 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
241 # commandtoescpx, the ESC/P command printer driver.
244 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
246 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
250 # rastertoescpx, the ESC/P raster printer driver.
253 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
255 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
256 $(LINKCUPSIMAGE
) $(LIBS
)
260 # rastertopclx, the ESC/P raster printer driver.
263 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
266 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
267 $(LINKCUPSIMAGE
) $(LIBS
)
271 # testcmyk, test cmyk separation functions.
274 testcmyk
: testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
276 $(CC
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a ..
/cups
/libcups.a \
277 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
278 if
test ! -d
test; then \
281 .
/testcmyk
> test/testcmyk.log
2>&1
285 # testdither, test dithering functions.
288 testdither
: testdither.o libcupsdriver.a ..
/cups
/libcups.a
290 $(CC
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a ..
/cups
/libcups.a \
291 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
292 if
test ! -d
test; then \
295 .
/testdither
> test/0-255.pgm
2>test/0-255.log
296 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
297 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
298 .
/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
299 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
300 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
301 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
302 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
306 # testrgb, test RGB separation functions.
309 testrgb
: testrgb.o libcupsdriver.a ..
/cups
/libcups.a
311 $(CC
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a ..
/cups
/libcups.a \
312 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
313 if
test ! -d
test; then \
316 .
/testrgb
> test/testrgb.log
2>&1
320 # libcupsdriver.so.1, libcupsdriver.sl.1
323 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
325 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
326 $(RM
) `basename $@ .1`
327 $(LN
) $@
`basename $@ .1`
331 # 32bit/libcupsdriver.so.1
334 32bit
/libcupsdriver.so
.1: $(LIB32OBJS
)
335 echo Linking
32-bit
$@...
337 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
338 $(RM
) 32bit
/libcupsdriver.so
339 $(LN
) libcupsdriver.so
.1 32bit
/libcupsdriver.so
343 # 64bit/libcupsdriver.so.1
346 64bit
/libcupsdriver.so
.1: $(LIB64OBJS
)
347 echo Linking
64-bit
$@...
349 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
350 $(RM
) 64bit
/libcupsdriver.so
351 $(LN
) libcupsdriver.so
.1 64bit
/libcupsdriver.so
355 # libcupsdriver.1.dylib
358 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
360 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
361 -install_name
$(libdir)/$@ \
362 -current_version
1.0.0 \
363 -compatibility_version
1.0.0 \
364 -exported_symbols_list libcupsdriver.exp \
366 $(RM
) libcupsdriver.dylib
367 $(LN
) $@ libcupsdriver.dylib
374 libcupsdriver_s.a
: $(LIBOBJS
)
376 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
378 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
385 libcupsdriver.la
: $(LIBOBJS
)
387 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
388 -version-info
1:0 $(LIBS
)
395 libcupsdriver.a
: $(LIBOBJS
)
398 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
403 # Include dependencies...