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
)
76 # Make library targets...
98 $(RM
) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
103 # Update dependencies...
107 touch Dependencies.tmp
108 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
110 cp Dependencies.tmp Dependencies
111 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
112 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
113 $(RM
) Dependencies.tmp
117 # Install all targets...
120 install: all install-data install-headers install-libs install-exec
124 # Install data files...
131 # Install programs...
135 $(INSTALL_DIR
) $(SERVERBIN
)/filter
136 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
137 $(INSTALL_BIN
) $$file $(SERVERBIN
)/filter; \
139 if
test "x$(SYMROOT)" != "x"; then \
140 $(INSTALL_DIR
) $(SYMROOT
); \
141 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
142 cp
$$file $(SYMROOT
); \
152 echo Installing header files in
$(INCLUDEDIR
)/cups...
153 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
154 $(INSTALL_DATA
) driver.h
$(INCLUDEDIR
)/cups
158 # Install libraries...
161 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
162 echo Installing libraries in
$(LIBDIR
)...
163 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
164 $(INSTALL_LIB
) $(LIBCUPSDRIVER
) $(LIBDIR
)
165 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.so.1" -o
$(LIBCUPSDRIVER
) = "libcupsdriver.sl.1"; then \
166 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
167 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/`basename $(LIBCUPSDRIVER) .1`; \
169 if
test $(LIBCUPSDRIVER
) = "libcupsdriver.1.dylib"; then \
170 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
; \
171 $(LN
) $(LIBCUPSDRIVER
) $(LIBDIR
)/libcupsdriver.dylib
; \
173 if
test "x$(SYMROOT)" != "x"; then \
174 $(INSTALL_DIR
) $(SYMROOT
); \
175 cp
$(LIBCUPSDRIVER
) $(SYMROOT
); \
179 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
180 $(INSTALL_LIB
) libcupsdriver.a
$(LIBDIR
)
181 $(RANLIB
) $(LIBDIR
)/libcupsdriver.a
184 echo Installing libraries in
$(LIB32DIR
)...
185 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
186 $(INSTALL_LIB
) 32bit
/libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
.1
187 $(LN
) libcupsdriver.so
.1 $(LIB32DIR
)/libcupsdriver.so
190 echo Installing libraries in
$(LIB64DIR
)...
191 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
192 $(INSTALL_LIB
) 64bit
/libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
.1
193 $(LN
) libcupsdriver.so
.1 $(LIB64DIR
)/libcupsdriver.so
200 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
201 for file in commandtoescpx commandtopclx rastertoescpx rastertopclx
; do \
202 $(RM
) $(SERVERBIN
)/filter/$$file; \
204 $(RM
) $(LIBDIR
)/libcupsdriver
.1.dylib
205 $(RM
) $(LIBDIR
)/libcupsdriver.a
206 $(RM
) $(LIBDIR
)/libcupsdriver.dylib
207 $(RM
) $(LIBDIR
)/libcupsdriver_s.a
208 $(RM
) $(LIBDIR
)/libcupsdriver.sl
209 $(RM
) $(LIBDIR
)/libcupsdriver.sl
.1
210 $(RM
) $(LIBDIR
)/libcupsdriver.so
211 $(RM
) $(LIBDIR
)/libcupsdriver.so
.1
213 $(RM
) $(INCLUDEDIR
)/cups
/driver.h
214 -$(RMDIR
) $(INCLUDEDIR
)/cups
217 $(RM
) $(LIB32DIR
)/libcupsdriver.so
218 $(RM
) $(LIB32DIR
)/libcupsdriver.so
.1
219 -$(RMDIR
) $(LIB32DIR
)
222 $(RM
) $(LIB64DIR
)/libcupsdriver.so
223 $(RM
) $(LIB64DIR
)/libcupsdriver.so
.1
224 -$(RMDIR
) $(LIB64DIR
)
228 # Automatic API help files...
232 mxmldoc
--section
"Programming" \
233 --title
"Printer Driver API" \
234 --css ..
/doc
/cups-printable.css \
235 --header api-driver.header
--intro api-driver.shtml \
236 driver.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-driver.html
239 mxmldoc
--framed api-driver \
240 --section
"Programming" \
241 --title
"Printer Driver API" \
242 --css ..
/doc
/cups-printable.css \
243 --header api-driver.header
--intro api-driver.shtml \
244 driver.h
$(LIBOBJS
:.o
=.c
)
248 # commandtopclx, the PCL command printer driver.
251 commandtopclx
: commandtopclx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
253 $(CC
) $(LDFLAGS
) -o
$@ commandtopclx.o
-L.
-lcupsdriver
$(LIBS
)
257 # commandtoescpx, the ESC/P command printer driver.
260 commandtoescpx
: commandtoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
262 $(CC
) $(LDFLAGS
) -o
$@ commandtoescpx.o
-L.
-lcupsdriver
$(LIBS
)
266 # rastertoescpx, the ESC/P raster printer driver.
269 rastertoescpx
: rastertoescpx.o
$(LIBCUPSDRIVER
) ..
/cups
/$(LIBCUPS
)
271 $(CC
) $(LDFLAGS
) -o
$@ rastertoescpx.o
-L.
-lcupsdriver \
272 $(LINKCUPSIMAGE
) $(LIBS
)
276 # rastertopclx, the ESC/P raster printer driver.
279 rastertopclx
: rastertopclx.o pcl-common.o
$(LIBCUPSDRIVER
) \
282 $(CC
) $(LDFLAGS
) -o
$@ rastertopclx.o pcl-common.o
-L.
-lcupsdriver \
283 $(LINKCUPSIMAGE
) $(LIBS
)
287 # test, make a common test subdirectory for the other test programs.
291 if
test ! -d
test; then \
298 # testcmyk, test cmyk separation functions.
301 testcmyk
: test testcmyk.o libcupsdriver.a ..
/cups
/libcups.a
303 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcmyk.o libcupsdriver.a \
304 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
305 echo Running CMYK API tests...
306 .
/testcmyk
> test/testcmyk.log
310 # testdither, test dithering functions.
313 testdither
: test testdither.o libcupsdriver.a ..
/cups
/libcups.a
315 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testdither.o libcupsdriver.a \
316 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
317 echo Running dither API tests...
318 .
/testdither
> test/0-255.pgm
2>test/0-255.log
319 .
/testdither
0 127 255 > test/0-127-255.pgm
2>test/0-127-255.log
320 .
/testdither
0 85 170 255 > test/0-85-170-255.pgm
2>test/0-85-170-255.log
321 .
/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
322 .
/testdither
0 210 383 > test/0-210-383.pgm
2>test/0-210-383.log
323 .
/testdither
0 82 255 > test/0-82-255.pgm
2>test/0-82-255.log
324 .
/testdither
0 510 > test/0-510.pgm
2>test/0-510.log
325 .
/testdither
0 1020 > test/0-1020.pgm
2>test/0-1020.log
329 # testrgb, test RGB separation functions.
332 testrgb
: test testrgb.o libcupsdriver.a ..
/cups
/libcups.a
334 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testrgb.o libcupsdriver.a \
335 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
336 echo Running RGB API tests...
337 .
/testrgb
> test/testrgb.log
2>&1 || echo
"RGB tests failed!"
341 # libcupsdriver.so.1, libcupsdriver.sl.1
344 libcupsdriver.so
.1 libcupsdriver.sl
.1: $(LIBOBJS
)
346 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
347 $(RM
) `basename $@ .1`
348 $(LN
) $@
`basename $@ .1`
352 # 32bit/libcupsdriver.so.1
355 32bit
/libcupsdriver.so
.1: $(LIB32OBJS
)
356 echo Linking
32-bit
$@...
358 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
359 $(RM
) 32bit
/libcupsdriver.so
360 $(LN
) libcupsdriver.so
.1 32bit
/libcupsdriver.so
364 # 64bit/libcupsdriver.so.1
367 64bit
/libcupsdriver.so
.1: $(LIB64OBJS
)
368 echo Linking
64-bit
$@...
370 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
371 $(RM
) 64bit
/libcupsdriver.so
372 $(LN
) libcupsdriver.so
.1 64bit
/libcupsdriver.so
376 # libcupsdriver.1.dylib
379 libcupsdriver
.1.dylib
: $(LIBOBJS
) libcupsdriver.exp
381 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
382 -install_name
$(libdir)/$@ \
383 -current_version
1.0.0 \
384 -compatibility_version
1.0.0 \
385 -exported_symbols_list libcupsdriver.exp \
387 $(RM
) libcupsdriver.dylib
388 $(LN
) $@ libcupsdriver.dylib
395 libcupsdriver_s.a
: $(LIBOBJS
)
397 $(DSO
) $(DSOFLAGS
) -o libcupsdriver_s.o
$(LIBOBJS
) $(LIBS
)
399 $(AR
) $(ARFLAGS
) $@ libcupsdriver_s.o
406 libcupsdriver.la
: $(LIBOBJS
)
408 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
409 -version-info
1:0 $(LIBS
)
416 libcupsdriver.a
: $(LIBOBJS
)
419 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
424 # Include dependencies...