SHELL=bash

CLASSPATH= -classpath .

# Java compilation options. Change -g to -O, or vice versa, to switch between
# debug and optimized versions.
JAVA_OPTS=-g $(CLASSPATH)

# The next two rules define the default rules for compiling Java files.
.SUFFIXES: .class .java

.java.class:
	javac $(JAVA_OPTS) $<

# Default target.
all:	palmutils_package tools copy

# Scrub the directory tree. Use this if you want to do a complete rebuild.
clean:	
	rm -f *~ *.pdb
	rm -f *.jar
	rm -f *.class
	cd palmutils; make clean

copy:   ../docs/Messier.pdb ../docs/Caldwell.pdb \
	../docs/Northernstars.pdb ../docs/Southernstars.pdb

../docs/Messier.pdb: Messier.txt
	java $(CLASSPATH) WritePDB Messier.txt $@

../docs/Caldwell.pdb: Caldwell.txt
	java $(CLASSPATH) WritePDB Caldwell.txt $@

../docs/Northernstars.pdb: Northernstars.txt
	java $(CLASSPATH) WritePDB -s Northernstars.txt $@

../docs/Southernstars.pdb: Southernstars.txt
	java $(CLASSPATH) WritePDB -s Southernstars.txt $@

palmutils_package: 
	cd palmutils; make

tools:	DumpPDB.class WritePDB.class AstroRecord.class ParseCatalog.class
