]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/Makefile
Non-Kerberized IPP printing to Windows was broken (Issue #5515)
[thirdparty/cups.git] / cups / Makefile
index 8674389640d3a15ea672577aba53fbf6dc34fa91..38080914d36925f231c86de5913210520dd99076 100644 (file)
 #
-# "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
+# Library Makefile for CUPS.
 #
-#   API library Makefile for the Common UNIX Printing System (CUPS).
+# Copyright © 2007-2019 by Apple Inc.
+# Copyright © 1997-2006 by Easy Software Products, all rights reserved.
 #
-#   Copyright 2007-2008 by Apple Inc.
-#   Copyright 1997-2006 by Easy Software Products, all rights reserved.
-#
-#   These coded instructions, statements, and computer programs are the
-#   property of Apple Inc. and are protected by Federal copyright
-#   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-#   which should have been included with this file.  If this file is
-#   file is missing or damaged, see the license at "http://www.cups.org/".
-#
-#   This file is subject to the Apple OS-Developed Software exception.
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 include ../Makedefs
 
+
 #
 # Object files...
 #
 
-LIBOBJS        =       \
-               adminutil.o \
+COREOBJS       =       \
                array.o \
-               attr.o \
                auth.o \
-               backchannel.o \
-               backend.o \
-               conflicts.o \
-               custom.o \
                debug.o \
                dest.o \
+               dest-job.o \
+               dest-localization.o \
+               dest-options.o \
                dir.o \
-               emit.o \
                encode.o \
                file.o \
-               getdevices.o \
-               getifaddrs.o \
                getputfile.o \
                globals.o \
+               hash.o \
                http.o \
                http-addr.o \
                http-addrlist.o \
                http-support.o \
                ipp.o \
+               ipp-file.o \
+               ipp-vars.o \
                ipp-support.o \
                langprintf.o \
                language.o \
-               localize.o \
-               mark.o \
                md5.o \
                md5passwd.o \
                notify.o \
                options.o \
-               page.o \
-               ppd.o \
+               pwg-media.o \
+               raster-error.o \
+               raster-stream.o \
+               raster-stubs.o \
                request.o \
-               sidechannel.o \
-               snmp.o \
                snprintf.o \
                string.o \
                tempfile.o \
+               thread.o \
+               tls.o \
                transcode.o \
                usersys.o \
                util.o
-LIB32OBJS      = $(LIBOBJS:.o=.32.o)
-LIB64OBJS      = $(LIBOBJS:.o=.64.o)
-OBJS   =       \
-               $(LIBOBJS) \
-               $(LIB32OBJS) \
-               $(LIB64OBJS) \
+
+DRIVEROBJS     =       \
+               adminutil.o \
+               backchannel.o \
+               backend.o \
+               getdevices.o \
+               getifaddrs.o \
+               ppd.o \
+               ppd-attr.o \
+               ppd-cache.o \
+               ppd-conflicts.o \
+               ppd-custom.o \
+               ppd-emit.o \
+               ppd-localize.o \
+               ppd-mark.o \
+               ppd-page.o \
+               ppd-util.o \
+               raster-interpret.o \
+               raster-interstub.o \
+               sidechannel.o \
+               snmp.o
+
+LIBOBJS                = \
+               $(LIBCUPSOBJS)
+
+IMAGEOBJS      = \
+               raster-interstub.o \
+               raster-stubs.o
+
+TESTOBJS       = \
+               rasterbench.o \
                testadmin.o \
                testarray.o \
+               testcache.o \
+               testclient.o \
                testconflicts.o \
+               testcreds.o \
                testcups.o \
+               testdest.o \
                testfile.o \
+               testgetdests.o \
                testhttp.o \
                testi18n.o \
                testipp.o \
                testoptions.o \
                testlang.o \
                testppd.o \
+               testpwg.o \
+               testraster.o \
                testsnmp.o \
-               php_cups_wrap.o
+               tlscheck.o
+OBJS   =       \
+               $(LIBOBJS) \
+               $(IMAGEOBJS) \
+               $(TESTOBJS)
 
 
 #
 # Header files to install...
 #
 
-HEADERS        =       \
-               adminutil.h \
+COREHEADERS    =       \
                array.h \
-               backend.h \
                cups.h \
                dir.h \
                file.h \
                http.h \
                ipp.h \
                language.h \
-               ppd.h \
+               pwg.h \
                raster.h \
-               sidechannel.h \
                transcode.h \
                versioning.h
 
+DRIVERHEADERS  =       \
+               adminutil.h \
+               backend.h \
+               ppd.h \
+               sidechannel.h
+
+HEADERS                =       \
+               $(LIBHEADERS)
+
+COREHEADERSPRIV =      \
+               array-private.h \
+               cups-private.h \
+               debug-private.h \
+               file-private.h \
+               http-private.h \
+               ipp-private.h \
+               language-private.h \
+               pwg-private.h \
+               raster-private.h \
+               string-private.h \
+               thread-private.h
+
+DRIVERHEADERSPRIV      =       \
+               ppd-private.h \
+               snmp-private.h
+
+HEADERSPRIV    =       \
+               $(LIBHEADERSPRIV)
+
 
 #
 # Targets in this directory...
 #
 
 LIBTARGETS =   \
+               $(LIBCUPSIMAGE) \
+               $(LIBCUPSSTATIC) \
                $(LIBCUPS) \
-               $(LIB32CUPS) \
-               $(LIB64CUPS) \
-               libcups.a
+               libcupsimage.a
 
 UNITTARGETS =  \
+               rasterbench \
                testadmin \
                testarray \
+               testcache \
+               testclient \
                testconflicts \
+               testcreds \
                testcups \
+               testdest \
                testfile \
+               testgetdests \
                testhttp \
                testi18n \
                testipp \
                testlang \
                testoptions \
                testppd \
-               testsnmp
+               testpwg \
+               testraster \
+               testsnmp \
+               tlscheck
 
 TARGETS        =       \
                $(LIBTARGETS)
@@ -139,7 +201,7 @@ TARGETS     =       \
 # Make all targets...
 #
 
-all:   $(TARGETS)
+all:           $(TARGETS)
 
 
 #
@@ -162,8 +224,8 @@ unittests:  $(UNITTARGETS)
 
 clean:
        $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
-       $(RM) libcups.so libcups.sl libcups.dylib
-       $(RM) -r 32bit 64bit
+       $(RM) libcups.so libcups.dylib
+       $(RM) libcupsimage.so libcupsimage.dylib
 
 
 #
@@ -171,13 +233,15 @@ clean:
 #
 
 depend:
-       touch Dependencies.tmp
-       makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
-       $(RM) Dependencies
-       cp Dependencies.tmp Dependencies
-       sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
-       sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
-       $(RM) Dependencies.tmp
+       $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
+
+
+#
+# Run oclint to check code coverage...
+#
+
+oclint:
+       oclint -o=oclint.html -html $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
 
 
 #
@@ -211,17 +275,24 @@ install-headers:
        for file in $(HEADERS); do \
                $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
        done
+       if test "x$(privateinclude)" != x; then \
+               echo Installing private header files into $(PRIVATEINCLUDE)...; \
+               $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
+               for file in $(HEADERSPRIV); do \
+                       $(INSTALL_DATA) $$file $(PRIVATEINCLUDE)/$$file; \
+               done; \
+       fi
 
 
 #
 # Install libraries...
 #
 
-install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
+install-libs: $(LIBTARGETS) $(INSTALLSTATIC)
        echo Installing libraries in $(LIBDIR)...
        $(INSTALL_DIR) -m 755 $(LIBDIR)
        $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
-       if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
+       if test $(LIBCUPS) = "libcups.so.2"; then \
                $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
                $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
        fi
@@ -229,229 +300,315 @@ install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
                $(RM) $(LIBDIR)/libcups.dylib; \
                $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
        fi
+       -if test "x$(LIBCUPSIMAGE)" != x; then \
+               $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR); \
+       fi
+       -if test "x$(LIBCUPSIMAGE)" = "xlibcupsimage.so.2"; then \
+               $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
+               $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
+       fi
+       -if test "x$(LIBCUPSIMAGE)" = "xlibcupsimage.2.dylib"; then \
+               $(RM) $(LIBDIR)/libcupsimage.dylib; \
+               $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
+       fi
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
                cp $(LIBCUPS) $(SYMROOT); \
