]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/Makefile
Update svn:keyword properties.
[thirdparty/cups.git] / scheduler / Makefile
index 9479c7af561f9e19088475d77e757c39157b3326..3c0fff3e12c35c13cc8ac23d614ac8aaeccb443c 100644 (file)
@@ -1,9 +1,9 @@
 #
-# "$Id: Makefile 7875 2008-08-27 22:53:31Z mike $"
+# "$Id$"
 #
-#   Scheduler Makefile for the Common UNIX Printing System (CUPS).
+#   Scheduler Makefile for CUPS.
 #
-#   Copyright 2007-2009 by Apple Inc.
+#   Copyright 2007-2012 by Apple Inc.
 #   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -21,9 +21,11 @@ CUPSDOBJS =  \
                cert.o \
                classes.o \
                client.o \
+               colorman.o \
                conf.o \
                dirsvc.o \
                env.o \
+               file.o \
                main.o \
                ipp.o \
                listen.o \
@@ -34,12 +36,12 @@ CUPSDOBJS = \
                printers.o \
                process.o \
                quotas.o \
-               removefile.o \
                select.o \
                server.o \
                statbuf.o \
                subscriptions.o \
-               sysman.o
+               sysman.o \
+               tls.o
 LIBOBJS =      \
                filter.o \
                mime.o \
@@ -49,9 +51,8 @@ COBJS =       \
                $(LIBOBJS) \
                cupsfilter.o \
                cups-deviced.o \
+               cups-exec.o \
                cups-lpd.o \
-               cups-polld.o \
-               testdirsvc.o \
                testlpd.o \
                testmime.o \
                testspeed.o \
@@ -67,20 +68,22 @@ LIBTARGETS =        \
                libcupsmime.a
 
 UNITTARGETS =  \
-               testdirsvc \
                testlpd \
                testmime \
                testspeed \
                testsub
 
-TARGETS        =       \
-               $(LIBTARGETS) \
+PROGRAMS =     \
                cupsd \
                cupsfilter \
                cups-deviced \
                cups-driverd \
-               cups-lpd \
-               cups-polld \
+               cups-exec \
+               cups-lpd
+
+TARGETS        =       \
+               $(LIBTARGETS) \
+               $(PROGRAMS)
 
 
 #
@@ -119,8 +122,16 @@ clean:
 #
 
 depend:
-       makedepend -Y -I.. -fDependencies $(COBJS:.o=.c) \
-               $(CXXOBJS:.o=.cxx) >/dev/null 2>&1
+       $(CC) -MM $(ALL_CFLAGS) $(COBJS:.o=.c) >Dependencies
+       $(CXX) -MM $(ALL_CXXFLAGS) $(CXXOBJS:.o=.cxx) >>Dependencies
+
+
+#
+# Run oclint to check code coverage...
+#
+
+oclint:
+       oclint -o=oclint.html -html $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
 
 
 #
@@ -152,7 +163,8 @@ install-data:
                $(INSTALL_DIR) -m 755 $(STATEDIR); \
        fi
        echo Creating $(STATEDIR)/certs...
-       $(INSTALL_DIR) -m 511 -g $(CUPS_PRIMARY_SYSTEM_GROUP) $(STATEDIR)/certs
+       $(INSTALL_DIR) -m 511 -o $(CUPS_USER) -g $(CUPS_PRIMARY_SYSTEM_GROUP) \
+               $(STATEDIR)/certs
        echo Creating $(LOGDIR)...
        $(INSTALL_DIR) -m 755 $(LOGDIR)
        echo Creating $(REQUESTS)...
