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
) libcupsdriver.a
$(LIBDIR
)
168 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
176 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
177 $(RM
) $(SERVERBIN
)/filter/$$file; \
179 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
180 $(RM
) $(LIBDIR
)/libcupsdriver.a
181 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
182 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
183 $(RM
) $(LIBDIR
)/libcupsdriver.sl
184 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
185 $(RM
) $(LIBDIR
)/libcupsdriver.so
186 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
188 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
189 -$(RMDIR
) $(INCLUDEDIR
)/cups
193 # Automatic API help files...
197 mxmldoc
--section
"Programming" \
198 --title
"Printer Driver API" \
199 --css ..
/doc
/cups-printable.css \
200 --header api-driver.header
--intro api-driver.shtml \
202 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
203 mxmldoc
--tokens help
/api-driver.html
>..
/doc
/help
/api-driver.tokens
207 mxmldoc
--framed api-driver \
208 --section
"Programming" \
209 --title
"Printer Driver API" \
210 --css ..
/doc
/cups-printable.css \
211 --header api-driver.header
--intro api-driver.shtml \
212 driver.h
$(LIBOBJS
:.o
=.c
)
216 # commandtopclx, the PCL command printer driver.
219 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
221 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
225 # commandtoescpx, the ESC/P command printer driver.
228 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
230 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
234 # rastertoescpx, the ESC/P raster printer driver.
237 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
239 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
240 $(LINKCUPSIMAGE
) $(LIBS
)
244 # rastertopclx, the ESC/P raster printer driver.
247 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
250 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
251 $(LINKCUPSIMAGE
) $(LIBS
)
255 # test, make a common test subdirectory for the other test programs.
259 if
test ! -d
test; then \
266 # testcmyk, test cmyk separation functions.
269 testcmyk
: test testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
271 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a \
272 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
273 $(COMMONLIBS
) $(LIBZ
)
274 echo Running CMYK API tests...
275 .
/testcmyk
> test/testcmyk.log
279 # testdither, test dithering functions.
282 testdither
: test testdither.o libcupsdriver.a ..
/cups
/libcups.a
284 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a \
285 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
286 $(COMMONLIBS
) $(LIBZ
)
287 echo Running dither API tests...
288 .
/testdither
> test/0-255.pgm
2>test/0-255.log
289 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
290 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
291 .
/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
292 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
293 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
294 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
295 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
299 # testrgb, test RGB separation functions.
302 testrgb
: test testrgb.o libcupsdriver.a ..
/cups
/libcups.a
304 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a \
305 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
306 $(COMMONLIBS
) $(LIBZ
)
307 echo Running RGB API tests...
308 .
/testrgb
> test/testrgb.log
2>&1 || echo
"RGB tests failed!"
312 # libcupsdriver.so.1, libcupsdriver.sl.1
315 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
317 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
318 $(RM
) `basename $@ .1`
319 $(LN
) $@
`basename $@ .1`
323 # libcupsdriver.1.dylib
326 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
328 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
329 -install_name
$(libdir)/$@ \
330 -current_version
1.0.0 \
331 -compatibility_version
1.0.0 \
332 -exported_symbols_list libcupsdriver.exp \
334 $(RM
) libcupsdriver.dylib
335 $(LN
) $@ libcupsdriver.dylib
342 libcupsdriver_s.a
: $(LIBOBJS
)
344 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
346 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
353 libcupsdriver.la
: $(LIBOBJS
)
355 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
356 -version-info
1:0 $(LIBS
)
363 libcupsdriver.a
: $(LIBOBJS
)
366 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
371 # Include dependencies...