2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
4 # API library Makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 2007-2009 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.
69 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
70 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
91 # Header files to install...
112 # Targets in this directory...
140 # Make all targets...
147 # Make library targets...
157 unittests
: $(UNITTARGETS
)
161 # Remove object and target files...
165 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
166 $(RM
) libcups.so libcups.sl libcups.dylib
171 # Update dependencies (without system header dependencies...)
175 touch Dependencies.tmp
176 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
178 cp Dependencies.tmp Dependencies
179 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
180 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
181 $(RM
) Dependencies.tmp
185 # Install all targets...
188 install: all install-data install-headers install-libs install-exec
192 # Install data files...
199 # Install programs...
210 echo Installing header files into
$(INCLUDEDIR
)/cups...
211 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
212 for file in
$(HEADERS
); do \
213 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
218 # Install libraries...
221 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
222 echo Installing libraries in
$(LIBDIR
)...
223 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
224 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
225 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
226 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
227 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
229 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
230 $(RM
) $(LIBDIR
)/libcups.dylib
; \
231 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
233 if
test "x$(SYMROOT)" != "x"; then \
234 $(INSTALL_DIR
) $(SYMROOT
); \
235 cp
$(LIBCUPS
) $(SYMROOT
); \
239 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
240 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
241 $(RANLIB
) $(LIBDIR
)/libcups.a
244 echo Installing libraries in
$(LIB32DIR
)...
245 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
246 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
247 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
250 echo Installing libraries in
$(LIB64DIR
)...
251 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
252 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
253 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
257 # Uninstall object and target files...
260 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
261 $(RM
) $(LIBDIR
)/libcups
.2.dylib
262 $(RM
) $(LIBDIR
)/libcups.a
263 $(RM
) $(LIBDIR
)/libcups.dylib
264 $(RM
) $(LIBDIR
)/libcups_s.a
265 $(RM
) $(LIBDIR
)/libcups.sl
266 $(RM
) $(LIBDIR
)/libcups.sl
.2
267 $(RM
) $(LIBDIR
)/libcups.so
268 $(RM
) $(LIBDIR
)/libcups.so
.2
270 for file in
$(HEADERS
); do \
271 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
273 -$(RMDIR
) $(INCLUDEDIR
)/cups
276 $(RM
) $(LIB32DIR
)/libcups.so
277 $(RM
) $(LIB32DIR
)/libcups.so
.2
278 -$(RMDIR
) $(LIB32DIR
)
281 $(RM
) $(LIB64DIR
)/libcups.so
282 $(RM
) $(LIB64DIR
)/libcups.so
.2
283 -$(RMDIR
) $(LIB64DIR
)
287 # libcups.so.2, libcups.sl.2
290 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
292 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
293 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
294 $(RM
) `basename $@ .2`
295 $(LN
) $@
`basename $@ .2`
302 32bit
/libcups.so
.2: $(LIB32OBJS
)
303 echo Linking
32-bit
$@...
305 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) \
306 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
307 $(RM
) 32bit
/libcups.so
308 $(LN
) libcups.so
.2 32bit
/libcups.so
315 64bit
/libcups.so
.2: $(LIB64OBJS
)
316 echo Linking
64-bit
$@...
318 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) \
319 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
320 $(RM
) 64bit
/libcups.so
321 $(LN
) libcups.so
.2 64bit
/libcups.so
328 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
) libcups.exp
330 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
331 -install_name
$(libdir)/$@ \
332 -current_version
2.8.0 \
333 -compatibility_version
2.0.0 \
334 -exported_symbols_list libcups.exp \
335 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
336 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
337 $(COMMONLIBS
) $(LIBZ
)
339 $(LN
) $@ libcups.dylib
346 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
348 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
349 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
350 $(COMMONLIBS
) $(LIBZ
) -lm
352 $(AR
) $(ARFLAGS
) $@ libcups_s.o
359 libcups.la
: $(LIBOBJS
)
361 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
362 -rpath
$(LIBDIR
) -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) \
363 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
370 libcups.a
: $(LIBOBJS
)
373 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
378 # CUPS language bindings for various scripting languages...
380 # NOTE: Not currently used or functional - see the scripting/php directory
381 # for the hand-written bindings...
384 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
386 if
test `uname` = Darwin
; then \
387 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
389 DSOFLAGS
="$(DSOFLAGS)"; \
391 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
393 php_cups_wrap.o
: php_cups_wrap.c
395 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
396 php_cups_wrap.c
: cups.h
397 echo Creating
$< using SWIG...
398 swig
-php
-o
$@
-module cups cups.h
402 # testadmin (dependency on static CUPS library is intentional)
405 testadmin
: testadmin.o libcups.a
407 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
408 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
412 # testarray (dependency on static CUPS library is intentional)
415 testarray
: testarray.o libcups.a
417 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
418 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
419 echo Running array API tests...
424 # testconflicts (dependency on static CUPS library is intentional)
427 testconflicts
: testconflicts.o libcups.a
429 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o libcups.a \
430 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
434 # testcups (dependency on static CUPS library is intentional)
437 testcups
: testcups.o libcups.a
439 $(CC
) $(LDFLAGS
) -o
$@ testcups.o libcups.a \
440 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
444 # testfile (dependency on static CUPS library is intentional)
447 testfile
: testfile.o libcups.a
449 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
450 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
451 echo Running file API tests...
456 # testhttp (dependency on static CUPS library is intentional)
459 testhttp
: testhttp.o libcups.a
461 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
462 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
463 echo Running HTTP API tests...
468 # testipp (dependency on static CUPS library is intentional)
471 testipp
: testipp.o libcups.a
473 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
474 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
475 echo Running IPP API tests...
480 # testi18n (dependency on static CUPS library is intentional)
483 testi18n
: testi18n.o libcups.a
485 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
486 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
487 echo Running internationalization API tests...
492 # testlang (dependency on static CUPS library is intentional)
495 testlang
: testlang.o libcups.a
497 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
498 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
499 echo Running language API tests...
504 # testoptions (dependency on static CUPS library is intentional)
507 testoptions
: testoptions.o libcups.a
509 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o libcups.a \
510 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
511 echo Running option API tests...
516 # testppd (dependency on static CUPS library is intentional)
519 testppd
: testppd.o libcups.a
521 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
522 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
523 echo Running PPD API tests...
528 # testsnmp (dependency on static CUPS library is intentional)
531 testsnmp
: testsnmp.o libcups.a
533 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o libcups.a \
534 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
538 # Automatic API help files...
542 echo Generating CUPS API help files...
543 mxmldoc
--section
"Programming" \
544 --title
"Introduction to CUPS Programming" \
545 --css ..
/doc
/cups-printable.css \
546 --header api-overview.header
--intro api-overview.shtml \
547 >..
/doc
/help
/api-overview.html
548 mxmldoc
--section
"Programming" --title
"Array API" \
549 --css ..
/doc
/cups-printable.css \
550 --header api-array.header
--intro api-array.shtml \
551 array.h array.c
>..
/doc
/help
/api-array.html
552 mxmldoc
--section
"Programming" --title
"CUPS API" \
553 --css ..
/doc
/cups-printable.css \
554 --header api-cups.header
--intro api-cups.shtml \
555 cups.h adminutil.c dest.c language.c notify.c \
556 options.c tempfile.c usersys.c \
557 util.c
>..
/doc
/help
/api-cups.html
558 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
559 --css ..
/doc
/cups-printable.css \
560 --header api-filedir.header
--intro api-filedir.shtml \
561 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
562 mxmldoc
--section
"Programming" --title
"PPD API" \
563 --css ..
/doc
/cups-printable.css \
564 --header api-ppd.header
--intro api-ppd.shtml \
565 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
566 ppd.c
>..
/doc
/help
/api-ppd.html
567 mxmldoc
--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
>..
/doc
/help
/api-httpipp.html
573 mxmldoc
--section
"Programming" \
574 --title
"Filter and Backend Programming" \
575 --css ..
/doc
/cups-printable.css \
576 --header api-filter.header
--intro api-filter.shtml \
577 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
578 >..
/doc
/help
/api-filter.html
581 echo Generating CUPS API help files...
582 mxmldoc
--framed api-overview \
583 --section
"Programming" \
584 --title
"Introduction to CUPS Programming" \
585 --css ..
/doc
/cups-printable.css \
586 --header api-overview.header
--intro api-overview.shtml
587 mxmldoc
--framed api-array \
588 --section
"Programming" --title
"Array API" \
589 --css ..
/doc
/cups-printable.css \
590 --header api-array.header
--intro api-array.shtml \
592 mxmldoc
--framed api-cups \
593 --section
"Programming" --title
"CUPS API" \
594 --css ..
/doc
/cups-printable.css \
595 --header api-cups.header
--intro api-cups.shtml \
596 cups.h adminutil.c dest.c language.c notify.c \
597 options.c tempfile.c usersys.c \
599 mxmldoc
--framed api-filedir \
600 --section
"Programming" --title
"File and Directory APIs" \
601 --css ..
/doc
/cups-printable.css \
602 --header api-filedir.header
--intro api-filedir.shtml \
603 file.h file.c
dir.h
dir.c
604 mxmldoc
--framed api-ppd \
605 --section
"Programming" --title
"PPD API" \
606 --css ..
/doc
/cups-printable.css \
607 --header api-ppd.header
--intro api-ppd.shtml \
608 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
610 mxmldoc
--framed api-httpipp \
611 --section
"Programming" --title
"HTTP and IPP APIs" \
612 --css ..
/doc
/cups-printable.css \
613 --header api-httpipp.header
--intro api-httpipp.shtml \
614 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
615 http.c http-addr.c http-support.c ipp.c ipp-support.c \
616 md5passwd.c request.c
617 mxmldoc
--framed api-filter \
618 --section
"Programming" \
619 --title
"Filter and Backend Programming" \
620 --css ..
/doc
/cups-printable.css \
621 --header api-filter.header
--intro api-filter.shtml \
622 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
626 echo Generating CUPS API documentation sets...
627 ..
/tools
/makedocset
--docset org.cups.overview.docset \
628 --title
"Introduction to CUPS Programming" \
629 --header api-overview.header
--intro api-overview.shtml
630 ..
/tools
/makedocset
--docset org.cups.array.docset \
631 --title
"Array API" \
632 --header api-array.header
--intro api-array.shtml \
634 ..
/tools
/makedocset
--docset org.cups.cups.docset \
636 --header api-cups.header
--intro api-cups.shtml \
637 cups.h adminutil.c dest.c language.c notify.c \
638 options.c tempfile.c usersys.c \
640 ..
/tools
/makedocset
--docset org.cups.filedir.docset \
641 --title
"File and Directory APIs" \
642 --header api-filedir.header
--intro api-filedir.shtml \
643 file.h file.c
dir.h
dir.c
644 ..
/tools
/makedocset
--docset org.cups.ppd.docset \
646 --header api-ppd.header
--intro api-ppd.shtml \
647 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
649 ..
/tools
/makedocset
--docset org.cups.httpipp.docset \
650 --title
"HTTP and IPP APIs" \
651 --header api-httpipp.header
--intro api-httpipp.shtml \
652 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
653 http.c http-addr.c http-support.c ipp.c ipp-support.c \
654 md5passwd.c request.c
655 ..
/tools
/makedocset
--docset org.cups.
filter.docset \
656 --title
"Filter and Backend Programming" \
657 --header api-filter.header
--intro api-filter.shtml \
658 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
669 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".