# GNUmakefile
#
#      Makefile for docs directory of Veil
#
#      Copyright (c) 2005, 2006 Marc Munro
#      Author:  Marc Munro
#      License: BSD
#
# $Id: GNUmakefile,v 1.2 2006/10/04 15:50:09 bloodnok Exp $
#
# Do not attempt to use this makefile directly: its targets are available
# and should be built from the main GNUmakefile in the parent directory.
# 

.PHONY: docs_all docs_clean docs

DOCS_DIR = docs
DOCS_GARBAGE = $(garbage:%=$(DOCS_DIR)/%)

# If configure decided that docs are not to be built, the install and all 
# targets will not build docs.  The specific docs target however, will still
# attempt to build all documentation.

ifeq ($(BUILD_DOCS), yes)
docs_all: docs
else
docs_all:
endif

ifeq ($(INSTALL_DOCS), yes)
docs_install: install_docs
else
docs_install:
endif

docs:	docs/html

docs/html: $(SRC_SOURCES) $(SRC_HEADERS)
	$(DOXYGEN) $(DOCS_DIR)/Doxyfile
	@rm -f NO   # Don't know why this file is generated but it can go.

install_docs: docs
	@echo Installing docs in $(pgdocdir)...
	@find $(DOCS_DIR)/html -type f | \
	xargs -i $(INSTALL_SCRIPT) {} $(pgdocdir)

# Clean this directory and ensure generated docs are removed
docs_clean:
	@echo Cleaning docs...
	@rm -f $(DOCS_GARBAGE) NO
	@rm -rf $(DOCS_DIR)/html/

docs_distclean: docs_clean
	@rm -f Doxyfile