# This is a GNU Makefile for Artemis

# $Header: /nfs/disk222/yeastpub/Repository/powmap/Makefile,v 1.133 2000/09/26 09:29:53 kmr Exp $

SHELL=/bin/sh

OPT_FLAGS = -g

JAVAC := javac $(OPT_FLAGS) -deprecation -J-mx150m $(EXTRA_FLAGS)

REAL_CLASSPATH := CLASSPATH=.:lib/JacORB.jar:$(CLASSPATH)


NAMES:= \
	uk/ac/sanger/pathogens/ReadOnlyException \
	uk/ac/sanger/pathogens/Document \
	uk/ac/sanger/pathogens/URLDocument \
	uk/ac/sanger/pathogens/FileDocument \
	uk/ac/sanger/pathogens/FileProgressDocument \
	uk/ac/sanger/pathogens/ProgressInputStream \
	uk/ac/sanger/pathogens/InputStreamProgressEvent \
	uk/ac/sanger/pathogens/InputStreamProgressListener \
	uk/ac/sanger/pathogens/OutOfRangeException \
	uk/ac/sanger/pathogens/StringVector \
	uk/ac/sanger/pathogens/FastVector \
	uk/ac/sanger/pathogens/embl/Key \
	uk/ac/sanger/pathogens/embl/OutOfDateException \
	uk/ac/sanger/pathogens/embl/KeyVector \
	uk/ac/sanger/pathogens/embl/EMBLObject \
	uk/ac/sanger/pathogens/embl/EntryInformationException \
	uk/ac/sanger/pathogens/embl/EntryInformation \
	uk/ac/sanger/pathogens/embl/SimpleEntryInformation \
	uk/ac/sanger/pathogens/embl/GFFEntryInformation \
	uk/ac/sanger/pathogens/embl/MSPcrunchEntryInformation \
	uk/ac/sanger/pathogens/embl/QualifierParseException \
	uk/ac/sanger/pathogens/embl/ReadFormatException \
	uk/ac/sanger/pathogens/embl/UpperInteger \
	uk/ac/sanger/pathogens/embl/LowerInteger \
	uk/ac/sanger/pathogens/embl/Location \
	uk/ac/sanger/pathogens/embl/LocationLexer \
	uk/ac/sanger/pathogens/embl/LocationParseException \
	uk/ac/sanger/pathogens/embl/LocationParseNode \
	uk/ac/sanger/pathogens/embl/LocationParseNodeVector \
	uk/ac/sanger/pathogens/embl/LineGroup \
	uk/ac/sanger/pathogens/embl/LineGroupVector \
	uk/ac/sanger/pathogens/embl/LinePushBackReader \
	uk/ac/sanger/pathogens/embl/Range \
	uk/ac/sanger/pathogens/embl/FuzzyRange \
	uk/ac/sanger/pathogens/embl/BetweenRange \
	uk/ac/sanger/pathogens/embl/RangeVector \
	uk/ac/sanger/pathogens/embl/Sequence \
	uk/ac/sanger/pathogens/embl/StreamSequence \
	uk/ac/sanger/pathogens/embl/EmblStreamSequence \
	uk/ac/sanger/pathogens/embl/GenbankStreamSequence \
	uk/ac/sanger/pathogens/embl/RawStreamSequence \
	uk/ac/sanger/pathogens/embl/FastaStreamSequence \
	uk/ac/sanger/pathogens/embl/StreamSequenceFactory \
	uk/ac/sanger/pathogens/embl/CorbaSequence \
	uk/ac/sanger/pathogens/embl/ComparableFeature \
	uk/ac/sanger/pathogens/embl/FeatureComparator \
	uk/ac/sanger/pathogens/embl/FeatureEnumeration \
	uk/ac/sanger/pathogens/embl/CorbaFeature \
	uk/ac/sanger/pathogens/embl/DateStampFeature \
	uk/ac/sanger/pathogens/embl/RWCorbaFeature \
	uk/ac/sanger/pathogens/embl/EnsemblCorbaSequence \
	uk/ac/sanger/pathogens/embl/EnsemblCorbaFeature \
	uk/ac/sanger/pathogens/embl/MiscLineGroup \
	uk/ac/sanger/pathogens/embl/GFFMisc \
	uk/ac/sanger/pathogens/embl/EmblMisc \
	uk/ac/sanger/pathogens/embl/FeatureHeader \
	uk/ac/sanger/pathogens/embl/GenbankMisc \
	uk/ac/sanger/pathogens/embl/Feature \
	uk/ac/sanger/pathogens/embl/StreamFeature \
	uk/ac/sanger/pathogens/embl/DocumentFeature \
	uk/ac/sanger/pathogens/embl/SimpleDocumentFeature \
	uk/ac/sanger/pathogens/embl/PublicDBStreamFeature \
	uk/ac/sanger/pathogens/embl/GFFStreamFeature \
	uk/ac/sanger/pathogens/embl/MSPcrunchStreamFeature \
	uk/ac/sanger/pathogens/embl/EmblStreamFeature \
	uk/ac/sanger/pathogens/embl/GenbankStreamFeature \
	uk/ac/sanger/pathogens/embl/FeatureTable \
	uk/ac/sanger/pathogens/embl/FeatureTree \
	uk/ac/sanger/pathogens/embl/FeatureVector \
	uk/ac/sanger/pathogens/embl/DocumentEntryAutosaveThread \
	uk/ac/sanger/pathogens/embl/Qualifier \
	uk/ac/sanger/pathogens/embl/InvalidRelationException \
	uk/ac/sanger/pathogens/embl/InvalidKeyException \
	uk/ac/sanger/pathogens/embl/InvalidQualifierException \
	uk/ac/sanger/pathogens/embl/StreamFeatureTable \
	uk/ac/sanger/pathogens/embl/StreamQualifier \
	uk/ac/sanger/pathogens/embl/QualifierVector \
	uk/ac/sanger/pathogens/embl/QualifierInfoVector \
	uk/ac/sanger/pathogens/embl/QualifierInfo \
	uk/ac/sanger/pathogens/embl/QualifierInfoException \
	uk/ac/sanger/pathogens/embl/PushBackException \
	uk/ac/sanger/pathogens/embl/ReadOnlyEntry \
	uk/ac/sanger/pathogens/embl/Entry \
	uk/ac/sanger/pathogens/embl/DocumentEntry \
	uk/ac/sanger/pathogens/embl/SimpleDocumentEntry \
	uk/ac/sanger/pathogens/embl/PublicDBDocumentEntry \
	uk/ac/sanger/pathogens/embl/EmblDocumentEntry \
	uk/ac/sanger/pathogens/embl/GenbankDocumentEntry \
	uk/ac/sanger/pathogens/embl/GFFDocumentEntry \
	uk/ac/sanger/pathogens/embl/MSPcrunchDocumentEntry \
	uk/ac/sanger/pathogens/embl/DocumentEntryFactory \
	uk/ac/sanger/pathogens/embl/CorbaEntry \
	uk/ac/sanger/pathogens/embl/RWCorbaEntry \
	uk/ac/sanger/pathogens/embl/EnsemblCorbaEntry \
	diana/sequence/SequenceChangeEvent \
	diana/sequence/SequenceChangeListener \
	diana/sequence/AminoAcidSequence \
	diana/sequence/Bases \
	diana/sequence/BasePattern \
	diana/sequence/BasePatternFormatException \
	diana/sequence/Strand \
	diana/sequence/Marker \
	diana/sequence/MarkerChangeEvent \
	diana/sequence/MarkerChangeListener \
	diana/sequence/MarkerRange \
	diana/sequence/MarkerRangeVector \
	diana/sequence/NoSequenceException \
	diana/Selectable \
	diana/SelectionChangeEvent \
	diana/SelectionChangeListener \
	diana/SimpleGotoEventSource \
	diana/GotoEventSource \
	diana/GotoEvent \
	diana/GotoListener \
	diana/ChangeEvent \
	diana/ChangeListener \
	diana/FeatureSegment \
	diana/Feature \
	diana/FeatureVector \
	diana/FeatureChangeEvent \
	diana/FeatureChangeListener \
	diana/FeatureSegmentVector \
	diana/FeatureEnumeration \
	diana/FeaturePredicate \
	diana/FeatureKeyPredicate \
	diana/FeatureKeyQualifierPredicate \
	diana/FeatureFromVectorPredicate \
	diana/LastSegmentException \
	diana/Entry \
	diana/EntrySource \
	diana/EntrySourceVector \
	diana/EntryVector \
	diana/EntryGroup \
	diana/SimpleEntryGroup \
	diana/FilteredEntryGroup \
	diana/EntryChangeEvent \
	diana/EntryChangeListener \
	diana/EntryGroupChangeEvent \
	diana/EntryGroupChangeListener \
	diana/ExternalProgram \
	diana/ExternalApplication \
	diana/ExternalProgramVector \
	diana/ExternalSearchProgram \
	diana/ExternalProgramException \
	diana/Logger \
	diana/plot/Algorithm \
	diana/plot/BaseAlgorithm \
	diana/plot/FeatureAlgorithm \
	diana/plot/CoilFeatureAlgorithm \
	diana/plot/HydrophobicityAlgorithm \
	diana/plot/HydroAlgorithm \
	diana/plot/HydrophilicityAlgorithm \
	diana/plot/GCWindowAlgorithm \
	diana/plot/GCSDWindowAlgorithm \
	diana/plot/AGWindowAlgorithm \
	diana/plot/CodonWeight \
	diana/plot/CodonUsageWeight \
	diana/plot/CodonUsageFormatException \
	diana/plot/CodonUsageAlgorithm \
	diana/plot/GCFrameAlgorithm \
	diana/plot/GCDeviationAlgorithm \
	diana/plot/ATDeviationAlgorithm \
	diana/plot/Codon12CorrelationAlgorithm \
	diana/plot/UserDataAlgorithm \
	diana/components/ScoreChangeEvent \
	diana/components/ScoreChangeListener \
	diana/components/ScoreScrollbar \
	diana/components/ScoreChanger \
	diana/components/DisplayAdjustmentEvent \
	diana/components/DisplayAdjustmentListener \
	diana/components/FeatureInfo \
	diana/components/SequenceViewer \
	diana/components/FeatureBaseViewer \
	diana/components/FeatureAminoAcidViewer \
	diana/components/PlotMouseListener \
	diana/components/Plot \
	diana/components/ExternalProgramOptions \
	diana/components/ProcessWatcherListener \
	diana/components/ProcessWatcherEvent \
	diana/components/ProcessWatcher \
	diana/components/BasePlot \
	diana/components/TextDialog \
	diana/components/TextRequesterEvent \
	diana/components/TextRequesterListener \
	diana/components/TextRequester \
	diana/components/MarkerRangeRequesterEvent \
	diana/components/MarkerRangeRequesterListener \
	diana/components/MarkerRangeRequester \
	diana/components/EntryGroupInfoDisplay \
	diana/components/EntryGroupMenu \
	diana/components/SelectionInfoDisplay \
	diana/components/QualifierChoice \
	diana/components/KeyChoice \
	diana/components/KeyChooser \
	diana/components/YesNoDialog \
	diana/components/MessageDialog \
	diana/components/MessageFrame \
	diana/components/FileViewer \
	diana/components/LogViewer \
	diana/components/SearchResultViewer \
	diana/components/FeatureViewer \
	diana/components/FeatureEdit \
	diana/components/FeaturePlot \
	diana/components/FeaturePlotGroup \
	diana/components/SelectionViewer \
	diana/components/SelectionMenu \
	diana/components/EditMenu \
	diana/components/GotoMenu \
	diana/components/ViewMenu \
	diana/components/AddMenu \
	diana/components/RunMenu \
	diana/components/SelectMenu \
	diana/components/WriteMenu \
	diana/components/FeaturePopup \
	diana/components/EntryGroupPanel \
	diana/components/Navigator \
	diana/components/Selector \
	diana/components/EntryFileDialog \
	diana/components/DisplayComponent \
	diana/components/EntryActionListener \
	diana/components/FileDialogEntrySource \
	diana/components/CorbaEntrySource \
	diana/components/EMBLCorbaEntrySource \
	diana/components/WritableEMBLCorbaEntrySource \
	diana/components/EntryEdit \
	diana/components/EntryEditVector \
	diana/components/BasePlotGroup \
	diana/components/EntryHeaderEdit \
	diana/components/EntryGroupDisplay \
	diana/components/FeatureDisplayOwner \
	diana/components/FeatureDisplay \
	diana/components/FeatureList \
	diana/components/FeatureListFrame \
	diana/components/ListDialog \
	diana/components/Splash \
	diana/components/ArtemisMain \
	diana/Selection \
	diana/Options \
	AppGlobal \
	Diana

