X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=Makefile;h=7be3bac5981c26b1d4b033773e5483a75ec646fc;hp=99a042d5b98e71a37b0658a3b4af20879049b4a5;hb=5f64df29828e9ca71164342efd357e9debfb6e44;hpb=a4d045870e17abe8840b77615c0d59f4b332ee31 diff --git a/Makefile b/Makefile index 99a042d5b..7be3bac59 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,16 @@ # -# "$Id: Makefile 5023 2006-01-29 14:39:44Z mike $" +# "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $" # # Top-level Makefile for the Common UNIX Printing System (CUPS). # -# Copyright 1997-2006 by Easy Software Products, all rights reserved. +# Copyright 2007-2008 by Apple Inc. +# Copyright 1997-2007 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the -# property of Easy Software Products 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 missing or damaged please contact Easy Software Products -# at: -# -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636-3142 USA -# -# Voice: (301) 373-9600 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org +# 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/". # include Makedefs @@ -28,8 +19,11 @@ include Makedefs # Directories to make... # -DIRS = cups backend berkeley cgi-bin filter locale man pdftops \ - notifier scheduler systemv test +DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \ + notifier ppdc scheduler systemv test \ + $(PHPDIR) \ + conf data doc $(FONTS) templates + # # Make all targets... @@ -37,11 +31,58 @@ DIRS = cups backend berkeley cgi-bin filter locale man pdftops \ all: chmod +x cups-config + echo Using ARCHFLAGS="$(ARCHFLAGS)" + echo Using ALL_CFLAGS="$(ALL_CFLAGS)" + echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" + echo Using CC="$(CC)" + echo Using CXX="$(CC)" + echo Using DSOFLAGS="$(DSOFLAGS)" + echo Using LDFLAGS="$(LDFLAGS)" + echo Using LIBS="$(LIBS)" for dir in $(DIRS); do\ echo Making all in $$dir... ;\ - (cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\ + (cd $$dir ; $(MAKE) $(MFLAGS) all) || exit 1;\ done + +# +# Make library targets... +# + +libs: + echo Using ARCHFLAGS="$(ARCHFLAGS)" + echo Using ALL_CFLAGS="$(ALL_CFLAGS)" + echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" + echo Using CC="$(CC)" + echo Using CXX="$(CC)" + echo Using DSOFLAGS="$(DSOFLAGS)" + echo Using LDFLAGS="$(LDFLAGS)" + echo Using LIBS="$(LIBS)" + for dir in $(DIRS); do\ + echo Making libraries in $$dir... ;\ + (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\ + done + + +# +# Make unit test targets... +# + +unittests: + echo Using ARCHFLAGS="$(ARCHFLAGS)" + echo Using ALL_CFLAGS="$(ALL_CFLAGS)" + echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" + echo Using CC="$(CC)" + echo Using CXX="$(CC)" + echo Using DSOFLAGS="$(DSOFLAGS)" + echo Using LDFLAGS="$(LDFLAGS)" + echo Using LIBS="$(LIBS)" + for dir in $(DIRS); do\ + echo Making all in $$dir... ;\ + (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\ + done + + # # Remove object and target files... # @@ -52,6 +93,28 @@ clean: (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\ done + +# +# Remove all non-distribution files... +# + +distclean: clean + $(RM) Makedefs config.h config.log config.status + $(RM) cups-config + $(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf + $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html + $(RM) init/cups.sh init/cups-lpd init/org.cups.cups-lpd.plist + $(RM) man/client.conf.man + $(RM) man/cups-deviced.man man/cups-driverd.man + $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man + $(RM) man/cupsd.conf.man man/lpoptions.man + $(RM) packaging/cups.list + $(RM) templates/header.tmpl + -$(RM) doc/*/index.html + -$(RM) templates/*/header.tmpl + -$(RM) -r autom4te*.cache + + # # Make dependencies # @@ -64,112 +127,247 @@ depend: # -# Install object and target files... +# Run the clang.llvm.org static code analysis tool on the C sources. # -install: installhdrs +.PHONY: clang +clang: + if test ! -d clang; then \ + mkdir clang; \ + else \ + rm -rf clang/*; \ + fi + $(MAKE) $(MFLAGS) CC="scan-build -o ../clang $(CC)" \ + CXX="scan-build -o ../clang $(CXX)" clean all + test `ls -1 clang | wc -l` = 0 + + +# +# Generate a ctags file... +# + +ctags: + ctags -R . + + +# +# Install everything... +# + +install: install-data install-headers install-libs install-exec + + +# +# Install data files... +# + +install-data: for dir in $(DIRS); do\ - echo Installing in $$dir... ;\ - (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\ + echo Installing data files in $$dir... ;\ + (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ done - echo Installing in conf... - (cd conf; $(MAKE) $(MFLAGS) install) - echo Installing in data... - (cd data; $(MAKE) $(MFLAGS) install) - echo Installing in doc... - (cd doc; $(MAKE) $(MFLAGS) install) - echo Installing in fonts... - (cd fonts; $(MAKE) $(MFLAGS) install) - echo Installing in ppd... - (cd ppd; $(MAKE) $(MFLAGS) install) - echo Installing in templates... - (cd templates; $(MAKE) $(MFLAGS) install) echo Installing cups-config script... - $(INSTALL_DIR) $(BINDIR) + $(INSTALL_DIR) -m 755 $(BINDIR) $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config - echo Installing startup script... - if test "x$(INITDIR)" != "x"; then \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/init.d; \ + if test "x$(INITDIR)" != x; then \ + echo Installing init scripts...; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \ $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ - $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ - $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ - $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ - $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ + 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 \ + if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \ - if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ - $(INSTALL_SCRIPT) init/cups.osx $(BUILDROOT)$(INITDDIR)/PrintingServices; \ - $(INSTALL_DATA) init/cups.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ - $(INSTALL_DATA) init/cups.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ - elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ - $(INSTALL_DATA) init/cupsd-launchd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ - $(INSTALL_SCRIPT) init/cupsd-launchd.sh $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \ - $(INSTALL_DATA) init/cups.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \ - $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \ - $(INSTALL_DATA) init/cups.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \ + if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ + echo Installing LaunchDaemons configuration files...; \ + $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ + $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \ + case `uname -r` in \ + 8.*) \ + $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ + $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \ + $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \ + $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \ + $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \ + ;; \ + esac \ else \ + echo Installing RC script...; \ $(INSTALL_SCRIPT) init/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) init/cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \ + fi + if test "x$(DBUSDIR)" != x; then \ + echo Installing cups.conf in $(DBUSDIR)...;\ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \ + $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \ + fi + if test "x$(XINETD)" != x; then \ + echo Installing xinetd configuration file for cups-lpd...; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \ + $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \ + fi + if test "x$(MENUDIR)" != x; then \ + echo Installing desktop menu...; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \ + $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \ + fi + if test "x$(ICONDIR)" != x; then \ + echo Installing desktop icons...; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \ + $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \ + $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \ + $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \ + $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \ + fi + +# +# Install header files... +# + +install-headers: + for dir in $(DIRS); do\ + echo Installing header files in $$dir... ;\ + (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ + done # -# Install source and header files... +# Install programs... # -installsrc: - gnutar --dereference --exclude=CVS -cf - . | gnutar -C $(SRCROOT) -xf - +install-exec: all + for dir in $(DIRS); do\ + echo Installing programs in $$dir... ;\ + (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ + done + + +# +# Install libraries... +# -installhdrs: - (cd cups ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;\ - (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1; +install-libs: libs + for dir in $(DIRS); do\ + echo Installing libraries in $$dir... ;\ + (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ + done + + +# +# Uninstall object and target files... +# + +uninstall: + for dir in $(DIRS); do\ + echo Uninstalling in $$dir... ;\ + (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ + done + echo Uninstalling cups-config script... + $(RM) $(BINDIR)/cups-config + -$(RMDIR) $(BINDIR) + 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$(DBUSDIR)" != x; then \ + echo Uninstalling cups.conf in $(DBUSDIR)...;\ + $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ + $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ + fi + $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd + $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop + $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png + $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png + $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png + $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png # # Run the test suite... # -check test: all +test: all echo Running CUPS test suite... cd test; ./run-stp-tests.sh +check: all + echo Running CUPS test suite with defaults... + cd test; ./run-stp-tests.sh 1 0 n + + # -# Make software distributions using EPM (http://www.easysw.com/epm)... +# Make software distributions using EPM (http://www.easysw.com/epm/)... # -EPMFLAGS = -v - -aix: - epm $(EPMFLAGS) -f aix cups packaging/cups.list +EPMFLAGS = -v --output-dir dist $(EPMARCH) -bsd: - epm $(EPMFLAGS) -f bsd cups packaging/cups.list +aix bsd deb depot inst pkg setld slackware swinstall tardist: + epm $(EPMFLAGS) -f $@ cups packaging/cups.list epm: - epm $(EPMFLAGS) cups packaging/cups.list + epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list -rpm: - epm $(EPMFLAGS) -f rpm cups packaging/cups.list +osx: + epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list -deb: - epm $(EPMFLAGS) -f deb cups packaging/cups.list - -depot: - epm $(EPMFLAGS) -f depot cups packaging/cups.list +rpm: + epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list -pkg: - epm $(EPMFLAGS) -f pkg cups packaging/cups.list +.PHONEY: dist +dist: all + $(RM) -r dist + $(MAKE) $(MFLAGS) epm + case `uname` in \ + *BSD*) $(MAKE) $(MFLAGS) bsd;; \ + Darwin*) $(MAKE) $(MFLAGS) osx;; \ + IRIX*) $(MAKE) $(MFLAGS) tardist;; \ + Linux*) $(MAKE) $(MFLAGS) rpm;; \ + SunOS*) $(MAKE) $(MFLAGS) pkg;; \ + esac -tardist: - epm $(EPMFLAGS) -f tardist cups packaging/cups.list # -# End of "$Id: Makefile 5023 2006-01-29 14:39:44Z mike $". +# End of "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $". #