CHMOD		= /bin/chmod
READONLY	= 444

CSRCS		=
CCSRCS		=

MMHOME		= /user/stire/Mastermind/mdl
AMULETHOME      = /soft/lus/Amulet
AR		= /usr/ccs/bin/ar rc
AWK		= awk
BIBTEX		= /opt/bin/bibtex
BISON		= /opt/bin/bison
BLOCKINGBASE    = EventWithFeedback
BLOCKINGBASENODATA    = EventWithFeedbackLessData
BLOCKINGPREFIX  = MMBlockingEvent
CAT		= /bin/cat
CC		= /opt/bin/gcc
CCC		= /usr/local/bin/g++
CXX		= $(CCC)
CINCLUDES       =
CFLAGS		= $(CINCLUDES)
CCINCLUDES      =
CCFLAGS         = $(CCINCLUDES)
CC_SPECIFIC_FLAGS =
CI		= ci
CIFLAGS		=
DEPEND		= /usr/openwin/bin/makedepend -I/soft/sparc/gnu/sparc-sun-solaris2.8/include -I/soft/sparc/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/include
DEPENDFLAGS	=
DPRINT          = /usr/local/stp/binsun4/dprint
ESZ		= /soft/lus/esz/bin/esz
EVENTBASE       = Event
EVENTPREFIX     = MMEvent
FAIRINTERRUPTS  = ${MMHOME}/Sys/SMCompiler/GenCeilingInterruptFairness.sh
FAIRNESS        = ${MMHOME}/Sys/SMCompiler/GenFairness.sh
FIG2DEV		= /usr/local/bin/fig2dev
FIG2PS		= ${FIG2DEV} -L ps
GIFTOPNM	= giftopnm
GPP_INCLUDE     = /soft/sparc/gnu/include/g++-3
PORTOPTS	= -p dummy
LANDOPTS	= -l dummy
FIG2EPS		= ${FIG2DEV} -L ps
FLEX		= /user/research/stire/flex-2.5.4/flex
FLEX_INCLUDE    = /soft/sparc/gnu/include
IMAKE           = /usr/openwin/bin/imake
IMAKE_DEFINES   = -I/user/stire/config -I/usr/openwin/lib/config -DConstructMFLAGS=0 -DStripInstalledPrograms=1 -DMMSEED=/user/stire/Mastermind/mdl
IMAGESDIR	= /user/stire/Images
INSTALL		= /usr/ucb/install
INSTALLFLAGS	= -m 0444
LATEX		= /opt/bin/latex
LATEXDIR	= /user/stire/LaTeX
LDOPTIONS	=
LEDA            = /user/r00/stire/LEDA-3.7.1-solaris-g++-2.8
LEDAINCLUDE     = $(LEDA)/incl
LEX		= /bin/lex
LN		= /bin/ln -s
LS		= /bin/ls
MACHINES        = ${MMHOME}/Sys/OperatorSource
MAKE		= /usr/local/bin/gmake
MAKEINDEX	= makeindex
NOTANGLE        = /soft/lus/noweb/bin/sparc/notangle
NOWEAVE         = /soft/lus/noweb/bin/sparc/noweave
PERL            = /opt/bin/perl
PNMTOPS		= pnmtops
RM		= /bin/rm -f
SEQLEFTCHECK    = ${MMHOME}/Sys/SMCompiler/GenSeqLeftCheck.sh
SMC             = /user/stire/bin/smc
SMV             = /soft/lus/SMV/smv -c 1046429
TESTLINK	= -h
TESTWRITE	= -w
TOUCH           = /usr/ucb/touch
TRAIL           = ${MMHOME}/Sys/SMCompiler/GenTrailer.sh
USERMANSTRIP    = /user/stire/bin/usermanstrip
UTILSDIR	= ${LATEXDIR}/utils
YACC		= /bin/yacc
YFLAGS		= -d