@@ -161,6 +173,43 @@ install-data:
        $(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
        echo Creating $(CACHEDIR)...
        $(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)
+       if test "x$(INITDIR)" != x; then \
+               echo Installing init scripts...; \
+               $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
+               $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
+               for level in $(RCLEVELS); do \
+                       $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
+                       $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
+                       if test `uname` = HP-UX; then \
+                               level=`expr $$level - 1`; \
+                               $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
+                       fi; \
+                       $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
+               done; \
+               $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
+               $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
+       fi
+       if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
+               $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
+               if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
+                       echo Installing LaunchDaemons configuration files...; \
+                       $(INSTALL_DATA) org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
+                       $(INSTALL_DATA) org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
+               else \
+                       echo Installing RC script...; \
+                       $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
+               fi \
+       fi
+       if test "x$(SMFMANIFESTDIR)" != x; then \
+               echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\
+               $(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \
+               $(INSTALL_SCRIPT) cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
+       fi
+       if test "x$(XINETD)" != x; then \
+               echo Installing xinetd configuration file for cups-lpd...; \
+               $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
+               $(INSTALL_DATA) cups-lpd.xinetd $(BUILDROOT)$(XINETD)/cups-lpd; \
+       fi
 
 
 #
@@ -170,23 +219,20 @@ install-data:
 install-exec:
        echo Installing programs in $(SBINDIR)...
        $(INSTALL_DIR) -m 755 $(SBINDIR)
-       $(INSTALL_BIN) -m 500 cupsd $(SBINDIR)
+       $(INSTALL_BIN) -m $(CUPS_CUPSD_FILE_PERM) cupsd $(SBINDIR)
        $(INSTALL_BIN) cupsfilter $(SBINDIR)
-       -if test "x`uname`" = xDarwin; then \
-               $(INSTALL_DIR) $(BUILDROOT)/System/Library/Printers/Libraries; \
-               $(LN) $(sbindir)/cupsfilter $(BUILDROOT)/System/Library/Printers/Libraries/convert; \
-       fi
        echo Installing programs in $(SERVERBIN)/daemon...
        $(INSTALL_DIR) -m 755 $(SERVERBIN)
        $(INSTALL_DIR) -m 755 $(SERVERBIN)/daemon
        $(INSTALL_BIN) cups-deviced $(SERVERBIN)/daemon
        $(INSTALL_BIN) cups-driverd $(SERVERBIN)/daemon
+       $(INSTALL_BIN) cups-exec $(SERVERBIN)/daemon
        $(INSTALL_BIN) cups-lpd $(SERVERBIN)/daemon
-       $(INSTALL_BIN) cups-polld $(SERVERBIN)/daemon
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
-               for file in $(TARGETS); do \
+               for file in $(PROGRAMS); do \
                        cp $$file $(SYMROOT); \
+                       dsymutil $(SYMROOT)/$$file; \
                done \
        fi
 
@@ -220,12 +266,14 @@ install-libs: $(INSTALLSTATIC)
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
                cp $(LIBCUPSMIME) $(SYMROOT); \
+               dsymutil $(SYMROOT)/$(LIBCUPSMIME); \
        fi
 
 installstatic:
        $(INSTALL_DIR) -m 755 $(LIBDIR)
-       $(INSTALL_LIB) libcupsmime.a $(LIBDIR)
+       $(INSTALL_LIB) -m 755 libcupsmime.a $(LIBDIR)
        $(RANLIB) $(LIBDIR)/libcupsmime.a
+       $(CHMOD) 555 $(LIBDIR)/libcupsmime.a
 
 
 #
@@ -237,8 +285,8 @@ uninstall:
        $(RM) $(SBINDIR)/cupsfilter
        $(RM) $(SERVERBIN)/daemon/cups-deviced
        $(RM) $(SERVERBIN)/daemon/cups-driverd
+       $(RM) $(SERVERBIN)/daemon/cups-exec
        $(RM) $(SERVERBIN)/daemon/cups-lpd
-       $(RM) $(SERVERBIN)/daemon/cups-polld
        $(RM) $(BUILDROOT)/System/Library/Printers/Libraries/convert
        -$(RMDIR) $(STATEDIR)/certs
        -$(RMDIR) $(STATEDIR)
@@ -264,6 +312,42 @@ uninstall:
        -$(RMDIR) $(LIBDIR)
        $(RM) $(INCLUDEDIR)/cups/mime.h
        -$(RMDIR) $(INCLUDEDIR)/cups
+       echo Uninstalling startup script...
+       if test "x$(INITDIR)" != x; then \
+               $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
+               $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
+               $(RM)  $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
+               $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
+               $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
+               $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
+               $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
+               $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
+               $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
+               $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
+       fi
+       if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
+               if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
+                       $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
+               elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
+                       $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
+               else \
+                       $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
+               fi \
+               $(RMDIR) $(BUILDROOT)$(INITDDIR); \
+       fi
+       if test "x$(SMFMANIFESTDIR)" != x; then \
+               echo Uninstalling SMF manifest in $(SMFMANIFESTDIR)...;\
+               $(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
+       fi
+       if test "x$(XINETD)" != x; then \
+               echo Uninstalling xinetd configuration file for cups-lpd...; \
+               $(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \
+       fi
 
 
 #
@@ -276,6 +360,8 @@ apihelp:
                --css ../doc/cups-printable.css \
                --header api-mime.header --intro api-mime.shtml \
                mime.h $(LIBOBJS:.o=.c) >../doc/help/api-mime.html
+       mxmldoc --tokens help/api-mime.html api-mime.xml >../doc/help/api-mime.tokens
+       $(RM) api-mime.xml
 
 framedhelp:
        mxmldoc --framed api-mime \
@@ -294,17 +380,19 @@ cupsd:    $(CUPSDOBJS) $(LIBCUPSMIME) ../cups/$(LIBCUPS)
        echo Linking $@...
        $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
                $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
-               $(LIBPAPER) $(LIBMALLOC) $(CUPSDLIBS) $(DNSSDLIBS) $(LIBS) \
+               $(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \
                $(LIBGSSAPI) $(LIBWRAP)
 
-cupsd-static:  $(CUPSDOBJS) libcupsmime.a ../cups/libcups.a
+cupsd-static:  $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
        echo Linking $@...
        $(CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libcupsmime.a \
                $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
-               ../cups/libcups.a $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
-               $(LIBMALLOC) $(CUPSDLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
+               ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
+               $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
                $(LIBWRAP)
 
+tls.o: tls-darwin.c tls-gnutls.c tls-openssl.c
+
 
 #
 # Make the cupsfilter utility.
@@ -337,21 +425,21 @@ cups-driverd:     cups-driverd.o util.o ../cups/$(LIBCUPS) ../ppdc/$(LIBCUPSPPDC)
 
 
 #
-# Make the line printer daemon, "cups-lpd".
+# Make the sandbox execution helper, "cups-exec".
 #
 
-cups-lpd:      cups-lpd.o ../cups/$(LIBCUPS)
+cups-exec:     cups-exec.o
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
+       $(CC) $(LDFLAGS) -o cups-exec cups-exec.o $(LIBS)
 
 
 #
-# Make the polling daemon, "cups-polld".
+# Make the line printer daemon, "cups-lpd".
 #
 
-cups-polld:    cups-polld.o ../cups/$(LIBCUPS)
+cups-lpd:      cups-lpd.o ../cups/$(LIBCUPS)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o cups-polld cups-polld.o $(LIBS)
+       $(CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
 
 
 #
@@ -413,22 +501,13 @@ libcupsmime.a:    $(LIBOBJS)
        $(RANLIB) $@
 
 
-#
-# Make the test program, "testdirsvc".
-#
-
-testdirsvc:    testdirsvc.o
-       echo Linking $@...
-       $(CC) $(LDFLAGS) -o testdirsvc testdirsvc.o $(COMMONLIBS) $(NETLIBS)
-
-
 #
 # Make the test program, "testlpd".
 #
 
-testlpd:       testlpd.o ../cups/libcups.a cups-lpd
+testlpd:       testlpd.o ../cups/$(LIBCUPSSTATIC) cups-lpd
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/libcups.a \
+       $(CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/$(LIBCUPSSTATIC) \
                $(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
 
 
@@ -436,10 +515,10 @@ testlpd:  testlpd.o ../cups/libcups.a cups-lpd
 # testmime
 #
 
-testmime:      testmime.o libcupsmime.a ../cups/libcups.a
+testmime:      testmime.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
        echo Linking $@...
        $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
-               ../cups/libcups.a $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
+               ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
                $(DNSSDLIBS) $(LIBGSSAPI)
        echo Running MIME tests...
        ./testmime
@@ -449,9 +528,9 @@ testmime:   testmime.o libcupsmime.a ../cups/libcups.a
 # Make the test program, "testspeed".
 #
 
-testspeed:     testspeed.o ../cups/libcups.a
+testspeed:     testspeed.o ../cups/$(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/libcups.a \
+       $(CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/$(LIBCUPSSTATIC) \
                $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
 
 
@@ -459,19 +538,28 @@ testspeed:        testspeed.o ../cups/libcups.a
 # Make the test program, "testsub".
 #
 
-testsub:       testsub.o ../cups/libcups.a
+testsub:       testsub.o ../cups/$(LIBCUPSSTATIC)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o testsub testsub.o ../cups/libcups.a \
+       $(CC) $(LDFLAGS) -o testsub testsub.o ../cups/$(LIBCUPSSTATIC) \
                $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
 
 
+#
+# Lines of code computation...
+#
+
+sloc:
+       echo "cupsd: \c"
+       sloccount $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) cups-driverd.cxx cups-lpd.c 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
+
+
 #
 # Dependencies...
 #
-  
+
 include Dependencies
 
 
 #
-# End of "$Id: Makefile 7875 2008-08-27 22:53:31Z mike $".
+# End of "$Id$".
 #