# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.89 94/08/12 00:45:51 gildea Exp $

# -----------------------------------------------------------------------
# Makefile generated from "Imake.tmpl" and </tmp/IIf..BayJF>
# $XConsortium: Imake.tmpl,v 1.219 94/05/13 15:58:31 matt Exp $
# $SunSoft: @(#)Imake.tmpl	1.1 01/13/97 16:16:22 $
#

# **************************************************************************
# NOTE:
#
# If the user does not define DESTDIR and/or BINDIR in the local Imakefile,
# 'make install' will install the resultant binaries in /usr/openwin/bin.
# This usually fails because of lack of write permission in that directory
# for non-root users.
#
# The reason is that the default definition of ProjectRoot is /usr/openwin.
# This value determines all other definitions, e.g. the binary, library and
# manual page directories, etc.  The destination directory, DESTDIR, is not
# defined and BINDIR is defined as $(ProjectRoot)/bin in Project.tmpl.
#
# Care must be taken when changing ProjectRoot.  It affects the inclusion
# path of 'imake' in finding the *.cf, *.def, *.tmpl and *.rules files,
# which are in /usr/openwin/lib/X11/config/, and the default inclusion path
# of X11 header files and libraries. Therefore, if ProjectRoot is changed
# not only these configuration files need to be copied to a proper location,
# defined by IRULESRC, so 'make Makefile' can work properly, the header file
# inclusion path, /usr/openwin/include, and the library search path,
# /usr/openwin/lib, also need to be defined properly either in the local
# Imakefile or one of the configuration files to avoid compilation errors
# for programs that use X11 header files or libraries.
#
# Please refer to Project.tmpl, Imake.tmpl, site.def, etc. in
# /usr/openwin/lib/X11/config/ for details.
# **************************************************************************

.SUFFIXES: .i

# $XConsortium: Imake.cf,v 1.12 94/03/29 15:42:08 gildea Exp $
# $SunSoft: @(#)Imake.cf	1.1 01/13/97 16:16:21 $

# -----------------------------------------------------------------------
# site-specific configuration parameters that need to come before
# the platform-specific parameters - edit site.def to change

# site:  $XConsortium: site.sample,v 1.11 94/06/03 19:50:12 matt Exp $
# site:  $SunSoft: @(#)site.def	1.1 01/13/97 16:16:27$

# -----------------------------------------------------------------------
# platform-specific configuration parameters - edit sun.cf to change

# platform:  $XConsortium: sun.cf,v 1.133 94/07/08 12:23:12 gildea Exp $
# platform:  $SunSoft: @(#)sun.cf	1.11 05/04/01 13:49:33 $

# operating system:  SunOS 5.9

# SUNSOFT SUNSOFT_LOADABLE

# $XConsortium: svr4.cf,v 1.6 94/04/08 18:56:33 rws Exp $
# $SunSoft: @(#)svr4.cf	1.1 01/13/97 16:16:29 $

# $XConsortium: sv4Lib.rules,v 1.14 94/04/09 12:00:10 rws Exp $
# $SunSoft: @(#)sv4Lib.rules	1.1 01/13/97 16:16:28 $

# SUNSOFT SUNSOFT_LOADABLE

	TROFFTOPS = /usr/lib/lp/postscript/dpost | /usr/lib/lp/postscript/postreverse -r

# -----------------------------------------------------------------------
# site-specific configuration parameters that go after
# the platform-specific parameters - edit site.def to change

# site:  $XConsortium: site.sample,v 1.11 94/06/03 19:50:12 matt Exp $
# site:  $SunSoft: @(#)site.def	1.1 01/13/97 16:16:27$

# -----------------------------------------------------------------------
# Imake rules for building libraries, programs, scripts, and data files
# rules:  $XConsortium: Imake.rules,v 1.193 94/04/10 17:39:55 rws Exp $
# rules:  $SunSoft: @(#)Imake.rules	1.1 01/13/97 16:16:21 $