DOCSRCS		=

all::

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

DVIS	= $(patsubst %.tex,%.dvi,$(filter %.tex,$(DOCSRCS)))

.SUFFIXES:	.fred .fred,v .tex .tex,v .dvi .pfig .fig .eps .ps .pdf .mdl .preps .smv ${SUFFIXES}

.fred,v.fred:
	co $@

.fred.tex:
	${FREDC} ${FREDCFLAGS} -L $*.fred

.fred.smv:
	${FREDC} ${FREDCFLAGS} -S $*.fred > $*.smv

.tex,v.tex:
	co $@

.pfig.preps:
	${FIG2PS} ${PORTOPTS} $*.pfig $*.preps

.fig.preps:
	${FIG2PS} $*.fig $*.preps

.preps.ps:
	${RM} ${RMFLAGS} $*.ps
	${CAT} $*.preps ${UTILSDIR}/close-ps > $*.ps
	${RM} ${RMFLAGS} $*.preps
	${CHMOD} ${READONLY} $*.ps

.fig.eps:
	${RM} ${RMFLAGS} $*.eps
	${FIG2PS} $*.fig $*.eps
	${CHMOD} ${READONLY} $*.eps

.tex.dvi:
	@if [ ! ${TESTLINK} LaTeX ]; \
	then ${LN} ${LATEXDIR} LaTeX; \
	fi
	@if [ ! ${TESTLINK} Images ]; \
	then ${LN} ${IMAGESDIR} Images; \
	fi
	@${LATEX} $* | tee .__temp
	@if grep -s -i "undefined" .__temp; \
	then ${BIBTEX} $* ; \
	     ${LATEX} $* | tee .__temp ; \
	     if grep -s -i "rerun to get" .__temp; \
	     then ${LATEX} $* | tee .__temp; \
	          if grep -s -i "undefined" .__temp; \
	                 then ${BIBTEX} $* ; \
	                      ${LATEX} $* | tee .__temp; \
	                      if grep -s -i "rerun to get" .__temp; \
	                      then ${LATEX} $* ; \
	                      fi \
	                 fi \
	     fi; \
	       fi
	@/bin/rm .__temp

checkin:
	@for i in ${DOCSRCS}; \
	do \
	   if [ ${TESTWRITE} $$i ]; \
	   then ${CI} ${CIFLAGS} $$i; \
	   fi \
	done

.dvi.ps:
	dvips -f $*.dvi >$*.ps

.ps.pdf:
	ps2pdf $*.ps $*.pdf

.cc.o:
	$(CCC) $(CCFLAGS) -c $*.cc

tidy::
	if [ ${TESTLINK} Images ]; \
	then ${RM} Images; \
	fi
	if [ ${TESTLINK} LaTeX ]; \
	then ${RM} LaTeX; \
	fi
	${RM} *.log

        CONFIGDIR = ConfigDir

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

MAKEOVERRIDES =

Makefiles::
	-@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	case '${MFLAGS}' in *n*) executeit="no";; esac; \
	for i in AST ;\
	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 AST ;\
	do \
	(cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS)  clean); \
	done

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

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

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

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

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

CCFLAGS += -I.
DEPENDFLAGS +=  -I${GPP_INCLUDE}



CSRCS +=
CCSRCS +=  GenCppClassDeclaration.cc 			   GenMixinLayer.cc 			   GenConstraintTriggerRefinements.cc 			   GenStatusTypeRefinement.cc 			   GenModeComponentInterface.cc 			   mccg.cc 			   driver.cc
SRCS += $(CSRCS) $(CCSRCS)
OBJS += $(CSRCS:.c=.o) $(CCSRCS:.cc=.o)

all:: libmccodegen.a

