4 # Makefile for the CUPS base drivers.
6 # Copyright 2007-2009 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...
70 # Make library targets...
80 unittests
: $(UNITTARGETS
)
90 $(RM
) $(TARGETS
) $(UNITTARGETS
)
92 $(RM
) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
96 # Update dependencies...
100 makedepend
-Y
-I..
-fDependencies
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
104 # Install all targets...
107 install: all install-data install-headers install-libs install-exec
111 # Install data files...
118 # Install programs...
122 $(INSTALL_DIR
) $(SERVERBIN
)/filter
123 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
124 $(INSTALL_BIN
) $$file $(SERVERBIN
)/filter; \
126 if
test "x$(SYMROOT)" != "x"; then \
127 $(INSTALL_DIR
) $(SYMROOT
); \
128 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
129 cp
$$file $(SYMROOT
); \
139 echo Installing header files in
$(INCLUDEDIR
)/cups...
140 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
141 $(INSTALL_DATA
) driver.h
$(INCLUDEDIR
)/cups
145 # Install libraries...
148 install-libs
: $(INSTALLSTATIC
)
149 echo Installing libraries in
$(LIBDIR
)...
150 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
151 $(INSTALL_LIB
) $(LIBCUPSDRIVER
) $(LIBDIR
)
152 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.so.1" -o
$(LIBCUPSDRIVER
) = "libcupsdriver.sl.1"; then \
153 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
154 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
156 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.1.dylib"; then \
157 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
; \
158 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/libcupsdriver.dylib
; \
160 if
test "x$(SYMROOT)" != "x"; then \
161 $(INSTALL_DIR
) $(SYMROOT
); \
162 cp
$(LIBCUPSDRIVER
) $(SYMROOT
); \
166 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
167 $(INSTALL_LIB
) -m
755 libcupsdriver.a
$(LIBDIR
)
168 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
169 $(CHMOD
) 555 $(LIBDIR
)/libcupsdriver.a
177 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
178 $(RM
) $(SERVERBIN
)/filter/$$file; \
180 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
181 $(RM
) $(LIBDIR
)/libcupsdriver.a
182 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
183 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
184 $(RM
) $(LIBDIR
)/libcupsdriver.sl
185 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
186 $(RM
) $(LIBDIR
)/libcupsdriver.so
187 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
189 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
190 -$(RMDIR
) $(INCLUDEDIR
)/cups
194 # Automatic API help files...
198 mxmldoc
--section
"Programming" \
199 --title
"Printer Driver API" \
200 --css ..
/doc
/cups-printable.css \
201 --header api-driver.header
--intro api-driver.shtml \
203 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
204 mxmldoc
--tokens help
/api-driver.html
>..
/doc
/help
/api-driver.tokens
208 mxmldoc
--framed api-driver \
209 --section
"Programming" \
210 --title
"Printer Driver API" \
211 --css ..
/doc
/cups-printable.css \
212 --header api-driver.header
--intro api-driver.shtml \
213 driver.h
$(LIBOBJS
:.o
=.c
)
217 # commandtopclx, the PCL command printer driver.
220 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
222 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
226 # commandtoescpx, the ESC/P command printer driver.
229 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
231 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
235 # rastertoescpx, the ESC/P raster printer driver.
238 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
240 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
241 $(LINKCUPSIMAGE
) $(LIBS
)
245 # rastertopclx, the ESC/P raster printer driver.
248 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
251 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
252 $(LINKCUPSIMAGE
) $(LIBS
)
256 # test, make a common test subdirectory for the other test programs.
260 if
test ! -d
test; then \
267 # testcmyk, test cmyk separation functions.
270 testcmyk
: test testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
272 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a \
273 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
274 $(COMMONLIBS
) $(LIBZ
)
275 echo Running CMYK API tests...
276 .
/testcmyk
> test/testcmyk.log
280 # testdither, test dithering functions.
283 testdither
: test testdither.o libcupsdriver.a ..
/cups
/libcups.a
285 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a \
286 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
287 $(COMMONLIBS
) $(LIBZ
)
288 echo Running dither API tests...
289 .
/testdither
> test/0-255.pgm
2>test/0-255.log
290 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
291 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
292 .
/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
293 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
294 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
295 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
296 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
300 # testrgb, test RGB separation functions.
303 testrgb
: test testrgb.o libcupsdriver.a ..
/cups
/libcups.a
305 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a \
306 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
307 $(COMMONLIBS
) $(LIBZ
)
308 echo Running RGB API tests...
309 .
/testrgb
> test/testrgb.log
2>&1 || echo
"RGB tests failed!"
313 # libcupsdriver.so.1, libcupsdriver.sl.1
316 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
318 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
319 $(RM
) `basename $@ .1`
320 $(LN
) $@
`basename $@ .1`
324 # libcupsdriver.1.dylib
327 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
329 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
330 -install_name
$(libdir)/$@ \
331 -current_version
1.0.0 \
332 -compatibility_version
1.0.0 \
333 -exported_symbols_list libcupsdriver.exp \
335 $(RM
) libcupsdriver.dylib
336 $(LN
) $@ libcupsdriver.dylib
343 libcupsdriver_s.a
: $(LIBOBJS
)
345 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
347 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
354 libcupsdriver.la
: $(LIBOBJS
)
356 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
357 -version-info
1:0 $(LIBS
)
364 libcupsdriver.a
: $(LIBOBJS
)
367 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
372 # Include dependencies...