# SUNSOFT SUNSOFT_LOADABLE

          PATHSEP = /
            SHELL = /bin/sh

              TOP = .
      CURRENT_DIR = .

            IMAKE = imake
           DEPEND = makedepend
        MKDIRHIER = mkdirhier
        CONFIGSRC = $(TOP)/config
         IMAKESRC = $(CONFIGSRC)/imake
        DEPENDSRC = $(CONFIGSRC)/makedepend
           IXXSRC = $(UNSUPPORTEDSRC)/programs/ixx
              IXX = ixx
         IXXFLAGS = -s BaseObject -m TypeObj -r RequestObj -p Xf
      IXXINCLUDES = -i '<X11/Fresco/enter-scope.h>'

          INCROOT = /usr/openwin/include
        USRLIBDIR = /usr/openwin/lib
         SHLIBDIR = /usr/openwin/lib
       LINTLIBDIR = $(USRLIBDIR)
          MANPATH = /usr/openwin/share/man
    MANSOURCEPATH = $(MANPATH)/man
           MANDIR = $(MANSOURCEPATH)1
        LIBMANDIR = $(MANSOURCEPATH)3
       FILEMANDIR = $(MANSOURCEPATH)$(FILEMANSUFFIX)

               AR = /usr/ccs/bin/ar cq
  BOOTSTRAPCFLAGS = -DSVR4
               CC = cc
               AS = /usr/ccs/bin/as

         COMPRESS = compress
              CPP = /usr/ccs/lib/cpp $(STD_CPP_DEFINES)
    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
          INSTALL = /usr/ucb/install
     INSTALLFLAGS = -c
               LD = /usr/ccs/bin/ld
              LEX = /usr/ccs/bin/lex
           LEXLIB = -ll
             YACC = /usr/ccs/bin/yacc
           CCYACC = /usr/ccs/bin/yacc
             LINT = lint
      LINTLIBFLAG = -y -o
         LINTOPTS = -b -h -Xc
               LN = ln -s
             MAKE = /usr/ccs/bin/make
               MV = mv
               CP = cp

               RM = rm -f
        MANSUFFIX = 1
     LIBMANSUFFIX = 3
    FILEMANSUFFIX = 4
            TROFF = troff -t -Tpost
         MSMACROS = -ms
              TBL = tbl
              EQN = eqn

            DVIPS = dvips
            LATEX = latex

     STD_INCLUDES =
  STD_CPP_DEFINES = -Dsun -Dsparc -DSVR4 -DSYSV
      STD_DEFINES = -Dsun -Dsparc -DSVR4 -DSYSV
 EXTRA_LOAD_FLAGS =
  EXTRA_LDOPTIONS =
  EXTRA_LIBRARIES = -lsocket -lnsl
             TAGS = ctags

    SHAREDCODEDEF =
         SHLIBDEF =

     SHLIBLDFLAGS = -G -z text -M mapfile

         PICFLAGS = -Kpic

      CXXPICFLAGS = -K PIC

    PROTO_DEFINES =

     INSTPGMFLAGS =

     INSTBINFLAGS = -m 0755
     INSTUIDFLAGS = -m 4755
     INSTLIBFLAGS = -m 0644
     INSTINCFLAGS = -m 0644
     INSTMANFLAGS = -m 0444
     INSTDATFLAGS = -m 0444
    INSTKMEMFLAGS = -g sys -m 2755

      PROJECTROOT = /usr/openwin

     TOP_INCLUDES = -I$(INCROOT)

      CDEBUGFLAGS = -O
        CCOPTIONS = -Xc -xF -xarch=v8

      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES)
           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(ALLDEFINES)
        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
         LDPRELIB = -L$(USRLIBDIR)
        LDPOSTLIB =
        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)  $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIB)
     CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIB)

           LDLIBS = $(LDPOSTLIB) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)

       CCENVSETUP = LD_RUN_PATH=$(USRLIBDIR)
           CCLINK = $(CCENVSETUP) $(CC)

      CXXENVSETUP = LD_RUN_PATH=$(USRLIBDIR)
          CXXLINK = $(CXXENVSETUP) $(CXX)

     LDSTRIPFLAGS = -x
   LDCOMBINEFLAGS = -r
      DEPENDFLAGS =

        MACROFILE = sun.cf
           RM_CMD = $(RM)

    IMAKE_DEFINES =

         IRULESRC = $(CONFIGDIR)
        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)

     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Project.tmpl \
			$(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) \
			 $(EXTRA_ICONFIGFILES)

# -----------------------------------------------------------------------
# X Window System Build Parameters and Rules
# $XConsortium: Project.tmpl,v 1.242 94/04/13 14:58:40 rws Exp $
# $SunSoft: @(#)Project.tmpl	1.6 05/30/02 19:12:02 $

# SUNSOFT SUNSOFT_LOADABLE

# -----------------------------------------------------------------------
# X Window System make variables; these need to be coordinated with rules

           BINDIR = /usr/openwin/bin
     BUILDINCROOT = $(TOP)
      BUILDINCDIR = $(BUILDINCROOT)/X11
      BUILDINCTOP = ..
      BUILDLIBDIR = $(TOP)/usrlib
      BUILDLIBTOP = ..
           INCDIR = $(INCROOT)/X11
           ADMDIR = /usr/adm
           LIBDIR = $(USRLIBDIR)/X11

          FONTDIR = $(LIBDIR)/fonts
         XINITDIR = $(LIBDIR)/xinit
           XDMDIR = $(LIBDIR)/xdm
           TWMDIR = $(LIBDIR)/twm
           NLSDIR = $(LIBDIR)/nls
       XLOCALEDIR = $(PROJECTROOT)/lib/locale
        PEXAPIDIR = $(LIBDIR)/PEX
      XAPPLOADDIR = $(LIBDIR)/app-defaults
       FONTCFLAGS = -t

     INSTAPPFLAGS = $(INSTDATFLAGS)

              RGB = rgb
            FONTC = bdftopcf
        MKFONTDIR = mkfontdir

       DOCUTILSRC = $(TOP)/doc/util
       XDOCMACROS = $(DOCUTILSRC)/macros.t
       XIDXMACROS = $(DOCUTILSRC)/indexmacros.t
       PROGRAMSRC = $(TOP)/programs
           LIBSRC = $(TOP)/lib
          FONTSRC = $(TOP)/fonts
       INCLUDESRC = $(TOP)/X11
        SERVERSRC = $(TOP)/programs/Xserver
       CONTRIBSRC = $(TOP)/../contrib
   UNSUPPORTEDSRC = $(TOP)/unsupported
           DOCSRC = $(TOP)/doc
           RGBSRC = $(TOP)/programs/rgb
      BDFTOPCFSRC = $(PROGRAMSRC)/bdftopcf
     MKFONTDIRSRC = $(PROGRAMSRC)/mkfontdir
    FONTSERVERSRC = $(PROGRAMSRC)/xfs
       FONTINCSRC = $(TOP)/include/fonts
        EXTINCSRC = $(TOP)/include/extensions
     TRANSCOMMSRC = $(LIBSRC)/xtrans
   TRANS_INCLUDES = -I$(TRANSCOMMSRC)