libmccodegen.a: GenCppClassDeclaration.o 			      GenMixinLayer.o 			      GenConstraintTriggerRefinements.o 			      GenModeComponentInterface.o 			      GenStatusTypeRefinement.o mccg.o
	$(RM) $@
	$(AR) $@ GenCppClassDeclaration.o 			      GenMixinLayer.o 			      GenConstraintTriggerRefinements.o 			      GenModeComponentInterface.o 			      GenStatusTypeRefinement.o mccg.o
	$(_NULLCMD_)
	$(_NULLCMD_)

all:: driver
driver:  driver.o  			libmccodegen.a AST/libmcasast.a
	$(RM) $@
	$(CCC) $(CCFLAGS) -o $@  driver.o $(LDOPTIONS)  			-L. -lmccodegen -LAST -lmcasast

clean::
	$(RM) driver

depend:: ${SRCS}
	$(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" --\
	$(DEPENDDEFINES) -- ${SRCS}

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

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

# DO NOT DELETE

GenCppClassDeclaration.o: GenCppClassDeclaration.h VariableIndent.h mccg.h
GenMixinLayer.o: GenMixinLayer.h GenCppClassDeclaration.h VariableIndent.h
GenMixinLayer.o: mccg.h
GenConstraintTriggerRefinements.o: GenConstraintTriggerRefinements.h
GenConstraintTriggerRefinements.o: AST/MCASVisitor.h GenMixinLayer.h
GenConstraintTriggerRefinements.o: GenCppClassDeclaration.h VariableIndent.h
GenConstraintTriggerRefinements.o: NamingConventions.h mccg.h
GenConstraintTriggerRefinements.o: AST/StatusAPIRefinement.h
GenConstraintTriggerRefinements.o: AST/MCASVisitor.h AST/ModeComponent.h
GenConstraintTriggerRefinements.o: AST/ServiceInterface.h AST/ServicesAPI.h
GenConstraintTriggerRefinements.o: AST/StatusAPI.h AST/StatusType.h
GenConstraintTriggerRefinements.o: AST/Type.h AST/StatusVariableDemon.h
GenStatusTypeRefinement.o: GenStatusTypeRefinement.h AST/MCASVisitor.h
GenStatusTypeRefinement.o: GenMixinLayer.h GenCppClassDeclaration.h
GenStatusTypeRefinement.o: VariableIndent.h NamingConventions.h mccg.h
GenStatusTypeRefinement.o: AST/ModeComponent.h AST/MCASVisitor.h
GenStatusTypeRefinement.o: AST/StatusAPI.h AST/StatusVariable.h
GenStatusTypeRefinement.o: AST/StatusType.h AST/Type.h AST/ServicesAPI.h
GenModeComponentInterface.o: GenModeComponentInterface.h AST/MCASVisitor.h
GenModeComponentInterface.o: GenCppClassDeclaration.h VariableIndent.h
GenModeComponentInterface.o: NamingConventions.h mccg.h AST/ModeComponent.h
GenModeComponentInterface.o: AST/MCASVisitor.h AST/ServiceInterface.h
GenModeComponentInterface.o: AST/ServicesAPI.h AST/StatusAPI.h
GenModeComponentInterface.o: AST/StatusType.h AST/Type.h AST/StatusVariable.h
GenModeComponentInterface.o: AST/CppType.h
mccg.o: mccg.h
driver.o: AST/StatusAPIRefinement.h AST/MCASVisitor.h AST/ModeComponent.h
driver.o: AST/ServiceInterface.h AST/ServicesAPI.h AST/StatusAPI.h
driver.o: AST/StatusType.h AST/Type.h AST/StatusUpdateRefinement.h
driver.o: AST/StatusVariable.h AST/StatusVariableDemon.h AST/CppType.h
driver.o: NamingConventions.h GenModeComponentInterface.h AST/MCASVisitor.h
driver.o: GenCppClassDeclaration.h VariableIndent.h
driver.o: GenConstraintTriggerRefinements.h GenMixinLayer.h
driver.o: GenStatusTypeRefinement.h
