]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/Makefile
Merge changes from CUPS trunk, r7566.
[thirdparty/cups.git] / filter / Makefile
index 9defb35b73a5b75e72f1effd0e593e2b24bfd663..61d578ce7f552f9a12dac878f228e297af906639 100644 (file)
@@ -1,53 +1,74 @@
 #
-# "$Id: Makefile 4804 2005-10-20 14:05:42Z mike $"
+# "$Id: Makefile 6696 2007-07-19 23:27:49Z mike $"
 #
 #   Filter makefile for the Common UNIX Printing System (CUPS).
 #
-#   Copyright 1997-2005 by Easy Software Products.
+#   Copyright 2007-2008 by Apple Inc.
+#   Copyright 1997-2006 by Easy Software Products.
 #
 #   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 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/".
 #
 #   This file is subject to the Apple OS-Developed Software exception.
 #
 
 include ../Makedefs
 
-FILTERS        =       gziptoany hpgltops texttops pstops imagetops imagetoraster \
-               rastertolabel rastertoepson rastertohp
-TARGETS        =       $(FILTERS) testraster
+
+FILTERS        =       \
+               commandtops \
+               gziptoany \
+               hpgltops \
+               texttops \
+               pstops \
+               $(IMGFILTERS) \
+               $(PDFTOPS) \
+               rastertolabel \
+               rastertoepson \
+               rastertohp
+LIBTARGETS =   \
+               $(LIBCUPSIMAGE) \
+               libcupsimage.a \
+               $(LIB32CUPSIMAGE) \
+               $(LIB64CUPSIMAGE) \
+               testraster
+TARGETS        =       \
+               $(LIBTARGETS) \
+               $(FILTERS) \
+               rasterbench \
+               testimage
 
 HPGLOBJS =     hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
                hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
 IMAGEOBJS =    image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
                image-photocd.o image-pix.o image-png.o image-pnm.o \
                image-sgi.o image-sgilib.o image-sun.o image-tiff.o \
-               image-zoom.o image.o interpret.o raster.o
+               image-zoom.o image.o error.o interpret.o raster.o
+IMAGE32OBJS =  $(IMAGEOBJS:.o=.32.o)
+IMAGE64OBJS =  $(IMAGEOBJS:.o=.64.o)
 FORMOBJS =     form-attr.o form-main.o form-ps.o form-text.o form-tree.o
 OBJS   =       $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
-               imagetops.o imagetoraster.o common.o pstops.o raster.o \
-               rastertolabel.o rastertoepson.o rastertohp.o \
-               texttops.o textcommon.o testraster.o gziptoany.o
+               commandtops.o gziptoany.o imagetops.o imagetoraster.o common.o \
+               pdftops.o pstops.o \
+               rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
+               testimage.o testraster.o textcommon.o texttops.o
 
 
 #
 # Make all targets...
 #
 
-all:   $(TARGETS) $(LIBCUPSIMAGE) libcupsimage.a
+all:   $(TARGETS)
+
+
+#
+# Make library targets...
+#
+
+libs:          $(LIBTARGETS)
 
 
 #
@@ -55,8 +76,9 @@ all:  $(TARGETS) $(LIBCUPSIMAGE) libcupsimage.a
 #
 
 clean:
-       $(RM) $(OBJS) $(TARGETS) $(LIBCUPSIMAGE) libcupsimage.a
-       $(RM) `basename $(LIBCUPSIMAGE) .2` libcupsimage.dylib
+       $(RM) $(OBJS) $(TARGETS)
+       $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
+       $(RM) -r 32bit 64bit
 
 
 #
@@ -64,40 +86,151 @@ clean:
 #
 
 depend:
-       makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1
+       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
 
 
 #
 # Install all targets...
 #
 
