# 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 <Imakefile>
# $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.1 01/13/97 16:16:27 $

# operating system:  SunOS 5.6

# 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

# -----------------------------------------------------------------------
# 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 = -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 = psroff
         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 -xcg92

      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.3 04/21/97 16:46:25 $

# 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.2 02/06/97 16:06:36 $

# $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

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

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

        CONFIGDIR = $(LIBDIR)/config

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

BINDIR = /usr/local/bin
XC_LIBDIR = /usr/local/lib/xcoral
XCORALLIBDIR = \"$(XC_LIBDIR)\"
CC = gcc

PROG_NAME = xcoral
SUBDIRS = Smac
LOCAL_LIBRARIES =

LINTOPTS=-axzu
MFLAGS="CC=$(CC)"
CCOPTIONS=
DEFINES =
FLAGS_REGEXP=-DHAVE_STRING_H=1 -DHAVE_ALLOCA_H=1
CDEBUGFLAGS =  -DXCORAL_LIB_DIR=$(XCORALLIBDIR) $(FLAGS_REGEXP)

EXTENSIONLIB =
DEPLIBS =
SYS_LIBRARIES = $(XLIB)

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

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

SRCS    = xcoral.c handle_menus.c init_menus.c cb_names.c new_window.c \
        main_events.c handle_key.c chars_cmds.c shadow.c ctr_panel.c \
        main_text.c scroll.c page.c parse.c get_file.c \
        bm_search.c mark_reg.c main_buffer.c text_cursor.c \
        kill_buf.c browser_init.c browser_eve.c undo.c \
        BR_Lexer.c BR_Parser.c BR_main.c \
        browser_eng.c browser_pars.c browser_util.c class_dict.c global_dict.c \
        file_dict.c proc_dict.c ie_func.c mode.c input_str.c \
	process.c warn_box.c dial_box.c fs_box.c list_box.c man_box.c justify.c macros.c \
	regex.c ctr_version.c color_area.c selection.c tool_bar.c buttons_bits.c

OBJS    = xcoral.o handle_menus.o init_menus.o cb_names.o new_window.o \
        main_events.o handle_key.o chars_cmds.o shadow.o ctr_panel.o \
        main_text.o scroll.o page.o parse.o get_file.o \
        bm_search.o mark_reg.o main_buffer.o text_cursor.o \
        kill_buf.o browser_init.o browser_eve.o undo.o \
        BR_Lexer.o BR_Parser.o BR_main.o \
        browser_eng.o browser_pars.o browser_util.o class_dict.o global_dict.o \
        file_dict.o proc_dict.o ie_func.o mode.o input_str.o process.o \
	warn_box.o dial_box.o fs_box.o list_box.o man_box.o justify.o macros.o \
	regex.o ctr_version.o color_area.o selection.o tool_bar.o buttons_bits.o

SMACOBJS = Smac/y.tab.o Smac/mylex.o Smac/list.o Smac/memo.o Smac/hash.o\
	Smac/mem.o Smac/const.o Smac/stack.o Smac/error.o Smac/control.o\
	Smac/function.o Smac/type.o Smac/identifier.o Smac/block.o	\
	Smac/declaration.o Smac/if.o Smac/operator.o Smac/funcall.o	\
	Smac/comma.o Smac/return.o Smac/while.o Smac/for.o Smac/cast.o	\
	Smac/assignment.o Smac/array.o Smac/indirection.o Smac/switch.o	\
	Smac/smac.o Smac/Type.o Smac/Const.o Smac/Var.o Smac/Block.o	\
	Smac/If.o Smac/Return.o Smac/Comma.o Smac/Function.o		\
	Smac/FunctionCall.o Smac/Identifier.o Smac/Builtin.o \
	Smac/Declaration.o Smac/While.o Smac/Control.o Smac/For.o 	\
	Smac/Cast.o Smac/Array.o Smac/RefDeref.o Smac/Switch.o		\
	Smac/smacXcoral.o

