2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
4 # API library Makefile for CUPS.
6 # Copyright 2007-2010 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.
71 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
72 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
94 # Header files to install...
127 # Targets in this directory...
156 # Make all targets...
163 # Make library targets...
173 unittests
: $(UNITTARGETS
)
177 # Remove object and target files...
181 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
182 $(RM
) libcups.so libcups.sl libcups.dylib
187 # Update dependencies (without system header dependencies...)
191 touch Dependencies.tmp
192 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
194 cp Dependencies.tmp Dependencies
195 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
196 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
197 $(RM
) Dependencies.tmp
201 # Install all targets...
204 install: all install-data install-headers install-libs install-exec
208 # Install data files...
215 # Install programs...
226 echo Installing header files into
$(INCLUDEDIR
)/cups...
227 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
228 for file in
$(HEADERS
); do \
229 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
231 if
test "x$(privateinclude)" != x
; then \
232 echo Installing private header files into
$(PRIVATEINCLUDE
)...
; \
233 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
234 for file in
$(HEADERSPRIV
); do \
235 $(INSTALL_DATA
) $$file $(PRIVATEINCLUDE
)/$$file; \
241 # Install libraries...
244 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
245 echo Installing libraries in
$(LIBDIR
)...
246 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
247 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
248 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
249 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
250 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
252 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
253 $(RM
) $(LIBDIR
)/libcups.dylib
; \
254 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
256 if
test "x$(SYMROOT)" != "x"; then \
257 $(INSTALL_DIR
) $(SYMROOT
); \
258 cp
$(LIBCUPS
) $(SYMROOT
); \
262 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
263 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
264 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
265 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
268 echo Installing libraries in
$(LIB32DIR
)...
269 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
270 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
271 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
274 echo Installing libraries in
$(LIB64DIR
)...
275 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
276 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
277 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
281 # Uninstall object and target files...
284 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
285 $(RM
) $(LIBDIR
)/libcups
.2.dylib
286 $(RM
) $(LIBDIR
)/libcups.a
287 $(RM
) $(LIBDIR
)/libcups.dylib
288 $(RM
) $(LIBDIR
)/libcups_s.a
289 $(RM
) $(LIBDIR
)/libcups.sl
290 $(RM
) $(LIBDIR
)/libcups.sl
.2
291 $(RM
) $(LIBDIR
)/libcups.so
292 $(RM
) $(LIBDIR
)/libcups.so
.2
294 for file in
$(HEADERS
); do \
295 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
297 -$(RMDIR
) $(INCLUDEDIR
)/cups
300 $(RM
) $(LIB32DIR
)/libcups.so
301 $(RM
) $(LIB32DIR
)/libcups.so
.2
302 -$(RMDIR
) $(LIB32DIR
)
305 $(RM
) $(LIB64DIR
)/libcups.so
306 $(RM
) $(LIB64DIR
)/libcups.so
.2
307 -$(RMDIR
) $(LIB64DIR
)
311 # libcups.so.2, libcups.sl.2
314 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
316 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
317 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
318 $(RM
) `basename $@ .2`
319 $(LN
) $@
`basename $@ .2`
326 32bit
/libcups.so
.2: $(LIB32OBJS
)
327 echo Linking
32-bit
$@...
329 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) \
330 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
331 $(RM
) 32bit
/libcups.so
332 $(LN
) libcups.so
.2 32bit
/libcups.so
339 64bit
/libcups.so
.2: $(LIB64OBJS
)
340 echo Linking
64-bit
$@...
342 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) \
343 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
344 $(RM
) 64bit
/libcups.so
345 $(LN
) libcups.so
.2 64bit
/libcups.so
352 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
353 echo Creating
export list for
$@...
354 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
355 grep
-v
-e
'^(_cupsConnect|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
358 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
359 -install_name
$(libdir)/$@ \
360 -current_version
2.8.0 \
361 -compatibility_version
2.0.0 \
362 -exported_symbols_list t.exp \
363 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
364 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
365 $(COMMONLIBS
) $(LIBZ
)
366 $(RM
) libcups.dylib t.exp
367 $(LN
) $@ libcups.dylib
374 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
376 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
377 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
378 $(COMMONLIBS
) $(LIBZ
) -lm
380 $(AR
) $(ARFLAGS
) $@ libcups_s.o
387 libcups.la
: $(LIBOBJS
)
389 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
390 -rpath
$(LIBDIR
) -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) \
391 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
398 libcups.a
: $(LIBOBJS
)
401 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
406 # testadmin (dependency on static CUPS library is intentional)
409 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
411 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
412 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
416 # testarray (dependency on static CUPS library is intentional)
419 testarray
: testarray.o
$(LIBCUPSSTATIC
)
421 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
422 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
423 echo Running array API tests...
428 # testconflicts (dependency on static CUPS library is intentional)
431 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
433 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
434 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
438 # testcups (dependency on static CUPS library is intentional)
441 testcups
: testcups.o
$(LIBCUPSSTATIC
)
443 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
444 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
448 # testfile (dependency on static CUPS library is intentional)
451 testfile
: testfile.o
$(LIBCUPSSTATIC
)
453 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
454 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
455 echo Running file API tests...
460 # testhttp (dependency on static CUPS library is intentional)
463 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
465 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
466 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
467 echo Running HTTP API tests...
472 # testipp (dependency on static CUPS library is intentional)
475 testipp
: testipp.o
$(LIBCUPSSTATIC
)
477 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
478 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
479 echo Running IPP API tests...
484 # testi18n (dependency on static CUPS library is intentional)
487 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
489 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
490 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
491 echo Running internationalization API tests...
496 # testlang (dependency on static CUPS library is intentional)
499 testlang
: testlang.o
$(LIBCUPSSTATIC
)
501 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
502 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
503 echo Running language API tests...
508 # testoptions (dependency on static CUPS library is intentional)
511 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
513 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
514 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
515 echo Running option API tests...
520 # testppd (dependency on static CUPS library is intentional)
523 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
525 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
526 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
527 echo Running PPD API tests...
532 # testpwg (dependency on static CUPS library is intentional)
535 testpwg
: testpwg.o
$(LIBCUPSSTATIC
) test.ppd
537 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testpwg.o
$(LIBCUPSSTATIC
) \
538 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
539 echo Running PWG API tests...
544 # testsnmp (dependency on static CUPS library is intentional)
547 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
549 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
550 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
554 # Automatic API help files...
558 echo Generating CUPS API help files...
559 mxmldoc
--section
"Programming" \
560 --title
"Introduction to CUPS Programming" \
561 --css ..
/doc
/cups-printable.css \
562 --header api-overview.header
--intro api-overview.shtml \
563 >..
/doc
/help
/api-overview.html
564 mxmldoc
--section
"Programming" --title
"Array API" \
565 --css ..
/doc
/cups-printable.css \
566 --header api-array.header
--intro api-array.shtml \
568 array.h array.c
>..
/doc
/help
/api-array.html
569 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
571 mxmldoc
--section
"Programming" --title
"CUPS API" \
572 --css ..
/doc
/cups-printable.css \
573 --header api-cups.header
--intro api-cups.shtml \
575 cups.h adminutil.c dest.c language.c notify.c \
576 options.c tempfile.c usersys.c \
577 util.c
>..
/doc
/help
/api-cups.html
578 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
580 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
581 --css ..
/doc
/cups-printable.css \
582 --header api-filedir.header
--intro api-filedir.shtml \
584 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
585 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
586 $(RM
) api-filedir.xml
587 mxmldoc
--section
"Programming" --title
"PPD API" \
588 --css ..
/doc
/cups-printable.css \
589 --header api-ppd.header
--intro api-ppd.shtml \
591 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
592 ppd.c
>..
/doc
/help
/api-ppd.html
593 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
595 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
596 --css ..
/doc
/cups-printable.css \
597 --header api-httpipp.header
--intro api-httpipp.shtml \
599 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
600 http.c http-addr.c http-support.c ipp.c ipp-support.c \
601 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
602 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
603 $(RM
) api-httpipp.xml
604 mxmldoc
--section
"Programming" \
605 --title
"Filter and Backend Programming" \
606 --css ..
/doc
/cups-printable.css \
607 --header api-filter.header
--intro api-filter.shtml \
609 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
610 >..
/doc
/help
/api-filter.html
611 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
615 echo Generating CUPS API help files...
616 mxmldoc
--framed api-overview \
617 --section
"Programming" \
618 --title
"Introduction to CUPS Programming" \
619 --css ..
/doc
/cups-printable.css \
620 --header api-overview.header
--intro api-overview.shtml
621 mxmldoc
--framed api-array \
622 --section
"Programming" --title
"Array API" \
623 --css ..
/doc
/cups-printable.css \
624 --header api-array.header
--intro api-array.shtml \
626 mxmldoc
--framed api-cups \
627 --section
"Programming" --title
"CUPS API" \
628 --css ..
/doc
/cups-printable.css \
629 --header api-cups.header
--intro api-cups.shtml \
630 cups.h adminutil.c dest.c language.c notify.c \
631 options.c tempfile.c usersys.c \
633 mxmldoc
--framed api-filedir \
634 --section
"Programming" --title
"File and Directory APIs" \
635 --css ..
/doc
/cups-printable.css \
636 --header api-filedir.header
--intro api-filedir.shtml \
637 file.h file.c
dir.h
dir.c
638 mxmldoc
--framed api-ppd \
639 --section
"Programming" --title
"PPD API" \
640 --css ..
/doc
/cups-printable.css \
641 --header api-ppd.header
--intro api-ppd.shtml \
642 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
644 mxmldoc
--framed api-httpipp \
645 --section
"Programming" --title
"HTTP and IPP APIs" \
646 --css ..
/doc
/cups-printable.css \
647 --header api-httpipp.header
--intro api-httpipp.shtml \
648 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
649 http.c http-addr.c http-support.c ipp.c ipp-support.c \
650 md5passwd.c request.c
651 mxmldoc
--framed api-filter \
652 --section
"Programming" \
653 --title
"Filter and Backend Programming" \
654 --css ..
/doc
/cups-printable.css \
655 --header api-filter.header
--intro api-filter.shtml \
656 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
667 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".