#
# Makefile for the Calendar Tool Java implementation.
#

# CSC 206 java lib directory
LIB206 =	/users/faculty/gfisher/classes/206/lib/JVM

# Directory for generated executable files
EXECUTABLES =	../../executables/JVM

# Files to compile
FILES = \
		caltool/*.java \
		caltool/admin/*.java \
		caltool/admin_ui/*.java \
		caltool/caldb/*.java \
		caltool/caltool_ui/*.java \
		caltool/edit/*.java \
		caltool/edit_ui/*.java \
		caltool/file/*.java \
		caltool/file_ui/*.java \
		caltool/help/*.java \
		caltool/help_ui/*.java \
		caltool/options/*.java \
		caltool/options_ui/*.java \
		caltool/schedule/*.java \
		caltool/schedule_ui/*.java \
		caltool/view/*.java \
		caltool/view_ui/*.java


# List of packages
PACKAGES = \
		caltool \
		caltool/admin \
		caltool/admin_ui \
		caltool/caldb \
		caltool/caltool_ui \
		caltool/edit \
		caltool/edit_ui \
		caltool/file \
		caltool/file_ui \
		caltool/help \
		caltool/help_ui \
		caltool/options \
		caltool/options_ui \
		caltool/schedule \
		caltool/schedule_ui \
		caltool/view \
		caltool/view_ui

# Run the Java compiler on all of the files.
all:	$(FILES)
#	echo $(FILES)
	javac -g \
	  -classpath $(LIB206) \
	  -d $(EXECUTABLES) \
		$(FILES)
	cd $(EXECUTABLES); make -f Makefile-waldorf exec

# The preceding rule results in an executable program that is invoked as
# follows from the implementation/executables/JVM directory:
#
#     java caltool.Main
#
# The makefile in that dir has more information about altenate forms of java
# program invocation.


# Generate a source dir command for emacs jdb debugging.
emacs-jdb:
	csh -q -c ".make-emacs-jdb-dirs $(PACKAGES)"

# Run the Java compiler on all of the files, putting the class files in this
# source dir, where bluej wants them.
bluej:	$(FILES)
#	echo $(FILES)
	javac -g \
	  -classpath $(LIB206) \
	  -d . \
		$(FILES)
	cd $(EXECUTABLES); make -f Makefile-waldorf exec

# Print source files in small-font, line-numbered, two-column format.
print:
	csh -q -c ".make-print $(PACKAGES)"


# Echo the package names for use in command-line processing of all packages,
# such as copying a uniform .cvsignore file into each package dir.
echop:
	@echo $(PACKAGES)


# Remove all .class files from the executables/JVM dir.
clean:
	csh -q -c ".make-clean"

# Remove all .class files from this dir.
cleanbluej:
	csh -q -c ".make-clean-bluej"