## 
## Copyright (C) 2000-2004 Iowa State University
## 
## This file is part of mjc, the MultiJava Compiler.
## 
## based in part on work:
## 
## Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
## $Id: Makefile,v 1.49 2006/12/13 20:59:34 wdietl Exp $
##

## ----------------------------------------------------------------- 
## At the bottom of this file we import $(TOPDIR)/Make.ProjDefs.  See the
## that file for substantial documentation.
## ----------------------------------------------------------------- 

TOPDIR =	../../..

PACKAGE =	org/multijava/mjc

SUBDIRS = 	testcase

TESTDIRS = 	testcase

# Compiler classes
JAVAFILES +=								\
		CArrayType CAssertHelperMethod				\
		CAssertStaticInitMethod CBadClass			\
		CBinaryClass 						\
		CBinaryClassContext					\
		CBinaryField 						\
		CBinaryGFCollection					\
		CBinaryMethod						\
		CBlockError CBooleanType CBooleanValueType		\
		CCaptureType						\
		CClass CClassContext 					\
		CClassContextType					\
		CClassFQNameType					\
		CClassNameType						\
		CClassType						\
		CCompilationUnit CCompilationUnitContext		\
		CCompilationUnitContextType				\
		CConstructorContext 					\
		CConstructorContextType					\
		CContext 						\
		CContextType						\
		CContextNullity						\
		CCORInitializer					\
		CExpressionContext					\
		CExpressionContextType					\
		CExpressionError CField		 			\
		CFieldAccessor CFieldAccessorMethod			\
		CFieldGetterMethod CFieldSetterMethod			\
		CFieldTable						\
		CFinallyContext					\
		CFlowControlContext					\
		CFlowControlContextType					\
		CFunctionAccessMethod				\
		CInitializable						\
		CInitializerContext 					\
		CInitializerContextType					\
		CInterfaceContext 					\
		CInterfaceContextType 					\
		CLabeledContext						\
		ClassCreator						\
		CLineError CLoopContext CMember				\
		CMethod CMethodContext 					\
		CMethodContextType					\
		CMethodInfo						\
		CMethodNotFoundError CModifier CNullType		\
		CNumericType COrdinalValueType CParseClassContext	\
		CParseCompilationUnitContext CRealValueType		\
		CSourceClass CSourceField				\
		CSourceFilteredDispatcherMethod				\
		CSourceMethod CStdType CStringValueType			\
		CSwitchBodyContext CSwitchGroupContext			\
		CThrowableInfo CTopLevel CTryContext			\
		CType 							\
		CTypeNullity						\
		CTypeSignatureAppender					\
		CTypeVariable						\
		CTypeVariableAlias					\
		CValueType CVariableInfoTable CVariableState		\
		CVoidType CWrapperMethod				\
		CWildcardType						\
		CodeLabel CodeSequence Constants			\
		DefaultFilter JCheckedExpression MjcPrettyPrinter	\
		MjcVisitor Main	MemberAccess				\
		MJMathMode						\
		SigSourceMember

# Syntax tree types
JAVAFILES +=						\
		JClassDeclarationType			\
		JClassOrGFImportType 			\
		JCompilationUnitType			\
		JConstructorDeclarationType		\
		JFieldDeclarationType			\
		JInterfaceDeclarationType		\
		JMemberDeclarationType			\
		JMethodDeclarationType			\
		JPackageImportType			\
		JTypeDeclarationType

# Syntax tree classes
JAVAFILES +=	SafeIntegralArithmetic					\
		JAddExpression JArrayAccessExpression			\
		JArrayDimsAndInits					\
		JArrayInitializer JArrayLengthExpression		\
		JAssertStatement					\
		JAssignmentExpression JBinaryArithmeticExpression	\
		JBinaryExpression JBitwiseExpression JBlock		\
		JBooleanLiteral JBreakStatement JCastExpression		\
		JCatchClause JCharLiteral JClassBlock			\
		JClassDeclaration JClassExpression			\
		JClassFieldDeclarator					\
		JClassFieldExpression JClassOrGFImport JCompilationUnit	\
		JCompoundAssignmentExpression JCompoundStatement	\
		JConditionalAndExpression JConditionalExpression	\
		JConditionalOrExpression JConstructorBlock		\
		JConstructorDeclaration JContinueStatement		\
		JDivideExpression JDoStatement JEmptyStatement		\
		JEqualityExpression JExplicitConstructorInvocation	\
		JExpression JExpressionListStatement			\
		JExpressionStatement					\
		JFieldDeclaration JForStatement JFormalParameter	\
		JGeneratedLocalVariable JIfStatement			\
		JInitializerDeclaration JInstanceofExpression		\
		JInterfaceDeclaration JLabeledStatement JLiteral	\
		JLocalVariable JLocalVariableExpression JLoopStatement	\
		JMemberDeclaration JMethodCallExpression		\
		JMethodDeclaration JMinusExpression JModuloExpression	\
		JMultExpression JNameExpression				\
		JNewAnonymousClassExpression JNewArrayExpression	\
		JNewObjectExpression JNullLiteral JNumberLiteral	\
		JOrdinalLiteral JOuterLocalVariableExpression		\
		JPackageImport JPackageName JParenthesedExpression	\
		JPhylum JPostfixExpression JPrefixExpression		\
		JRealLiteral JRelationalExpression			\
		JReturnStatement JShiftExpression JStatement		\
		JStringLiteral JSuperExpression JSwitchGroup		\
		JSwitchLabel JSwitchStatement JSynchronizedStatement	\
		JThisExpression JThrowStatement JTryCatchStatement	\
		JTryFinallyStatement JTypeDeclaration			\
		JTypeDeclarationStatement JTypeNameExpression		\
		JUnaryExpression JUnaryPromote				\
		JVariableDeclarationStatement JVariableDefinition	\
		JWhileStatement