# $XConsortium: sunLib.tmpl,v 1.37 95/05/23 14:31:40 matt Exp $
# SunSoft: @(#)sunLib.tmpl	1.4 05/30/02 17:00:20

# $XConsortium: sv4Lib.tmpl,v 1.19 93/12/03 10:48:36 kaleb Exp $
# $SunSoft: @(#)sv4Lib.tmpl	1.1 01/13/97 16:16:29 $

XMULIBONLY = -lXmu -lm
XMULIB = -lXmu -lm

       SERVERLIB = /usr/openwin/server/lib

	SERVERMODULES = /usr/openwin/server/modules

	SERVERETC = /usr/openwin/server/etc

SHLIBLDFLAGS = -G -z text -M mapfile
PICFLAGS = -Kpic
MAPFILE = mapfile

          XLIBSRC = $(LIBSRC)/X11

SOXLIBREV = 4
DEPXONLYLIB =
XONLYLIB =  -lX11

LINTXONLY = $(LINTLIBDIR)/llib-lX11.ln

         XLIBONLY = $(XONLYLIB)

      XEXTLIBSRC = $(LIBSRC)/Xext

SOXEXTREV = 0
DEPEXTENSIONLIB =
EXTENSIONLIB =  -lXext

LINTEXTENSION = $(LINTLIBDIR)/llib-lXext.ln

LINTEXTENSIONLIB = $(LINTEXTENSION)
          DEPXLIB = $(DEPEXTENSIONLIB) $(DEPXONLYLIB)
             XLIB = $(EXTENSIONLIB) $(XONLYLIB)
         LINTXLIB = $(LINTXONLYLIB)

         XAUTHSRC = $(LIBSRC)/Xau

DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
XAUTHLIB =  -lXau

LINTXAUTH = $(LINTLIBDIR)/llib-lXau.ln

      XDMCPLIBSRC = $(LIBSRC)/Xdmcp

DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
XDMCPLIB =  -lXdmcp

LINTXDMCP = $(LINTLIBDIR)/llib-lXdmcp.ln

           XMUSRC = $(LIBSRC)/Xmu

SOXMUREV = 4
DEPXMULIB =
XMULIB =  -lXmu

LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln

XMULIB =  -lXmu -lm

          XCONFIGSRC = $(LIBSRC)/Xconfig

SOXCONFIGREV = 0
DEPXCONFIGLIB =
XCONFIGLIB =  -lXconfig

LINTXCONFIG = $(LINTLIBDIR)/llib-lXconfig.ln

          DGASRC = $(LIBSRC)/dga

SODGAREV = 1
DEPDGASRCLIB =
DGASRCLIB =  -ldga

LINTDGASRC = $(LINTLIBDIR)/llib-ldga.ln

          MISRC = $(SERVERSRC)/mi

SOMIREV = 1
DEPMILIB =
MILIB =  -lmi

LINTMI = $(LINTLIBDIR)/llib-lmi.ln

          MFBSRC = $(SERVERSRC)/mfb

SOMFBREV = 1
DEPMFBLIB =
MFBLIB =  -lmfb

LINTMFB = $(LINTLIBDIR)/llib-lmfb.ln

          CFBSRC = $(SERVERSRC)/cfb

SOCFBREV = 1
DEPCFBLIB =
CFBLIB =  -lcfb

LINTCFB = $(LINTLIBDIR)/llib-lcfb.ln

       OLDXLIBSRC = $(LIBSRC)/oldX

SOOLDXREV = 6
DEPOLDXLIB =
OLDXLIB =  -loldX

LINTOLDX = $(LINTLIBDIR)/llib-loldX.ln

       TOOLKITSRC = $(LIBSRC)/Xt

SOXTREV = 4
DEPXTOOLONLYLIB =
XTOOLONLYLIB =  -lXt

LINTXTOOLONLY = $(LINTLIBDIR)/llib-lXt.ln

      DEPXTOOLLIB = $(DEPXTOOLONLYLIB) $(DEPSMLIB) $(DEPICELIB)
         XTOOLLIB = $(XTOOLONLYLIB) $(SMLIB) $(ICELIB)
     LINTXTOOLLIB = $(LINTXTOOLONLYLIB)

       AWIDGETSRC = $(LIBSRC)/Xaw

SOXAWREV = 5
DEPXAWLIB =
XAWLIB =  -lXaw

LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln

       XTFSRC = $(TOP)/workInProgress/Xtf

SOXTFREV = 0.7
DEPXTFLIB =
XTFLIB =  -lXtf

LINTXTF = $(LINTLIBDIR)/llib-lXtf.ln

       FRESCOSRC = $(TOP)/workInProgress/Fresco

SOFRESCOREV = 0.7
DEPFRESCOLIB =
FRESCOLIB =  -lFresco

LINTFRESCO = $(LINTLIBDIR)/llib-lFresco.ln

         XILIBSRC = $(LIBSRC)/Xi

SOXINPUTREV = 5
DEPXILIB =
XILIB =  -lXi

LINTXI = $(LINTLIBDIR)/llib-lXi.ln

      XTESTLIBSRC = $(LIBSRC)/Xtst

