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 $(STRIP
) -x
$(LIBDIR
)/$(LIBCUPSDRIVER
); \
155 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
; \
156 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/libcupsdriver.dylib
; \
158 if
test "x$(SYMROOT)" != "x"; then \
159 $(INSTALL_DIR
) $(SYMROOT
); \
160 cp
$(LIBCUPSDRIVER
) $(SYMROOT
); \
164 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
165 $(INSTALL_LIB
) libcupsdriver.a
$(LIBDIR
)
166 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
169 echo Installing libraries in
$(LIB32DIR
)...
170 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
171 $(INSTALL_LIB
) 32bit
/libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
.1
172 $(LN
) libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
175 echo Installing libraries in
$(LIB64DIR
)...
176 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
177 $(INSTALL_LIB
) 64bit
/libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
.1
178 $(LN
) libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
185 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
186 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
187 $(RM
) $(SERVERBIN
)/filter/$$file; \
189 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
190 $(RM
) $(LIBDIR
)/libcupsdriver.a
191 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
192 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
193 $(RM
) $(LIBDIR
)/libcupsdriver.sl
194 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
195 $(RM
) $(LIBDIR
)/libcupsdriver.so
196 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
198 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
199 -$(RMDIR
) $(INCLUDEDIR
)/cups
202 $(RM
) $(LIB32DIR
)/libcupsdriver.so
203 $(RM
) $(LIB32DIR
)/libcupsdriver.so
.1
204 -$(RMDIR
) $(LIB32DIR
)
207 $(RM
) $(LIB64DIR
)/libcupsdriver.so
208 $(RM
) $(LIB64DIR
)/libcupsdriver.so
.1
209 -$(RMDIR
) $(LIB64DIR
)
213 # Automatic API help files...
217 mxmldoc
--section
"Programming" \
218 --title
"Printer Driver API" \
219 --css ..
/doc
/cups-printable.css \
220 --header api-driver.header
--intro api-driver.shtml \
221 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
224 mxmldoc
--framed api-driver \
225 --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
)
233 # commandtopclx, the PCL command printer driver.
236 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
238 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
242 # commandtoescpx, the ESC/P command printer driver.
245 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
247 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
251 # rastertoescpx, the ESC/P raster printer driver.
254 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
256 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
257 $(LINKCUPSIMAGE
) $(LIBS
)
261 # rastertopclx, the ESC/P raster printer driver.
264 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
267 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
268 $(LINKCUPSIMAGE
) $(LIBS
)
272 # testcmyk, test cmyk separation functions.
275 testcmyk
: testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
277 $(CC
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a ..
/cups
/libcups.a \
278 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
279 if
test ! -d
test; then \
282 .
/testcmyk
> test/testcmyk.log
2>&1
286 # testdither, test dithering functions.
289 testdither
: testdither.o libcupsdriver.a ..
/cups
/libcups.a
291 $(CC
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a ..
/cups
/libcups.a \
292 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
293 if
test ! -d
test; then \
296 .
/testdither
> test/0-255.pgm
2>test/0-255.log
297 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
298 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
299 .
/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
300 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
301 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
302 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
303 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
307 # testrgb, test RGB separation functions.
310 testrgb
: testrgb.o libcupsdriver.a ..
/cups
/libcups.a
312 $(CC
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a ..
/cups
/libcups.a \
313 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
314 if
test ! -d
test; then \
317 .
/testrgb
> test/testrgb.log
2>&1
321 # libcupsdriver.so.1, libcupsdriver.sl.1
324 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
326 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
327 $(RM
) `basename $@ .1`
328 $(LN
) $@
`basename $@ .1`
332 # 32bit/libcupsdriver.so.1
335 32bit
/libcupsdriver.so
.1: $(LIB32OBJS
)
336 echo Linking
32-bit
$@...
338 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
339 $(RM
) 32bit
/libcupsdriver.so
340 $(LN
) libcupsdriver.so
.1 32bit
/libcupsdriver.so
344 # 64bit/libcupsdriver.so.1
347 64bit
/libcupsdriver.so
.1: $(LIB64OBJS
)
348 echo Linking
64-bit
$@...
350 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
351 $(RM
) 64bit
/libcupsdriver.so
352 $(LN
) libcupsdriver.so
.1 64bit
/libcupsdriver.so
356 # libcupsdriver.1.dylib
359 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
361 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
362 -install_name
$(libdir)/$@ \
363 -current_version
1.0.0 \
364 -compatibility_version
1.0.0 \
365 -exported_symbols_list libcupsdriver.exp \
367 $(RM
) libcupsdriver.dylib
368 $(LN
) $@ libcupsdriver.dylib
375 libcupsdriver_s.a
: $(LIBOBJS
)
377 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
379 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
386 libcupsdriver.la
: $(LIBOBJS
)
388 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
389 -version-info
1:0 $(LIBS
)
396 libcupsdriver.a
: $(LIBOBJS
)
399 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
404 # Include dependencies...