-install:       all installhdrs
-       $(INSTALL_DIR) $(SERVERBIN)/filter
+install:       all install-data install-headers install-libs install-exec
+
+
+#
+# Install data files...
+#
+
+install-data:
+
+
+#
+# Install programs...
+#
+
+install-exec:
+       $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
        for file in $(FILTERS); do \
                $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
        done
        $(RM) $(SERVERBIN)/filter/rastertodymo
        $(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
-       $(INSTALL_DIR) $(LIBDIR)
+       if test "x$(SYMROOT)" != "x"; then \
+               $(INSTALL_DIR) $(SYMROOT); \
+               for file in $(TARGETS); do \
+                       cp $$file $(SYMROOT); \
+               done \
+       fi
+
+
+#
+# Install headers...
+#
+
+install-headers:
+       $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
+       $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
+
+
+#
+# Install libraries...
+#
+
+install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
+       $(INSTALL_DIR) -m 755 $(LIBDIR)
        $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
        -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
                $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
                $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
        fi
        -if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
-               $(STRIP) -x $(LIBDIR)/$(LIBCUPSIMAGE); \
                $(RM) $(LIBDIR)/libcupsimage.dylib; \
                $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
        fi
-       -if test $(LIBCUPSIMAGE) != "libcupsimage.a"; then \
-               $(INSTALL_LIB) libcupsimage.a $(LIBDIR); \
-               $(RANLIB) $(LIBDIR)/libcupsimage.a; \
-       fi
 
-installhdrs:
-       $(INSTALL_DIR) $(INCLUDEDIR)/cups
-       $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
-       $(INSTALL_DATA) raster.h $(INCLUDEDIR)/cups
+installstatic:
+       $(INSTALL_DIR) -m 755 $(LIBDIR)
+       $(INSTALL_LIB) libcupsimage.a $(LIBDIR);
+       $(RANLIB) $(LIBDIR)/libcupsimage.a;
+
+install32bit:
+       $(INSTALL_DIR) -m 755 $(LIB32DIR)
+       $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
+       $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
+
+install64bit:
+       $(INSTALL_DIR) -m 755 $(LIB64DIR)
+       $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
+       $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
+
+
+#
+# Uninstall all targets...
+#
+
+uninstall: $(UNINSTALL32) $(UNINSTALL64)
+       for file in $(FILTERS); do \
+               $(RM) $(SERVERBIN)/filter/$$file; \
+       done
+       $(RM) $(SERVERBIN)/filter/rastertodymo
+       -$(RMDIR) $(SERVERBIN)/filter
+       -$(RMDIR) $(SERVERBIN)
+       $(RM) $(LIBDIR)/libcupsimage.2.dylib
+       $(RM) $(LIBDIR)/libcupsimage.a
+       $(RM) $(LIBDIR)/libcupsimage.dylib
+       $(RM) $(LIBDIR)/libcupsimage_s.a
+       $(RM) $(LIBDIR)/libcupsimage.sl
+       $(RM) $(LIBDIR)/libcupsimage.sl.2
+       $(RM) $(LIBDIR)/libcupsimage.so
+       $(RM) $(LIBDIR)/libcupsimage.so.2
+       -$(RMDIR) $(LIBDIR)
+       $(RM) $(INCLUDEDIR)/cups/image.h
+       -$(RMDIR) $(INCLUDEDIR)/cups
+
+uninstall32bit:
+       $(RM) $(LIB32DIR)/libcupsimage.so
+       $(RM) $(LIB32DIR)/libcupsimage.so.2
+       -$(RMDIR) $(LIB32DIR)
+
+uninstall64bit:
+       $(RM) $(LIB64DIR)/libcupsimage.so
+       $(RM) $(LIB64DIR)/libcupsimage.so.2
+       -$(RMDIR) $(LIB64DIR)
+
+
+#
+# Automatic API help files...
+#
+
+apihelp:
+       echo Generating CUPS API help files...
+       mxmldoc --section "Programming" --title "Raster API" \
+               --css ../doc/cups-printable.css \
+               --header api-raster.header --intro api-raster.shtml \
+               ../cups/raster.h interpret.c raster.c \
+               >../doc/help/api-raster.html
+
+framedhelp:
+       echo Generating CUPS API help files...
+       mxmldoc --section "Programming" --title "Raster API" \
+               --framed ../cups/api-raster \
+               --css ../doc/cups-printable.css \
+               --header api-raster.header --intro api-raster.shtml \
+               ../cups/raster.h interpret.c raster.c
+
+
+#
+# commandtops
+#
+
+commandtops:   commandtops.o ../cups/$(LIBCUPS)
+       echo Linking $@...
+       $(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
 
 
 #
@@ -133,21 +266,45 @@ hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
 
 libcupsimage.so.2 libcupsimage.sl.2:   $(IMAGEOBJS)
        echo Linking $@...
-       $(DSO) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) -lm
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
+               -L../cups $(LINKCUPS) -lm
        $(RM) `basename $@ .2`
        $(LN) $@ `basename $@ .2`
 
 
+#
+# 32bit/libcupsimage.so.2
+#
+
+32bit/libcupsimage.so.2:       $(IMAGE32OBJS)
+       echo Linking 32-bit $@...
+       -mkdir 32bit
+       $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
+               -L../cups/32bit $(LINKCUPS) -lm
+
+
+#
+# 64bit/libcupsimage.so.2
+#
+
+64bit/libcupsimage.so.2:       $(IMAGE64OBJS)
+       echo Linking 64-bit $@...
+       -mkdir 64bit
+       $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
+               -L../cups/64bit $(LINKCUPS) -lm
+
+
 #
 # libcupsimage.2.dylib
 #
 
-libcupsimage.2.dylib:  $(IMAGEOBJS)
+libcupsimage.2.dylib:  $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
        echo Linking $@...
-       $(DSO) $(DSOFLAGS) -o $@ \
-               -install_name $(libdir)/libcupsimage.dylib \
-               -current_version 2.2.0 \
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
+               -install_name $(libdir)/$@ \
+               -current_version 2.3.0 \
                -compatibility_version 2.0.0 \
+               -sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
                $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
        $(RM) libcupsimage.dylib
        $(LN) $@ libcupsimage.dylib
@@ -157,10 +314,10 @@ libcupsimage.2.dylib:     $(IMAGEOBJS)
 # libcupsimage_s.a
 #
 
-libcupsimage_s.a:      $(IMAGEOBJS)
+libcupsimage_s.a:      $(IMAGEOBJS) libcupsimage_s.exp
        echo Linking $@...
-       $(DSO) $(DSOFLAGS) -Wl,-berok -o libcupsimage_s.o $(IMAGEOBJS) \
-               $(DSOLIBS) -lm
+       $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
+               -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
        $(RM) $@
        $(AR) $(ARFLAGS) $@ libcupsimage_s.o
 
@@ -171,8 +328,9 @@ libcupsimage_s.a:   $(IMAGEOBJS)
 
 libcupsimage.la:       $(IMAGEOBJS)
        echo Linking $@...
-       $(DSO) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
-               -rpath $(LIBDIR) -version-info 2:2
+       $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
+               -L../cups $(LINKCUPS) \
+               -rpath $(LIBDIR) -version-info 2:3
 
 
 #
@@ -224,7 +382,16 @@ imagetoraster:     imagetoraster.o common.o $(LIBCUPSIMAGE) \
 
 pstops:        pstops.o common.o ../cups/$(LIBCUPS)
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
+       $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
+
+
+#
+# pdftops
+#
+
+pdftops:       pdftops.o common.o ../cups/$(LIBCUPS)
+       echo Linking $@...
+       $(CC) $(LDFLAGS) -o $@ pdftops.o common.o $(LIBS)
 
 
 #
@@ -258,9 +425,22 @@ rastertohp:        rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
 # testraster
 #
 
-testraster:    testraster.o raster.o
+testraster:    testraster.o ../cups/libcups.a libcupsimage.a
+       echo Linking $@...
+       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
+               ../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
+               $(SSLLIBS) $(LIBGSSAPI)
+       echo Running raster API tests...
+       ./testraster
+
+
+#
+# rasterbench
+#
+
+rasterbench:   rasterbench.o libcupsimage.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testraster.o raster.o
+       $(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
 
 
 #
@@ -281,5 +461,5 @@ include Dependencies
 
 
 #
-# End of "$Id: Makefile 4804 2005-10-20 14:05:42Z mike $".
+# End of "$Id: Makefile 6696 2007-07-19 23:27:49Z mike $".
 #