SOXTESTREV = 1
DEPXTESTLIB =
XTESTLIB =  -lXtst

LINTXTEST = $(LINTLIBDIR)/llib-lXtst.ln

        PEXLIBSRC = $(LIBSRC)/PEX5

SOPEXREV = 6
DEPPEXLIB =
PEXLIB =  -lPEX5

LINTPEX = $(LINTLIBDIR)/llib-lPEX5.ln

SODPSREV = 5
SOSERVERDPSREV = 5

        DPSLIBSRC = $(LIBSRC)/DPS

SODPSREV = 5
DEPDPSLIB =
DPSLIB =  -lDPS

LINTDPS = $(LINTLIBDIR)/llib-lDPS.ln

        XIELIBSRC = $(LIBSRC)/XIE

SOXIEREV = 6
DEPXIELIB =
XIELIB =  -lXIE

LINTXIE = $(LINTLIBDIR)/llib-lXIE.ln

      PHIGSLIBSRC = $(LIBSRC)/PHIGS

DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
PHIGSLIB =  -lphigs

LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln

DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
XBSDLIB =  -lXbsd

LINTXBSD = $(LINTLIBDIR)/llib-lXbsd.ln

           ICESRC = $(LIBSRC)/ICE

SOICEREV = 6
DEPICELIB =
ICELIB =  -lICE

LINTICE = $(LINTLIBDIR)/llib-lICE.ln

            SMSRC = $(LIBSRC)/SM

SOSMREV = 6
DEPSMLIB =
SMLIB =  -lSM

LINTSM = $(LINTLIBDIR)/llib-lSM.ln

         FSLIBSRC = $(LIBSRC)/FS

SOFSREV = 5
DEPFSLIB =
FSLIB =  -lFS

LINTFS = $(LINTLIBDIR)/llib-lFS.ln

         FONTLIBSRC = $(LIBSRC)/font

DEPFONTLIB = $(USRLIBDIR)/libfont.a
FONTLIB =  -lfont

LINTFONT = $(LINTLIBDIR)/llib-lfont.ln

    XRENDERLIBSRC = $(LIBSRC)/Xrender

SOXRENDERREV = 1
DEPXRENDERLIB =
XRENDERLIB =  -lXrender

LINTXRENDER = $(LINTLIBDIR)/llib-lXrender.ln

XRENDERLIB = -L/usr/openwin/sfw/lib -R/usr/openwin/lib:/usr/openwin/sfw/lib -lXrender

          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)

         DEPLIBS1 = $(DEPLIBS)
         DEPLIBS2 = $(DEPLIBS)
         DEPLIBS3 = $(DEPLIBS)

        CONFIGDIR = $(LIBDIR)/config

# -----------------------------------------------------------------------
# start of Imakefile

#
# Imakefile for xpaint 2.7.0
#
# $Id: Imakefile,v 1.2 2002/11/13 21:38:03 demailly Exp $

VERSION = 2.7.0

# Configuration portion of Imakefile for XPaint 2.7.0
#
# $Id: Local.config,v 1.28 2002/09/25 19:26:45 demailly Exp $

# Local customization

DESTDIR =
SHAREDIR = /afs/athena.mit.edu/contrib/graphics/share/xpaint

PRINT_COMMAND = lpr -Plp
EDITOR = emacs -fn 9x15 -cr green -ms red -bg lightyellow -fg black
POSTSCRIPT_VIEWER = gv
EXTERN_VIEWER = xv

# Size of tool icons; if "big", set option -DBIGTOOLICONS below
# otherwise comment TOOLFLAGS out
# Note: big icons are less color intensive for pseudocolor displays
#
# TOOLFLAGS = -DBIGTOOLICONS

# For FreeBSD, NetBSD and BSD386, no changes should be necessary, unless
# your libraries are in nonstandard places.

# For SunOS 4.1, include
#
#	   -DDECLARE_DRAND48
#
# Defines that may or may not be useful
#
#      -DMISSING_STRERROR if you system doesn't have strerror()
#      -DMISSING_STDARG_H if you system doesn't have <stdarg.h>
#      -DNOSTDHDRS        if you don't have <unistd.h> or <stdlib.h>
#
#	   -DERRORBEEP        beep on errors
#
# Defines for experimental features
#
#      -DFEATURE_FRACTAL  for fractal fill operator
#
# Defines for reinstating old behaviour
#
#      -DFILTERNEEDSSELECTION	to get old behaviour of filter commands
#

EXTRA_DEFINES = -DERRORBEEP -DFEATURE_FRACTAL $(TOOLFLAGS)

#
# According to Craig Ian Dewick <craig@lios.apana.org.au>, this should not
# be necessary with Solaris 8 (SunOS 5.8).
#
# #ifdef
# ARCH_DEFINES = -DMISSING_STRERROR
# #endif

# Need an ANSI C compiler
#
#  Which is either 'gcc' or 'acc' on a SparcStation
#   most MIPS based machines will do just fine using 'cc'
#
# CC = gcc
# CC = acc

#  If you have the TIFF library, make HaveTIFF defined
#    and make sure the path names to the library and
#    includes are correct.
#

TIFF_LIB     = -ltiff
TIFF_INCLUDE =

#  If you have the JPEG library, make HaveJPEG defined
#    and make sure the path names to the library and
#    includes are correct.

JPEG_LIB     = -ljpeg
JPEG_INCLUDE =

#  If you have the PNG library, make HavePNG defined
#    and make sure the path names to the library and
#    includes are correct.

