2 # "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
4 # API library Makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 1997-2006 by Easy Software Products, all rights reserved.
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/".
15 # This file is subject to the Apple OS-Developed Software exception.
67 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
68 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
87 # Header files to install...
108 # Targets in this directory...
132 # Make all targets...
139 # Make library targets...
146 # Remove object and target files...
150 $(RM
) $(OBJS
) $(TARGETS
)
151 $(RM
) libcups.so libcups.sl libcups.dylib
156 # Update dependencies (without system header dependencies...)
160 touch Dependencies.tmp
161 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
163 cp Dependencies.tmp Dependencies
164 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
165 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
166 $(RM
) Dependencies.tmp
170 # Install all targets...
173 install: all install-data install-headers install-libs install-exec
177 # Install data files...
184 # Install programs...
195 echo Installing header files into
$(INCLUDEDIR
)/cups...
196 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
197 for file in
$(HEADERS
); do \
198 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
203 # Install libraries...
206 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
207 echo Installing libraries in
$(LIBDIR
)...
208 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
209 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
210 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
211 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
212 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
214 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
215 $(RM
) $(LIBDIR
)/libcups.dylib
; \
216 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
218 if
test "x$(SYMROOT)" != "x"; then \
219 $(INSTALL_DIR
) $(SYMROOT
); \
220 cp
$(LIBCUPS
) $(SYMROOT
); \
224 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
225 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
226 $(RANLIB
) $(LIBDIR
)/libcups.a
229 echo Installing libraries in
$(LIB32DIR
)...
230 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
231 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
232 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
235 echo Installing libraries in
$(LIB64DIR
)...
236 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
237 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
238 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
242 # Uninstall object and target files...
245 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
246 $(RM
) $(LIBDIR
)/libcups
.2.dylib
247 $(RM
) $(LIBDIR
)/libcups.a
248 $(RM
) $(LIBDIR
)/libcups.dylib
249 $(RM
) $(LIBDIR
)/libcups_s.a
250 $(RM
) $(LIBDIR
)/libcups.sl
251 $(RM
) $(LIBDIR
)/libcups.sl
.2
252 $(RM
) $(LIBDIR
)/libcups.so
253 $(RM
) $(LIBDIR
)/libcups.so
.2
255 for file in
$(HEADERS
); do \
256 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
258 -$(RMDIR
) $(INCLUDEDIR
)/cups
261 $(RM
) $(LIB32DIR
)/libcups.so
262 $(RM
) $(LIB32DIR
)/libcups.so
.2
263 -$(RMDIR
) $(LIB32DIR
)
266 $(RM
) $(LIB64DIR
)/libcups.so
267 $(RM
) $(LIB64DIR
)/libcups.so
.2
268 -$(RMDIR
) $(LIB64DIR
)
272 # libcups.so.2, libcups.sl.2
275 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
277 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
278 $(RM
) `basename $@ .2`
279 $(LN
) $@
`basename $@ .2`
286 32bit
/libcups.so
.2: $(LIB32OBJS
)
287 echo Linking
32-bit
$@...
289 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
290 $(RM
) 32bit
/libcups.so
291 $(LN
) libcups.so
.2 32bit
/libcups.so
298 64bit
/libcups.so
.2: $(LIB64OBJS
)
299 echo Linking
64-bit
$@...
301 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
302 $(RM
) 64bit
/libcups.so
303 $(LN
) libcups.so
.2 64bit
/libcups.so
310 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
) libcups.exp
312 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
313 -install_name
$(libdir)/$@ \
314 -current_version
2.8.0 \
315 -compatibility_version
2.0.0 \
316 -exported_symbols_list libcups.exp \
317 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
318 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
320 $(LN
) $@ libcups.dylib
327 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
329 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
331 $(AR
) $(ARFLAGS
) $@ libcups_s.o
338 libcups.la
: $(LIBOBJS
)
340 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
341 -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
348 libcups.a
: $(LIBOBJS
)
351 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
356 # CUPS language bindings for various scripting languages...
358 # NOTE: Not currently used or functional - see the scripting/php directory
359 # for the hand-written bindings...
362 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
364 if
test `uname` = Darwin
; then \
365 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
367 DSOFLAGS
="$(DSOFLAGS)"; \
369 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
371 php_cups_wrap.o
: php_cups_wrap.c
373 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
374 php_cups_wrap.c
: cups.h
375 echo Creating
$< using SWIG...
376 swig
-php
-o
$@
-module cups cups.h
380 # testadmin (dependency on static CUPS library is intentional)
383 testadmin
: testadmin.o libcups.a
385 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
386 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
390 # testarray (dependency on static CUPS library is intentional)
393 testarray
: testarray.o libcups.a
395 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
396 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
397 echo Running array API tests...
402 # testcups (dependency on static CUPS library is intentional)
405 testcups
: testcups.o libcups.a
407 $(CC
) $(LDFLAGS
) -o
$@ testcups.o libcups.a \
408 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
412 # testfile (dependency on static CUPS library is intentional)
415 testfile
: testfile.o libcups.a
417 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
418 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
419 echo Running file API tests...
424 # testhttp (dependency on static CUPS library is intentional)
427 testhttp
: testhttp.o libcups.a
429 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
430 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
431 echo Running HTTP API tests...
436 # testipp (dependency on static CUPS library is intentional)
439 testipp
: testipp.o libcups.a
441 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
442 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
443 echo Running IPP API tests...
448 # testi18n (dependency on static CUPS library is intentional)
451 testi18n
: testi18n.o libcups.a
453 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
454 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
455 echo Running internationalization API tests...
460 # testlang (dependency on static CUPS library is intentional)
463 testlang
: testlang.o libcups.a
465 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
466 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
467 echo Running language API tests...
472 # testppd (dependency on static CUPS library is intentional)
475 testppd
: testppd.o libcups.a
477 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
478 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
479 echo Running PPD API tests...
484 # testsnmp (dependency on static CUPS library is intentional)
487 testsnmp
: testsnmp.o libcups.a
489 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o libcups.a \
490 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
494 # Automatic API help files...
498 echo Generating CUPS API help files...
499 mxmldoc
--section
"Programming" \
500 --title
"Introduction to CUPS Programming" \
501 --css ..
/doc
/cups-printable.css \
502 --header api-overview.header
--intro api-overview.shtml \
503 >..
/doc
/help
/api-overview.html
504 mxmldoc
--section
"Programming" --title
"Array API" \
505 --css ..
/doc
/cups-printable.css \
506 --header api-array.header
--intro api-array.shtml \
507 array.h array.c
>..
/doc
/help
/api-array.html
508 mxmldoc
--section
"Programming" --title
"CUPS API" \
509 --css ..
/doc
/cups-printable.css \
510 --header api-cups.header
--intro api-cups.shtml \
511 cups.h dest.c language.c notify.c \
512 options.c tempfile.c usersys.c \
513 util.c
>..
/doc
/help
/api-cups.html
514 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
515 --css ..
/doc
/cups-printable.css \
516 --header api-filedir.header
--intro api-filedir.shtml \
517 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
518 mxmldoc
--section
"Programming" --title
"PPD API" \
519 --css ..
/doc
/cups-printable.css \
520 --header api-ppd.header
--intro api-ppd.shtml \
521 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
522 ppd.c
>..
/doc
/help
/api-ppd.html
523 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
524 --css ..
/doc
/cups-printable.css \
525 --header api-httpipp.header
--intro api-httpipp.shtml \
526 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
527 http.c http-addr.c http-support.c ipp.c ipp-support.c \
528 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
529 mxmldoc
--section
"Programming" \
530 --title
"Filter and Backend Programming" \
531 --css ..
/doc
/cups-printable.css \
532 --header api-filter.header
--intro api-filter.shtml \
533 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
534 >..
/doc
/help
/api-filter.html
537 echo Generating CUPS API help files...
538 mxmldoc
--framed api-overview \
539 --section
"Programming" \
540 --title
"Introduction to CUPS Programming" \
541 --css ..
/doc
/cups-printable.css \
542 --header api-overview.header
--intro api-overview.shtml
543 mxmldoc
--framed api-array \
544 --section
"Programming" --title
"Array API" \
545 --css ..
/doc
/cups-printable.css \
546 --header api-array.header
--intro api-array.shtml \
548 mxmldoc
--framed api-cups \
549 --section
"Programming" --title
"CUPS API" \
550 --css ..
/doc
/cups-printable.css \
551 --header api-cups.header
--intro api-cups.shtml \
552 cups.h dest.c language.c notify.c \
553 options.c tempfile.c usersys.c \
555 mxmldoc
--framed api-filedir \
556 --section
"Programming" --title
"File and Directory APIs" \
557 --css ..
/doc
/cups-printable.css \
558 --header api-filedir.header
--intro api-filedir.shtml \
559 file.h file.c
dir.h
dir.c
560 mxmldoc
--framed api-ppd \
561 --section
"Programming" --title
"PPD API" \
562 --css ..
/doc
/cups-printable.css \
563 --header api-ppd.header
--intro api-ppd.shtml \
564 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
566 mxmldoc
--framed api-httpipp \
567 --section
"Programming" --title
"HTTP and IPP APIs" \
568 --css ..
/doc
/cups-printable.css \
569 --header api-httpipp.header
--intro api-httpipp.shtml \
570 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
571 http.c http-addr.c http-support.c ipp.c ipp-support.c \
572 md5passwd.c request.c
573 mxmldoc
--framed api-filter \
574 --section
"Programming" \
575 --title
"Filter and Backend Programming" \
576 --css ..
/doc
/cups-printable.css \
577 --header api-filter.header
--intro api-filter.shtml \
578 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
589 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".