CLASSES := $(NAMES:%=%.class)
SOURCES := $(NAMES:%=%.java)

all: idl $(CLASSES)

copy_jacorb: 
	rm -f org/omg/CORBA/Policy.java
	rm -f org/omg/CORBA/PolicyOperations.java
	cp -f java_mapping/CORBA/ORB.java org/omg/CORBA/ORB.java
	cp -f java_mapping/CORBA/FixedHolder.java org/omg/CORBA/FixedHolder.java

topdown: idl
	$(REAL_CLASSPATH) $(JAVAC) -depend Diana.java

%.class : %.java
	$(REAL_CLASSPATH) $(JAVAC) $<

idl : type/*.java nsdb/*.java seqdb/*.java Ensembl/artemis/*.java

IDL = idl -Icorba

type/*.java : corba/types.idl
	$(IDL) corba/types.idl

nsdb/*.java : corba/nsdb.idl corba/nsdb_write.idl
	$(IDL) corba/nsdb.idl
	$(IDL) corba/nsdb_write.idl

seqdb/*.java : corba/seqdb.idl
	$(IDL) corba/seqdb.idl

Ensembl/artemis/*.java : corba/ensembl.idl
	$(IDL) corba/ensembl.idl

doc :
	$(REAL_CLASSPATH) javadoc -J-mx200m -package -version $(SOURCES)

manual :
	(cd docs; \
	jade -t sgml -d /usr/lib/dsssl/stylesheets/docbook/html/docbook.dsl manual.sgml)

jar : all powmap.jar

applet : artemis_applet.jar

artemis_applet.jar : $(CLASSES)
	rm -f artemis_applet.jar
	(find diana uk *.class -name '*.class' -print; \
	echo etc/options; echo etc/feature_keys; echo etc/qualifier_types; \
	echo META-INF/MANIFEST.MF; \
	echo diana/helix.gif; echo diana/sanger-centre.gif) | \
	zip -u9@ artemis_applet.jar

powmap.jar : $(CLASSES)
	rm -f powmap.jar
	(find * -name '*.class' -print; \
	echo etc/options; echo etc/feature_keys; echo etc/qualifier_types; \
	echo META-INF/MANIFEST.MF; \
	echo diana/helix.gif; echo diana/sanger-centre.gif) | \
	zip -u9@ powmap.jar

clean :
	-rm -rf *.html powmap.jar seqdb nsdb type Ensembl
	-rm -rf TAGS* *.o
	-find . -name '*.class' -print | xargs rm -f