PNG_LIB     = -lpng -lz
PNG_INCLUDE =

#  If you are running SunOS and get an error with the following undefined
#    symbols from the link line:
#       _get_wmShellWidgetClass
#       _get_applicationShellWidgetClass
#
#  try uncommenting these lines:
#
# #undef $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
# #define $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XLIB) -lXaw -Bstatic -lXmu -Bdynamic -lXt -lXext -lX11
#

#  You must have the XPM library.
#  Make sure the path name to the library is correct.

XPM_LIB     = -L/usr/X11R6/lib -L/afs/athena.mit.edu/contrib/graphics/arch/sun4m_53/lib -lXpm

#  Make sure this points to the location of the 'xpm.h' file.

XPM_INCLUDE = -I/mit/graphics/include

DEPENDFLAGS = -I./bitmaps

# Uncomment these lines and tailor to taste, if you don't like
# the default paths and man page extension.
#
# BINDIR = /usr/local/bin
# MANDIR = /usr/local/man
# #undef 1
# #define 1 1

# Add '-g' here if you want to include debugging information.
# Also add any optimizer flags etc. that you want.
#
#	CDEBUGFLAGS = -g
#
# I have been told that compilation on AIX 3.2.5/IBM RS/6000 requires
# that you use the 'qlanglvl=ansi' flag.

# CDEBUGFLAGS =

# This should take care of everything needed for BSD.

XAWLIB_DEFINES = -DXAW95
SYS_LIBRARIES = ./libXaw95.a -lm -lX11 -lXt -lXmu

DEFINES = $(ARCH_DEFINES) $(EXTRA_DEFINES) $(XAWLIB_DEFINES) $(XPM_INCLUDE) \
          "-DEDITOR=\"$(EDITOR)\"" \
          "-DSHAREDIR=\"$(SHAREDIR)\"" \
          "-DXAPPLOADDIR=\"$(XAPPLOADDIR)\"" \
	  "-DXPAINT_VERSION=\"$(VERSION)\""

# ########################
# Nothing to change below here

XPSRC = chroma.c color.c colorEdit.c dialog.c fatBitsEdit.c \
	fileName.c fontSelect.c grab.c graphic.c hash.c help.c \
	image.c imageComp.c iprocess.c main.c menu.c misc.c \
	operation.c palette.c pattern.c print.c protocol.c readRC.c size.c \
	snapshot.c text.c texture.c typeConvert.c

XPOBJ = chroma.o color.o colorEdit.o dialog.o fatBitsEdit.o \
	fileName.o fontSelect.o grab.o graphic.o hash.o help.o \
	image.o imageComp.o iprocess.o main.o menu.o misc.o \
	operation.o palette.o pattern.o print.o protocol.o readRC.o size.o \
	snapshot.o text.o texture.o typeConvert.o

OPSRC = arcOp.c blobOp.c boxOp.c brushOp.c circleOp.c fillOp.c \
	fontOp.c lineOp.c pencilOp.c polyOp.c splineOp.c selectOp.c \
	sprayOp.c dynPenOp.c

OPOBJ = arcOp.o blobOp.o boxOp.o brushOp.o circleOp.o fillOp.o \
	fontOp.o lineOp.o pencilOp.o polyOp.o splineOp.o selectOp.o \
	sprayOp.o dynPenOp.o

XPWIDSRC = Colormap.c Paint.c PaintEvent.c PaintRegion.c PaintUndo.c
XPWIDOBJ = Colormap.o Paint.o PaintEvent.o PaintRegion.o PaintUndo.o

RWSRC =	rw/libpnmrw.c rw/readGIF.c rw/readJPEG.c rw/readTIFF.c \
	rw/readWritePNM.c rw/readWriteSGI.c rw/readWriteXBM.c \
	rw/readWriteXPM.c rw/readWriteXWD.c rw/rwTable.c \
	rw/writeGIF.c rw/writeJPEG.c rw/writePS.c rw/writeTIFF.c \
	rw/libpnmrw.h rw/rwTable.h
RWOBJ =	rw/libpnmrw.o rw/readGIF.o rw/readJPEG.o rw/readTIFF.o \
	rw/readWritePNM.o rw/readWriteSGI.o rw/readWriteXBM.o \
	rw/readWriteXPM.o rw/readWriteXWD.o rw/rwTable.o \
	rw/writeGIF.o rw/writePS.o rw/writeTIFF.o

SRCS = $(XPSRC) $(OPSRC) $(XPWIDSRC)
OBJS = $(XPOBJ) $(OPOBJ) $(XPWIDOBJ)

HDRS =	Colormap.h ColormapP.h hash.h Paint.h \
	PaintP.h palette.h xpaint.h menu.h \
	text.h region.h image.h patchlevel.h \
	misc.h rc.h ops.h color.h graphic.h operation.h protocol.h

