# $Id: Makefile 169 2007-03-08 02:16:06Z yamada $

PERL=detCreateRawFalse detDump detDSFetch detFindFetchAndInsert \
	detDBInsert detRawToFits detDSStatusSet detDSSubmit \
	PS/MOPS/DET/Constants.pm PS/MOPS/DET/cgi.pm PS/MOPS/DET/dbclient.pm \
	PS/MOPS/DET/find.pm PS/MOPS/DET/htclient.pm PS/MOPS/DET/table.pm \
	PS/MOPS/DET/util.pm
PERLDOCDIR=perldoc
PERLINDEX=$(PERLDOCDIR)/index.html

.PHONY: clean tidy doc docs all

.SUFFIXES: .pl .html

all:

tidy:
	rm -f test*.fits

clean: tidy
	rm -f *.o *.tmp

doc docs:
	test -d $(PERLDOCDIR) || mkdir $(PERLDOCDIR)
	echo "<ul>" > $(PERLINDEX); \
	for file in $(PERL); do \
		echo "<li><a href=\"$$file.html\">$$file</a>" >> $(PERLINDEX); \
		pod2html $$file > $(PERLDOCDIR)/$$file.html; \
	done
	echo "</ul>" >> $(PERLINDEX); \
	rm -f pod*.tmp
