PHONY : all classes models schemas statements templates ertemplates reltemplates templatesgui clean \

.SUFFIXES : 

.SUFFIXES : .java .class

JFLAGS :=
JCCFLAGS := -O -deprecation

run : 
	@echo "Use the following"
	@echo "make basic	to create er, relational models and corresponding template transformations"
	@echo "make demo    to execute template transformations on the schemas"
	@echo "make templatesgui  to run graphical interface to implement the template"
	@echo "	               transformations (already defined using 'templates')"


basic : models schemas templates 

demo : transformations

models : DefineModels.class
	java $(JFLAGS) DefineModels

schemas : DefineSchemas.class
	java $(JFLAGS) DefineSchemas

statements: DefineStatements.class
	java $(JFLAGS) DefineStatements

templates: statements reltemplates ertemplates

ertemplates: AttributeToEntityEquivalence.class  AttributeToGeneralisationEquivalence.class GeneralisationToAttributeEquivalence.class
	java $(JFLAGS) AttributeToEntityEquivalence
	java $(JFLAGS) AttributeToGeneralisationEquivalence
	java $(JFLAGS) GeneralisationToAttributeEquivalence

reltemplates: MandatoryColumnToHierarchyEquivalence.class ColumnMovedDownHierarchy.class
	java $(JFLAGS) MandatoryColumnToHierarchyEquivalence
	java $(JFLAGS) ColumnMovedDownHierarchy

transformations: DefineTransformationsUsingTemplates.class
	java $(JFLAGS) DefineTransformationsUsingTemplates


templatesgui:
	java uk.ac.ic.doc.automed.templates.gui.SchemaFrame

clean :
	rm -f *.class *~

classes : $(patsubst %.java,%.class,$(wildcard *.java))

%.class : %.java
	javac $(JCCFLAGS) $<