MISCFILES	= SmacLib/DEPEND SmacLib/README SmacLib/cmd.sc \
	SmacLib/color.sc SmacLib/comments.sc SmacLib/compare-win.sc \
	SmacLib/complete-word.sc SmacLib/describe.sc SmacLib/edir.sc \
	SmacLib/edt.sc SmacLib/example.sc SmacLib/french.sc \
	SmacLib/hack-filename.sc SmacLib/head.sc SmacLib/html.sc \
	SmacLib/java.sc SmacLib/keydef-ext.sc SmacLib/latex-macros.sc \
	SmacLib/latex.sc SmacLib/man.dtex SmacLib/misc-commands.sc \
	SmacLib/mode-ext.sc SmacLib/mode.sc SmacLib/mouse.sc \
	SmacLib/rcs.sc SmacLib/save.sc SmacLib/sun-keydef.sc \
	SmacLib/title.sc SmacLib/top-ten.sc SmacLib/utilities.sc \
	SmacLib/version.sc SmacLib/window-utilities.sc SmacLib/xcoralrc.lf

All:
	$(MAKE) $(MFLAGS) Makefiles
	$(MAKE) $(MFLAGS) clean
	$(RM) Smac/word.h
	$(MAKE) $(MFLAGS)

BR_Parser.c BR_Parser.h: BR_Parser.y
	bison -d -t -p BR_yy BR_Parser.y
	mv BR_Parser.tab.c BR_Parser.c
	mv BR_Parser.tab.h BR_Parser.h

BR_Lexer.c: BR_Lexer.l BR_Parser.h
	flex -8 -PBR_yy -oBR_Lexer.c BR_Lexer.l

all:: $(PROG_NAME)

$(PROG_NAME):  $(OBJS) $(SMACOBJS)
	$(RM) $@
	$(CCLINK) -o $@ $(LDOPTIONS)  $(OBJS) $(SMACOBJS)  $(LOCAL_LIBRARIES) $(LDLIBS) $(SYSLIB) $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) $(PROG_NAME)

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

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

install:: $(MISCFILES)
	@if [ -d $(DESTDIR)$(XC_LIBDIR) ]; then set +x; \
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(XC_LIBDIR)); fi
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
	for i in $(MISCFILES); do \
	(set -x; $(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) $$i $(DESTDIR)$(XC_LIBDIR)); \
	done

COMPRESS = gzip

tar:
	$(MAKE) $(MFLAGS) clean
	$(RM) xcoral-`grep CURRENT_VERSION xcoral.h | awk '{print $$5}'`.tar.Z Smac/word.h
	$(RM) xcoral-`grep CURRENT_VERSION xcoral.h | awk '{print $$5}'`.tar.gz
	$(CP) xcoral.h /tmp
	cd .. ; tar cf -  xcoral-`grep CURRENT_VERSION /tmp/xcoral.h | awk '{print $$5}'`/[A-Za-z]* | compress > xcoral-`grep CURRENT_VERSION /tmp/xcoral.h | awk '{print $$5}'`/.xxx
	mv .xxx xcoral-`grep CURRENT_VERSION /tmp/xcoral.h | awk '{print $$5}'`.tar.Z
	$(RM) /tmp/xcoral.h

targz:
	$(MAKE) $(MFLAGS) clean
	$(RM) xcoral-`grep CURRENT_VERSION xcoral.h | awk '{print $$5}'`.tar.gz Smac/word.h
	$(RM) xcoral-`grep CURRENT_VERSION xcoral.h | awk '{print $$5}'`.tar.Z
	$(CP) xcoral.h /tmp
	cd .. ; tar cf -  xcoral-`grep CURRENT_VERSION /tmp/xcoral.h | awk '{print $$5}'`/[A-Za-z]* | gzip > xcoral-`grep CURRENT_VERSION /tmp/xcoral.h | awk '{print $$5}'`/.xxx
	mv .xxx xcoral-`grep CURRENT_VERSION /tmp/xcoral.h | awk '{print $$5}'`.tar.gz
	$(RM) /tmp/xcoral.h

# -----------------------------------------------------------------------
# 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

# ----------------------------------------------------------------------
# rules for building in SUBDIRS - do not edit

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

install.man::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) install.man); \
	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

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

Makefiles::
	-@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	case '${MFLAGS}' in *n*) executeit="no";; esac; \
	for i in $(SUBDIRS) ;\
	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

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

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