+               dsymutil $(SYMROOT)/$(LIBCUPS); \
+               if test "x$(LIBCUPSIMAGE)" != x; then \
+                       cp $(LIBCUPSIMAGE) $(SYMROOT); \
+                       dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
+               fi; \
        fi
 
 installstatic:
        $(INSTALL_DIR) -m 755 $(LIBDIR)
-       $(INSTALL_LIB) libcups.a $(LIBDIR)
-       $(RANLIB) $(LIBDIR)/libcups.a
-
-install32bit:
-       echo Installing libraries in $(LIB32DIR)...
-       $(INSTALL_DIR) -m 755 $(LIB32DIR)
-       $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
-       $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
-
-install64bit:
-       echo Installing libraries in $(LIB64DIR)...
-       $(INSTALL_DIR) -m 755 $(LIB64DIR)
-       $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
-       $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
+       $(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
+       $(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
+       $(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
+       $(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR)
+       $(RANLIB) $(LIBDIR)/libcupsimage.a
+       $(CHMOD) 555 $(LIBDIR)/libcupsimage.a
 
 
 #
 # Uninstall object and target files...
 #
 
-uninstall: $(UNINSTALL32) $(UNINSTALL64)
+uninstall:
        $(RM) $(LIBDIR)/libcups.2.dylib
        $(RM) $(LIBDIR)/libcups.a
        $(RM) $(LIBDIR)/libcups.dylib
-       $(RM) $(LIBDIR)/libcups_s.a
-       $(RM) $(LIBDIR)/libcups.sl
-       $(RM) $(LIBDIR)/libcups.sl.2
        $(RM) $(LIBDIR)/libcups.so
        $(RM) $(LIBDIR)/libcups.so.2
+       $(RM) $(LIBDIR)/libcupsimage.2.dylib
+       $(RM) $(LIBDIR)/libcupsimage.a
+       $(RM) $(LIBDIR)/libcupsimage.dylib
+       $(RM) $(LIBDIR)/libcupsimage.so
+       $(RM) $(LIBDIR)/libcupsimage.so.2
        -$(RMDIR) $(LIBDIR)
        for file in $(HEADERS); do \
                $(RM) $(INCLUDEDIR)/cups/$$file; \
        done
        -$(RMDIR) $(INCLUDEDIR)/cups
-
-uninstall32bit:
-       $(RM) $(LIB32DIR)/libcups.so
-       $(RM) $(LIB32DIR)/libcups.so.2
-       -$(RMDIR) $(LIB32DIR)
-
-uninstall64bit:
-       $(RM) $(LIB64DIR)/libcups.so
-       $(RM) $(LIB64DIR)/libcups.so.2
-       -$(RMDIR) $(LIB64DIR)
+       if test "x$(privateinclude)" != x; then \
+               for file in $(HEADERSPRIV); do \
+                       $(RM) $(PRIVATEINCLUDE)/cups/$$file; \
+               done
+               $(RMDIR) $(PRIVATEINCLUDE)/cups; \
+       fi
 
 
 #
-# libcups.so.2, libcups.sl.2
+# libcups.so.2
 #
 
-libcups.so.2 libcups.sl.2:     $(LIBOBJS)
+libcups.so.2:  $(LIBOBJS)
        echo Linking $@...
-       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
        $(RM) `basename $@ .2`
        $(LN) $@ `basename $@ .2`
 
 
 #
-# 32bit/libcups.so.2
+# libcups.2.dylib
 #
 
-32bit/libcups.so.2:    $(LIB32OBJS)
-       echo Linking 32-bit $@...
-       -mkdir 32bit
-       $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-       $(RM) 32bit/libcups.so
-       $(LN) libcups.so.2 32bit/libcups.so
+libcups.2.dylib:       $(LIBOBJS)
+       echo Linking $@...
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
+               -install_name $(libdir)/$@ \
+               -current_version 2.14.0 \
+               -compatibility_version 2.0.0 \
+               $(LIBOBJS) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+       $(RM) libcups.dylib
+       $(LN) $@ libcups.dylib
 
 
 #
-# 64bit/libcups.so.2
+# libcups.la
 #
 
-64bit/libcups.so.2:    $(LIB64OBJS)
-       echo Linking 64-bit $@...
-       -mkdir 64bit
-       $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-       $(RM) 64bit/libcups.so
-       $(LN) libcups.so.2 64bit/libcups.so
+libcups.la:    $(LIBOBJS)
+       echo Linking $@...
+       $(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
+               -rpath $(LIBDIR) -version-info 2:14 $(LIBGSSAPI) $(SSLLIBS) \
+               $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
 
 
 #
-# libcups.2.dylib
+# libcups.a
+#
+
+libcups.a:     $(LIBOBJS)
+       echo Archiving $@...
+       $(RM) $@
+       $(AR) $(ARFLAGS) $@ $(LIBOBJS)
+       $(RANLIB) $@
+
+
+#
+# libcups2.def (Windows DLL exports file...)
 #
 
-libcups.2.dylib:       $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
+libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
+       echo Generating $@...
+       echo "LIBRARY libcups2" >libcups2.def
+       echo "VERSION 2.14" >>libcups2.def
+       echo "EXPORTS" >>libcups2.def
+       (nm $(LIBOBJS) $(IMAGEOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
+        echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
+               grep -v -E \
+                   -e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel|SNMP' \
+                   -e 'Block$$' | \
+               sed -e '1,$$s/^_//' | sort >>libcups2.def
+
+
+#
+# libcupsimage.so.2
+#
+
+libcupsimage.so.2:     $(IMAGEOBJS) libcups.so.2
        echo Linking $@...
-       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-               -install_name $(libdir)/$@ \
-               -current_version 2.8.0 \
-               -compatibility_version 2.0.0 \
-               -exported_symbols_list libcups.exp \
-               -sectorder __TEXT __text $(LIBCUPSORDER) \
-               $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-       $(RM) libcups.dylib
-       $(LN) $@ libcups.dylib
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS)
+       $(RM) `basename $@ .2`
+       $(LN) $@ `basename $@ .2`
 
 
 #
-# libcups_s.a
+# libcupsimage.2.dylib
 #
 
-libcups_s.a:   $(LIBOBJS) libcups_s.exp
-       echo Creating $@...
-       $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
-       $(RM) $@
-       $(AR) $(ARFLAGS) $@ libcups_s.o
+libcupsimage.2.dylib:  $(IMAGEOBJS) libcups.2.dylib
+       echo Linking $@...
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
+               -install_name $(libdir)/$@ \
+               -current_version 2.3.0 \
+               -compatibility_version 2.0.0 \
+               $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+       $(RM) libcupsimage.dylib
+       $(LN) $@ libcupsimage.dylib
 
 
 #
-# libcups.la
+# libcupsimage.la
 #
 
-libcups.la:    $(LIBOBJS)
+libcupsimage.la:       $(IMAGEOBJS) libcups.la
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-               -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
+               $(LINKCUPS) -rpath $(LIBDIR) -version-info 2:3
 
 
 #
-# libcups.a
+# libcupsimage.a
 #
 
-libcups.a:     $(LIBOBJS)
+libcupsimage.a:        $(IMAGEOBJS)
        echo Archiving $@...
        $(RM) $@
-       $(AR) $(ARFLAGS) $@ $(LIBOBJS)
+       $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
        $(RANLIB) $@
 
 
 #
-# CUPS language bindings for various scripting languages...
-#
-# NOTE: Not currently used or functional - see the scripting/php directory
-#       for the hand-written bindings...
+# rasterbench (dependency on static CUPS library is intentional)
 #
 
-phpcups.so:    $(LIBCUPS) php_cups_wrap.o
+rasterbench:   rasterbench.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       if test `uname` = Darwin; then \
-               DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
-       else \
-               DSOFLAGS="$(DSOFLAGS)"; \
-       fi; \
-       $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
-
-php_cups_wrap.o:       php_cups_wrap.c
-       echo Compiling $<...
-       $(CC) $(CFLAGS) `php-config --includes` -c $<
-php_cups_wrap.c:       cups.h
-       echo Creating $< using SWIG...
-       swig -php -o $@ -module cups cups.h
+       $(LD_CC) $(LDFLAGS) -o $@ rasterbench.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
 
 
 #
 # testadmin (dependency on static CUPS library is intentional)
 #
 
-testadmin:     testadmin.o libcups.a
+testadmin:     testadmin.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
 
 
 #
 # testarray (dependency on static CUPS library is intentional)
 #
 
-testarray:     testarray.o libcups.a
+testarray:     testarray.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running array API tests...
        ./testarray
 
 
+#
+# testcache (dependency on static CUPS library is intentional)
+#
+
+testcache:     testcache.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+
+
+#
+# testclient (dependency on static libraries is intentional)
+#
+
+testclient:    testclient.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(LDFLAGS) -o $@ testclient.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+
+
 #
 # testconflicts (dependency on static CUPS library is intentional)
 #
 
-testconflicts: testconflicts.o libcups.a
+testconflicts: testconflicts.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testconflicts.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+
+
+#
+# testcreds (dependency on static CUPS library is intentional)
+#
+
+testcreds:     testcreds.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
 
 
 #
 # testcups (dependency on static CUPS library is intentional)
 #
 
-testcups:      testcups.o libcups.a
+testcups:      testcups.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+
+
+#
+# testdest (dependency on static CUPS library is intentional)
+#
+
+testdest:      testdest.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
 
 
 #
 # testfile (dependency on static CUPS library is intentional)
 #
 
-testfile:      testfile.o libcups.a
+testfile:      testfile.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running file API tests...
        ./testfile
 
 
+#
+# testgetdests (dependency on static CUPS library is intentional)
+#
+
+testgetdests:  testgetdests.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(LDFLAGS) -o $@ testgetdests.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+
+
 #
 # testhttp (dependency on static CUPS library is intentional)
 #
 
-testhttp:      testhttp.o libcups.a
+testhttp:      testhttp.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running HTTP API tests...
        ./testhttp
 
@@ -460,10 +617,11 @@ testhttp: testhttp.o libcups.a
 # testipp (dependency on static CUPS library is intentional)
 #
 
-testipp:       testipp.o libcups.a
+testipp:       testipp.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running IPP API tests...
        ./testipp
 
@@ -472,10 +630,11 @@ testipp:  testipp.o libcups.a
 # testi18n (dependency on static CUPS library is intentional)
 #
 
-testi18n:      testi18n.o libcups.a
+testi18n:      testi18n.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running internationalization API tests...
        ./testi18n
 
@@ -484,22 +643,31 @@ testi18n: testi18n.o libcups.a
 # testlang (dependency on static CUPS library is intentional)
 #
 
-testlang:      testlang.o libcups.a
+testlang:      testlang.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+       echo Creating locale directory structure...
+       $(RM) -r locale
+       for po in ../locale/cups_*.po; do \
+               lang=`basename $$po .po | sed -e '1,$$s/^cups_//'`; \
+               $(MKDIR) locale/$$lang; \
+               $(LN) ../../$$po locale/$$lang; \
+       done
        echo Running language API tests...
-       ./testlang
+       LOCALEDIR=locale ./testlang
 
 
 #
 # testoptions (dependency on static CUPS library is intentional)
 #
 
-testoptions:   testoptions.o libcups.a
+testoptions:   testoptions.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running option API tests...
        ./testoptions
 
@@ -508,22 +676,62 @@ testoptions:      testoptions.o libcups.a
 # testppd (dependency on static CUPS library is intentional)
 #
 
-testppd:       testppd.o libcups.a
+testppd:       testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
        echo Linking $@...
-       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
        echo Running PPD API tests...
        ./testppd
 
 
+#
+# testpwg (dependency on static CUPS library is intentional)
+#
+
+testpwg:       testpwg.o $(LIBCUPSSTATIC) test.ppd
+       echo Linking $@...
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+       echo Running PWG API tests...
+       ./testpwg test.ppd
+
+
+#
+# testraster (dependency on static CUPS library is intentional)
+#
+
+testraster:    testraster.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o \
+               $(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
+               $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+       echo Running raster API tests...
+       ./testraster
+
+
 #
 # testsnmp (dependency on static CUPS library is intentional)
 #
 
-testsnmp:      testsnmp.o libcups.a
+testsnmp:      testsnmp.o $(LIBCUPSSTATIC)
+       echo Linking $@...
+       $(LD_CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
+
+
+#
+# tlscheck (dependency on static CUPS library is intentional)
+#
+
+tlscheck:      tlscheck.o $(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
-               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+       $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
+               $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+       $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
 
 
 #
@@ -532,131 +740,51 @@ testsnmp:        testsnmp.o libcups.a
 
 apihelp:
        echo Generating CUPS API help files...
-       mxmldoc --section "Programming" \
-               --title "Introduction to CUPS Programming" \
-               --css ../doc/cups-printable.css \
-               --header api-overview.header --intro api-overview.shtml \
-               >../doc/help/api-overview.html
-       mxmldoc --section "Programming" --title "Array API" \
-               --css ../doc/cups-printable.css \
-               --header api-array.header --intro api-array.shtml \
-               array.h array.c >../doc/help/api-array.html
-       mxmldoc --section "Programming" --title "CUPS API" \
+       $(RM) cupspm.xml
+       codedoc --section "Programming" --body cupspm.md \
+               cupspm.xml \
+               auth.c cups.h dest*.c encode.c http.h http*.c ipp.h ipp*.c \
+               options.c tls-darwin.c usersys.c util.c \
+               --coverimage cupspm.png \
+               --epub ../doc/help/cupspm.epub
+       codedoc --section "Programming" --body cupspm.md \
+               cupspm.xml > ../doc/help/cupspm.html
+       $(RM) cupspm.xml
+       codedoc --section "Programming" --title "Administration APIs" \
                --css ../doc/cups-printable.css \
-               --header api-cups.header --intro api-cups.shtml \
-               cups.h adminutil.c dest.c language.c notify.c \
-               options.c tempfile.c usersys.c \
-               util.c >../doc/help/api-cups.html
-       mxmldoc --section "Programming" --title "File and Directory APIs" \
-               --css ../doc/cups-printable.css \
-               --header api-filedir.header --intro api-filedir.shtml \
-               file.h file.c dir.h dir.c >../doc/help/api-filedir.html
-       mxmldoc --section "Programming" --title "PPD API" \
+               --header api-admin.header --intro api-admin.shtml \
+               adminutil.c adminutil.h getdevices.c >../doc/help/api-admin.html
+       codedoc --section "Programming" --title "PPD API (DEPRECATED)" \
                --css ../doc/cups-printable.css \
                --header api-ppd.header --intro api-ppd.shtml \
-               ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
-               ppd.c >../doc/help/api-ppd.html
-       mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
+               ppd.h ppd-*.c >../doc/help/api-ppd.html
+       codedoc --section "Programming" --title "Raster API" \
                --css ../doc/cups-printable.css \
-               --header api-httpipp.header --intro api-httpipp.shtml \
-               http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
-               http.c http-addr.c http-support.c ipp.c ipp-support.c \
-               md5passwd.c request.c >../doc/help/api-httpipp.html
-       mxmldoc --section "Programming" \
+               --header api-raster.header --intro api-raster.shtml \
+               ../cups/raster.h interpret.c raster.c \
+               >../doc/help/api-raster.html
+       codedoc --section "Programming" \
                --title "Filter and Backend Programming" \
                --css ../doc/cups-printable.css \
                --header api-filter.header --intro api-filter.shtml \
                backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
                >../doc/help/api-filter.html
 
-framedhelp:
-       echo Generating CUPS API help files...
-       mxmldoc --framed api-overview \
-               --section "Programming" \
-               --title "Introduction to CUPS Programming" \
-               --css ../doc/cups-printable.css \
-               --header api-overview.header --intro api-overview.shtml
-       mxmldoc --framed api-array \
-               --section "Programming" --title "Array API" \
-               --css ../doc/cups-printable.css \
-               --header api-array.header --intro api-array.shtml \
-               array.h array.c
-       mxmldoc --framed api-cups \
-               --section "Programming" --title "CUPS API" \
-               --css ../doc/cups-printable.css \
-               --header api-cups.header --intro api-cups.shtml \
-               cups.h adminutil.c dest.c language.c notify.c \
-               options.c tempfile.c usersys.c \
-               util.c
-       mxmldoc --framed api-filedir \
-               --section "Programming" --title "File and Directory APIs" \
-               --css ../doc/cups-printable.css \
-               --header api-filedir.header --intro api-filedir.shtml \
-               file.h file.c dir.h dir.c
-       mxmldoc --framed api-ppd \
-               --section "Programming" --title "PPD API" \
-               --css ../doc/cups-printable.css \
-               --header api-ppd.header --intro api-ppd.shtml \
-               ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
-               page.c ppd.c
-       mxmldoc --framed api-httpipp \
-               --section "Programming" --title "HTTP and IPP APIs" \
-               --css ../doc/cups-printable.css \
-               --header api-httpipp.header --intro api-httpipp.shtml \
-               http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
-               http.c http-addr.c http-support.c ipp.c ipp-support.c \
-               md5passwd.c request.c
-       mxmldoc --framed api-filter \
-               --section "Programming" \
-               --title "Filter and Backend Programming" \
-               --css ../doc/cups-printable.css \
-               --header api-filter.header --intro api-filter.shtml \
-               backchannel.c backend.h backend.c sidechannel.c sidechannel.h
-
-
-docsets:
-       echo Generating CUPS API documentation sets...
-       ../tools/makedocset --docset org.cups.overview.docset \
-               --title "Introduction to CUPS Programming" \
-               --header api-overview.header --intro api-overview.shtml
-       ../tools/makedocset --docset org.cups.array.docset \
-               --title "Array API" \
-               --header api-array.header --intro api-array.shtml \
-               array.h array.c
-       ../tools/makedocset --docset org.cups.cups.docset \
-               --title "CUPS API" \
-               --header api-cups.header --intro api-cups.shtml \
-               cups.h adminutil.c dest.c language.c notify.c \
-               options.c tempfile.c usersys.c \
-               util.c
-       ../tools/makedocset --docset org.cups.filedir.docset \
-               --title "File and Directory APIs" \
-               --header api-filedir.header --intro api-filedir.shtml \
-               file.h file.c dir.h dir.c
-       ../tools/makedocset --docset org.cups.ppd.docset \
-               --title "PPD API" \
-               --header api-ppd.header --intro api-ppd.shtml \
-               ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
-               page.c ppd.c
-       ../tools/makedocset --docset org.cups.httpipp.docset \
-               --title "HTTP and IPP APIs" \
-               --header api-httpipp.header --intro api-httpipp.shtml \
-               http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
-               http.c http-addr.c http-support.c ipp.c ipp-support.c \
-               md5passwd.c request.c
-       ../tools/makedocset --docset org.cups.filter.docset \
-               --title "Filter and Backend Programming" \
-               --header api-filter.header --intro api-filter.shtml \
-               backchannel.c backend.h backend.c sidechannel.c sidechannel.h
-
 
 #
-# Dependencies...
+# Lines of code computation...
 #
 
-include Dependencies
+sloc:
+       echo "libcups: \c"
+       sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
+       echo "libcupsimage: \c"
+       sloccount $(IMAGEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
 
 
 #
-# End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
+# Dependencies...
 #
+
+include Dependencies
+tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c