# Additional syntax tree classes for MultiJava
JAVAFILES +=								\
		JResendExpression					\
		MJGenericFunctionDecl MJSpecialMethod			\
		MJTopLevelDeclaration MJTopLevelMethodDeclaration	\
		MJWarnExpression MJMathModeExpression					

# Additional compiler classes for MultiJava
JAVAFILES +=								\
		AbstractFileFinder					\
		CAbstractMethodSet 					\
		CAnchorInitializer					\
		CAugmentationMap 					\
		CBinaryGFCollection					\
		CDispatcherSignature					\
		CExtMethodContext CGFCollectionMap			\
		CGenericFunctionCollection CMemberHost			\
		CMethodSet				 		\
		CSourceDispatcherClass					\
		CSourceDispatcherMethod	CSourceGFCollection		\
		CSourceDispatcherSignature				\
		CSourceRedirectorMethod					\
		CSpecializedType					\
		CompilerPassEnterable					\
		Debug 							\
		FileFinder 						\
		JExpressionFactory					\
		MjcFileFinder						\
		ParserUtility 						\
		ParsingController					\
		TypeLoader						\
		VariableDescriptor					\

# Additional compiler classes for Relaxed MultiJava
JAVAFILES +=	MJTopLevelAbstractMethodDeclaration			\
		CDispatcherInitializer					\
		CAmbiguousDispatcherClass				\
		CSourceAmbiguousDispatcherClass				\

# Additional compiler classes for the Universe type system
JAVAFILES +=	CUniverse						\
		CUniversePeer						\
		CUniverseReadonly					\
		CUniverseRep						\
		CUniverseImplicitPeer					\
		CUniverseImplicitReadonly				\
		CUniverseRuntimeHelper					\
		UniverseFilter						\
		CUniverseMethodAnnotation			\
		CUniverseTypeAnnotation				\

# Test files that are transitively included in the generated test suite
JAVAFILES +=	TestMain_CodeGen TestMain_Runtime TestMain_Typecheck	\
		TestMain_TransCompile					\

MESSAGES =	Mjc CUniverse

OPTIONS =	MjcCommonOptions MjcOptions

GUI = 	MjcGUI

# unit test files
TESTFILES =	TestCContext TestJTypeDeclaration 			\
		FunctionalTestSuite TestMjcParser			\
		TestParsingController

KEYWORDS =	Mjc

## ----------------------------------------------------------------------
## GOALS

default:	build buildtests

build-this:	antlr classes

clean-this:	simple-clean antlr-clean

runtests-this:	junittests selftest

selftest:
	-time $(JAVA) org.multijava.mjc.Main -W -w0 $(USERMJCFLAGS) *.java

## ----------------------------------------------------------------------
## ANTLR

JD_JAVAFILES =				\
		JavadocLexer		\
		JavadocLexerTokenTypes	\
		JavadocParser		\
		JavadocTokenTypes	\

MJ_JAVAFILES =				\
		MjcLexer 		\
		MjcLexerTokenTypes	\
		MjcParser		\
		MjcTokenTypes		\

ANTLR_JAVAFILES = $(JD_JAVAFILES) $(MJ_JAVAFILES)

ANTLR_GENFILES =				\
		JavadocLexerTokenTypes 		\
		JavadocTokenTypes		\
		MjcLexerTokenTypes 		\
		MjcTokenTypes			\

$(addsuffix .java,$(JD_JAVAFILES)):	Javadoc.g MjcIDTokenTypes.txt
		$(JCC) Javadoc.g

$(addsuffix .java,$(MJ_JAVAFILES)):	Mjc.g MjcIDTokenTypes.txt
		$(JCC) Mjc.g

## ----------------------------------------------------------------------
## GLOBAL DEFINITIONS

include $(TOPDIR)/Make.ProjDefs