OPBDIR = bitmaps/tools
OPBITMAPS = $(OPBDIR)/clineOp.xpm $(OPBDIR)/lassoOp.xpm $(OPBDIR)/rayOp.xpm \
	$(OPBDIR)/selpolyOp.xpm $(OPBDIR)/selectOp.xpm $(OPBDIR)/arcOp.xpm \
	$(OPBDIR)/boxOp.xpm $(OPBDIR)/brushOp.xpm \
	$(OPBDIR)/dotPenOp.xpm $(OPBDIR)/eraseOp.xpm $(OPBDIR)/fboxOp.xpm \
	$(OPBDIR)/ffreehandOp.xpm $(OPBDIR)/fillOp.xpm $(OPBDIR)/fovalOp.xpm \
	$(OPBDIR)/fpolyOp.xpm $(OPBDIR)/freehandOp.xpm $(OPBDIR)/lineOp.xpm \
	$(OPBDIR)/ovalOp.xpm $(OPBDIR)/pencilOp.xpm $(OPBDIR)/polyOp.xpm \
	$(OPBDIR)/smearOp.xpm $(OPBDIR)/sprayOp.xpm $(OPBDIR)/textOp.xpm \
	$(OPBDIR)/tfillOp.xpm $(OPBDIR)/dynPenOp.xpm

BRBDIR = bitmaps/brushes
BRUSHBITMAPS = $(BRBDIR)/paintA.xpm \
	$(BRBDIR)/paintB.xpm $(BRBDIR)/paintC.xpm $(BRBDIR)/paintD.xpm \
	$(BRBDIR)/paintE.xpm $(BRBDIR)/paintF.xpm $(BRBDIR)/paintG.xpm \
	$(BRBDIR)/paintH.xpm $(BRBDIR)/paintI.xpm $(BRBDIR)/paintJ.xpm \
	$(BRBDIR)/paintK.xpm $(BRBDIR)/paintL.xpm $(BRBDIR)/paintM.xpm \
	$(BRBDIR)/paintN.xpm $(BRBDIR)/paintO.xpm $(BRBDIR)/paintP.xpm \
	$(BRBDIR)/paintQ.xpm $(BRBDIR)/paintR.xpm $(BRBDIR)/paintS.xpm \
	$(BRBDIR)/paintT.xpm

XBMDIR = bitmaps/xbm

XAW95DEPENDS = \
	chroma.o graphic.o main.o operation.o pattern.o print.o size.o

DEPLIBS = always xpaint.man XPaint.ad
LOCAL_LIBRARIES = -Lrw -lrw $(XPM_LIB) $(TIFF_LIB) $(SGI_LIB) $(JPEG_LIB) $(PNG_LIB) -ldl -rdynamic

SUBDIRS = rw

 PROGRAM = xpaint

all:: xpaint

xpaint: $(OBJS) $(DEPLIBS)
	$(RM) $@
	$(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) $(LOCAL_LIBRARIES) $(LDLIBS)  $(EXTRA_LOAD_FLAGS)

install:: xpaint
	@if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
	$(INSTALL) $(INSTALLFLAGS) $(INSTPGMFLAGS)  xpaint $(DESTDIR)$(BINDIR)/xpaint

install.man:: xpaint.man
	@if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
	$(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) xpaint.man $(DESTDIR)$(MANDIR)/xpaint.$(MANSUFFIX)

depend::
	$(DEPEND) $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS)

lint:
	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
lint1:
	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)

clean::
	$(RM) xpaint
#

install:: XPaint.ad
	@if [ -d $(DESTDIR)$(XAPPLOADDIR) ]; then set +x; \
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(XAPPLOADDIR)); fi
	$(INSTALL) $(INSTALLFLAGS) $(INSTAPPFLAGS) XPaint.ad $(DESTDIR)$(XAPPLOADDIR)/XPaint

always::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in  $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "making" always "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) CDEBUGFLAGS='$(CDEBUGFLAGS)' all); \
	done

Makefiles::
	-@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	case '${MFLAGS}' in *n*) executeit="no";; esac; \
	for i in $(SUBDIRS) bitmaps Doc ;\
	do \
	case "$(CURRENT_DIR)" in \
	.) curdir= ;; \
	*) curdir=$(CURRENT_DIR)/ ;; \
	esac; \
	echo "making Makefiles in $$curdir$$i..."; \
	itmp="$$i" \
	curtmp="$(CURRENT_DIR)" \
	toptmp=""; \
	case "$$itmp" in \
	../?*) \
	while echo "$$itmp" | grep '^../' > /dev/null;\
	do \
	toptmp="/`basename $$curtmp`$$toptmp"; \
	curtmp="`dirname $$curtmp`"; \
	itmp="`echo $$itmp | sed 's;../;;'`"; \
	done \
	;; \
	esac; \
	case "$$itmp" in \
	*/?*/?*/?*/?*) newtop=../../../../..;; \
	*/?*/?*/?*) newtop=../../../..;; \
	*/?*/?*) newtop=../../..;; \
	*/?*) newtop=../..;; \
	*) newtop=..;; \
	esac; \
	newtop="$$newtop$$toptmp"; \
	case "$(TOP)" in \
	/?*) imaketop=$(TOP) \
	imakeprefix= ;; \
	.) imaketop=$$newtop \
	imakeprefix=$$newtop/ ;; \
	*) imaketop=$$newtop/$(TOP) \
	imakeprefix=$$newtop/ ;; \
	esac; \
	cd $$i; \
	$(RM) Makefile.bak; \
	if [ -f Makefile ]; then \
	echo "	$(MV) Makefile Makefile.bak"; \
	if [ "$$executeit" != "no" ]; then \
	$(MV) Makefile Makefile.bak; \
	fi; \
	fi; \
	if [ "$$executeit" != "no" ]; then \
	$(IMAKE_CMD) -DTOPDIR=$$imaketop -DCURDIR=$$curdir$$i; \
	fi; \
	$(MAKE) $(MFLAGS) Makefiles; \
	cd $$newtop; \
	done

