# $Id: Makefile,v 1.17 2002/08/07 09:54:49 tep Exp $
JC = javac
DEFS =
JFLAGS =
SRC =
TARGETS = ${SRC:.java=.class}
JDKDOCDIR = /usr/local/jdk1.2.2/docs/api
JDOCFLAGS = -link file:$(JDKDOCDIR) -private -version -author
JDOCDIR = ./docs
JDOCFLAGS2 = -link file:$(JDKDOCDIR) -protected -version -author
JDOCDIR2 = ./docs2
JDOCPACKAGES = database sexp spki spki.interfaces spki.demo
PACKAGES = database sexp spki
.SUFFIXES : .java .class

all:
	make tag
	make doc

tag:
	ctags -R --links=no

jar:
	cd sexp ; make
	cd database ; make
	cd spki ; make
	jar cf spki.jar spki/*.class spki/interfaces/*.class
	jar cf spki-demo.jar spki/demo/*.class
	jar cf database.jar database/*.class
	jar cf sexp.jar sexp/*.class

archive:
	make clean
	make doc
	tar czf spki-src-`date +%Y%m%d`.tar.gz spki
	tar czf sexp-src-`date +%Y%m%d`.tar.gz sexp
	tar czf database-src-`date +%Y%m%d`.tar.gz database
	tar czf api-docs-`date +%Y%m%d`.tar.gz $(JDOCDIR)

doc:
	rm -rf $(JDOCDIR)
	mkdir $(JDOCDIR)
	javadoc -d $(JDOCDIR) $(JDOCFLAGS) $(JDOCPACKAGES)
#	rm -rf $(JDOCDIR2)
#	mkdir $(JDOCDIR2)
#	javadoc -d $(JDOCDIR2) $(JDOCFLAGS2) $(JDOCPACKAGES)

.java.class:
	$(JC) $(JFLAGS) $<

clean:
	rm -rf $(JDOCDIR)
	rm -rf $(JDOCDIR2)
	rm -f $(TARGETS) *.class *~ tags
	cd database ; make clean
	cd sexp ; make clean
	cd spki ; make clean
