4 # Makefile for the CUPS base drivers.
6 # Copyright 2007-2010 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...
72 # Make library targets...
82 unittests
: $(UNITTARGETS
)
92 $(RM
) $(TARGETS
) $(UNITTARGETS
)
94 $(RM
) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
98 # Update dependencies...
102 makedepend
-Y
-I..
-fDependencies
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
106 # Install all targets...
109 install: all install-data install-headers install-libs install-exec
113 # Install data files...
120 # Install programs...
124 $(INSTALL_DIR
) $(SERVERBIN
)/filter
125 for file in
$(FILTERS
); do \
126 $(INSTALL_BIN
) $$file $(SERVERBIN
)/filter; \
128 if
test "x$(SYMROOT)" != "x"; then \
129 $(INSTALL_DIR
) $(SYMROOT
); \
130 for file in
$(FILTERS
); do \
131 cp
$$file $(SYMROOT
); \
141 echo Installing header files in
$(INCLUDEDIR
)/cups...
142 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
143 $(INSTALL_DATA
) driver.h
$(INCLUDEDIR
)/cups
147 # Install libraries...
150 install-libs
: $(INSTALLSTATIC
)
151 echo Installing libraries in
$(LIBDIR
)...
152 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
153 $(INSTALL_LIB
) $(LIBCUPSDRIVER
) $(LIBDIR
)
154 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.so.1" -o
$(LIBCUPSDRIVER
) = "libcupsdriver.sl.1"; then \
155 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
156 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
158 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.1.dylib"; then \
159 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
; \
160 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/libcupsdriver.dylib
; \
162 if
test "x$(SYMROOT)" != "x"; then \
163 $(INSTALL_DIR
) $(SYMROOT
); \
164 cp
$(LIBCUPSDRIVER
) $(SYMROOT
); \
168 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
169 $(INSTALL_LIB
) -m
755 libcupsdriver.a
$(LIBDIR
)
170 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
171 $(CHMOD
) 555 $(LIBDIR
)/libcupsdriver.a
179 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
180 $(RM
) $(SERVERBIN
)/filter/$$file; \
182 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
183 $(RM
) $(LIBDIR
)/libcupsdriver.a
184 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
185 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
186 $(RM
) $(LIBDIR
)/libcupsdriver.sl
187 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
188 $(RM
) $(LIBDIR
)/libcupsdriver.so
189 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
191 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
192 -$(RMDIR
) $(INCLUDEDIR
)/cups
196 # Automatic API help files...
200 mxmldoc
--section
"Programming" \
201 --title
"Printer Driver API" \
202 --css ..
/doc
/cups-printable.css \
203 --header api-driver.header
--intro api-driver.shtml \
205 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
206 mxmldoc
--tokens help
/api-driver.html
>..
/doc
/help
/api-driver.tokens
210 mxmldoc
--framed api-driver \
211 --section
"Programming" \
212 --title
"Printer Driver API" \
213 --css ..
/doc
/cups-printable.css \
214 --header api-driver.header
--intro api-driver.shtml \
215 driver.h
$(LIBOBJS
:.o
=.c
)
219 # commandtopclx, the PCL command printer driver.
222 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
224 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
228 # commandtoescpx, the ESC/P command printer driver.
231 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
233 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
237 # rastertoescpx, the ESC/P raster printer driver.
240 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
242 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
243 $(LINKCUPSIMAGE
) $(LIBS
)
247 # rastertopclx, the ESC/P raster printer driver.
250 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
253 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
254 $(LINKCUPSIMAGE
) $(LIBS
)
258 # test, make a common test subdirectory for the other test programs.
262 if
test ! -d
test; then \
269 # testcmyk, test cmyk separation functions.
272 testcmyk
: test testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
274 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a \
275 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
276 $(COMMONLIBS
) $(LIBZ
)
277 echo Running CMYK API tests...
278 .
/testcmyk
> test/testcmyk.log
282 # testdither, test dithering functions.
285 testdither
: test testdither.o libcupsdriver.a ..
/cups
/libcups.a
287 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a \
288 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
289 $(COMMONLIBS
) $(LIBZ
)
290 echo Running dither API tests...
291 .
/testdither
> test/0-255.pgm
2>test/0-255.log
292 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
293 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
294 .
/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
295 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
296 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
297 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
298 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
302 # testrgb, test RGB separation functions.
305 testrgb
: test testrgb.o libcupsdriver.a ..
/cups
/libcups.a
307 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a \
308 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
309 $(COMMONLIBS
) $(LIBZ
)
310 echo Running RGB API tests...
311 .
/testrgb
> test/testrgb.log
2>&1 || echo
"RGB tests failed!"
315 # libcupsdriver.so.1, libcupsdriver.sl.1
318 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
320 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
321 $(RM
) `basename $@ .1`
322 $(LN
) $@
`basename $@ .1`
326 # libcupsdriver.1.dylib
329 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
331 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
332 -install_name
$(libdir)/$@ \
333 -current_version
1.0.0 \
334 -compatibility_version
1.0.0 \
335 -exported_symbols_list libcupsdriver.exp \
337 $(RM
) libcupsdriver.dylib
338 $(LN
) $@ libcupsdriver.dylib
345 libcupsdriver_s.a
: $(LIBOBJS
)
347 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
349 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
356 libcupsdriver.la
: $(LIBOBJS
)
358 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
359 -version-info
1:0 $(LIBS
)
366 libcupsdriver.a
: $(LIBOBJS
)
369 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
374 # Include dependencies...