# $Id: Makefile.in 15004 2007-08-21 16:24:27Z bangerth $
# $Name$
#
# Copyright (c) the deal.II authors 2003

###############################
# Configured variables

D     = /build/buildd/deal.ii-6.2.1
include $D/common/Make.global_options



html: deal.tag

private:
	perl -pi -e 's/(EXTRACT_PRIVATE\s*=\s*)NO/$$1YES/;s/(INTERNAL_DOCS\s*=\s*)NO/$$1YES/;' options.dox
	$(MAKE) html

# generate documentation. write the output to a file so as not to hide the
# important message to impatient observers that this process can take quite
# a while
deal.II deal.tag: tutorial \
          deal.dox \
	  $D/base/include/*/*.h \
	  $D/lac/include/*/*.h \
	  $D/deal.II/include/*/*.h \
	  headers/*.h \
	  $(addprefix tutorial/doxygen/, $(shell ls tutorial/doxygen/))
	@echo "=== Generating reference documentation. " \
              "This can take several minutes..."
	cat options.dox deal.dox | /usr/bin/doxygen - > doxygen.log
	@cp deal.css deal.II


tutorial:
	@cd tutorial ; $(MAKE)



# validate cross references. there are so many html files in these
# directories that we can just call
#    $(PERL) $D/common/scripts/validate-xrefs.pl deal.II/*.html
# as this leads to error messages of the kind "/usr/bin/perl: Argument 
# list too long". Instead, use a loop over all html files
validate-xrefs:
	@echo --- Validating xrefs in doxygen/deal.II/ ---
	@cd deal.II ; \
		for i in *.html ; do \
			$(PERL) $D/common/scripts/validate-xrefs.pl $$i ; \
		done

# we have so many files that we can't just do "rm deal.II/*" because that
# leads to overlong command lines. gotta split it up
clean:
	-for i in deal.II/* ; do rm $$i ; done
	-rm *.tag
	@cd tutorial ; $(MAKE) clean


.PHONY: html tutorial private deal.II \
	validate-xrefs clean tutorial