clean::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS)  clean); \
	done

# Other targets...

all::
	if test "$(XAWLIB_DEFINES)" = "" ; then cat xaw95-1.1.4/INFO_XAW95 ; fi

install::
	mkdir -p $(DESTDIR)$(SHAREDIR)/include
	cp -f *.h $(DESTDIR)$(SHAREDIR)/include
	cp -f XPaintIcon.xpm $(DESTDIR)$(SHAREDIR)
	mkdir -p $(DESTDIR)$(SHAREDIR)/c_scripts
	cp -r share/c_scripts $(DESTDIR)$(SHAREDIR)
	./substads -single share/include/Xpaint.h \
		$(DESTDIR)$(SHAREDIR)/include/Xpaint.h \
		"XPAINT_SHAREDIR" $(SHAREDIR)
	cp -f share/include/Xpaint3d.h $(DESTDIR)$(SHAREDIR)/include
	cd app-defaults/out ; cp -f * $(DESTDIR)$(XAPPLOADDIR)
	mkdir -p $(DESTDIR)$(SHAREDIR)/help
	cd share/help ; rm -f *~ ; cp -f Help* $(DESTDIR)$(SHAREDIR)/help
	mkdir -p $(DESTDIR)$(SHAREDIR)/messages
	cd share/messages ; rm -f *~ ; cp -f Messages* $(DESTDIR)$(SHAREDIR)/messages

xaw::
	-$(RM) $(XAW95DEPENDS)
	echo "SYS_LIBRARIES = XawClientLibs -lm" > Local.xawdefs
	xmkmf ; make

libXaw95.so:
	cd xaw95-1.1.4 ; xmkmf -a ; make
	-$(RM) libXaw95.so libXaw95.a
	-$(LN) xaw95-1.1.4/libXaw95.so libXaw95.so
	-$(LN) xaw95-1.1.4/libXaw95.a libXaw95.a

libXaw95.a: libXaw95.so

xaw95:: libXaw95.so
	-$(RM) $(XAW95DEPENDS)
	echo "XAWLIB_DEFINES = -DXAW95" > Local.xawdefs
	echo "SYS_LIBRARIES = -lXaw95 -L." >> Local.xawdefs
	xmkmf ; make

xaw95static:: libXaw95.a
	-$(RM) $(XAW95DEPENDS)
	echo "XAWLIB_DEFINES = -DXAW95" > Local.xawdefs
	echo "SYS_LIBRARIES = ./libXaw95.a -lm -lX11 -lXt -lXmu" >> Local.xawdefs
	xmkmf ; make

clean::
	-$(RM) preproc substads XPaint.ad XPaint.ad.h DefaultRC.txt.h PGP.*
	$(RM) -rf share/out
	cd share/help ; $(RM) *~
	cd share/messages ; $(RM) *~
	cd app-defaults ; $(RM) core *~ substads
	cd app-defaults/out ; $(RM) -f Xpaint*
	cd xaw95-1.1.4 ; if [ -r Makefile ] ; then make clean ; fi

includes:: XPaint.ad.h DefaultRC.txt.h messages.h
	cd bitmaps; $(RM) tools; \
	if test "$(TOOLFLAGS)" != "" ; \
	then ln -s big_tools tools ; else ln -s small_tools tools ; fi
	./xaw95-1.1.4/findxaw95

XPaint.ad: app-defaults
	$(CC) substads.c -o substads
	cd app-defaults ; \
	../substads -appdefs \
	            XPAINT_VERSION $(VERSION) \
		    XPAINT_SHAREDIR $(SHAREDIR) \
		    XPAINT_PRINT_COMMAND "$(PRINT_COMMAND)" \
		    XPAINT_POSTSCRIPT_VIEWER "$(POSTSCRIPT_VIEWER)" \
		    XPAINT_EXTERN_VIEWER "$(EXTERN_VIEWER)"
	cp -p app-defaults/out/XPaint XPaint.ad

XPaint.ad.h:	XPaint.ad
	./substads -ad2c $? $@
messages.h:	preproc.c share/messages/Messages
	$(CC) preproc.c -o preproc
	./preproc > messages.h
DefaultRC.txt.h: DefaultRC
	./substads -ad2c $? $@
xpaint.man:	xpaint.man.in .version
	./substads -single xpaint.man.in xpaint.man XPAINT_VERSION $(VERSION)

Colormap.o: ColormapP.h Colormap.h
Paint.o: PaintP.h Paint.h xpaint.h misc.h
PaintEvent.o: PaintP.h Paint.h xpaint.h
PaintRegion.o: PaintP.h Paint.h protocol.h
PaintUndo.o: xpaint.h misc.h PaintP.h Paint.h
blobOp.o: xpaint.h misc.h Paint.h ops.h
boxOp.o: xpaint.h misc.h Paint.h ops.h
brushOp.o: xpaint.h misc.h Paint.h palette.h \
	graphic.h protocol.h ops.h $(BRUSHBITMAPS)
circleOp.o: xpaint.h misc.h Paint.h ops.h
chroma.o: xpaint.h Paint.h palette.h protocol.h color.h messages.h \
	 misc.h operation.h ops.h
color.o: messages.h palette.h protocol.h color.h xpaint.h misc.h image.h
colorEdit.o: misc.h palette.h color.h protocol.h
dialog.o: misc.h xpaint.h protocol.h
fatBitsEdit.o: Paint.h xpaint.h messages.h palette.h menu.h misc.h region.h \
	protocol.h graphic.h
fileName.o: Paint.h messages.h misc.h image.h rw/rwTable.h graphic.h \
	protocol.h
fontSelect.o: xpaint.h messages.h misc.h operation.h ops.h graphic.h protocol.h
grab.o: image.h
graphic.o: xpaint.h palette.h messages.h misc.h menu.h text.h graphic.h \
	image.h region.h operation.h rc.h protocol.h color.h rw/rwTable.h
hash.o: misc.h hash.h
help.o: Paint.h misc.h protocol.h
image.o: image.h hash.h palette.h misc.h protocol.h
imageComp.o: image.h hash.h protocol.h misc.h
iprocess.o: xpaint.h image.h misc.h protocol.h
lineOp.o: xpaint.h misc.h Paint.h ops.h
main.o: XPaint.ad.h messages.h misc.h graphic.h protocol.h \
	rw/rwTable.h XPaintIcon.xpm .version
menu.o: menu.h $(XBMDIR)/checkmark.xbm $(XBMDIR)/pullright.xbm
misc.o: $(XBMDIR)/background.xbm xpaint.h misc.h messages.h
operation.o: $(OPBITMAPS) Local.config operation.c ops.h xpaint.h misc.h \
	menu.h Paint.h text.h graphic.h image.h operation.h protocol.h \
	region.h messages.h
	$(CC) -c -I./$(OPBDIR) $(CFLAGS) $*.c
palette.o: messages.h palette.h hash.h misc.h image.h xpaint.h
pattern.o: Colormap.h Paint.h palette.h xpaint.h menu.h misc.h image.h \
	region.h text.h graphic.h operation.h color.h protocol.h messages.h
pencilOp.o: xpaint.h Paint.h misc.h ops.h
print.o: xpaint.h menu.h image.h messages.h misc.h region.h text.h \
	graphic.h operation.h color.h protocol.h
protocol.o: xpaint.h messages.h misc.h protocol.h \
	$(XBMDIR)/wait1.xbm $(XBMDIR)/wait2.xbm \
	$(XBMDIR)/wait3.xbm $(XBMDIR)/wait4.xbm
readRC.o: image.h rc.h misc.h DefaultRC.txt.h
size.o: Paint.h messages.h misc.h text.h
snapshot.o: Paint.h image.h messages.h
text.o: misc.h protocol.h text.h
typeConvert.o: palette.h misc.h
fontOp.o: xpaint.h Paint.h graphic.h misc.h ops.h
arcOp.o: xpaint.h Paint.h misc.h ops.h
polyOp.o: xpaint.h misc.h Paint.h ops.h
fillOp.o: Paint.h protocol.h xpaint.h ops.h image.h misc.h palette.h
selectOp.o: xpaint.h Paint.h protocol.h palette.h color.h misc.h \
	operation.h ops.h
sprayOp.o: xpaint.h Paint.h misc.h ops.h

TEXT =	README README.old README.PNG INSTALL DefaultRC ChangeLog \
	xpaint.man.in TODO .version Imakefile Local.config
MISC = XPaintIcon.xpm Filelist preproc.c substads.c

makelist::
	-$(RM) Filelist
	@touch Filelist

makelist::
	sh -c 'for i in '"$(TEXT) $(SRCS) $(MISC) $(LANGFILES) $(HDRS)"' ; \
	do echo $(CURRENT_DIR)/$$i >> $(TOP)/Filelist ; done '
	share/bin/make_list

makelist::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in  $(SUBDIRS) bitmaps Doc ;\
	do \
	(cd $$i ; echo   "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS)    makelist); \
	done

kit: makelist
	sh -c 'sum="`cat Filelist`" ; makekit -oMANIFEST MANIFEST $$sum'

targz: makelist
	make realclean
	cd xaw95-1.1.4 ; if [ -r Makefile ] ; then make realclean ; fi
	cd .. ; tar cvfz xpaint-$(VERSION).tar.gz xpaint-$(VERSION)

tarbz2: makelist
	make realclean ;
	cd .. ; tar cvfj xpaint-$(VERSION).tar.bz2 xpaint-$(VERSION)

TAGS:	$(SRCS) $(HDRS) $(RWSRC)
	etags -t -o ./TAGS $(XPSRC) $(OPSRC) $(XPWIDSRC) $(RWSRC) $(HDRS)

realclean: clean
	-$(RM) messages.h bitmaps/tools \
	Makefile* */Makefile* xpaint.man libXaw95.*

certification:	makelist
	-$(RM) $(CERTIFICATION)
	certify `cat Filelist`

# -----------------------------------------------------------------------
# common rules for all Makefiles - do not edit

.c.i:
	$(RM) $@
	$(CC) -E $(CFLAGS) $(_NOOP_) $*.c > $@

emptyrule::

clean::
	$(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut   "#"*

Makefile::
	-@if [ -f Makefile ]; then set -x; \
	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)

tags::
	$(TAGS) -w *.[ch]
	$(TAGS) -xw *.[ch] > TAGS

man_keywords::
	catman -M $(DESTDIR)$(MANPATH) -w

# ----------------------------------------------------------------------
# empty rules for directories that do not have SUBDIRS - do not edit

install::
	@echo "install in $(CURRENT_DIR) done"

install.man::
	@echo "install.man in $(CURRENT_DIR) done"

Makefiles::

includes::

depend::

# -----------------------------------------------------------------------
# dependencies generated by makedepend

