#
# Copyright  1990-2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version
# 2 only, as published by the Free Software Foundation. 
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 for more details (a copy is
# included at /legal/license.txt). 
# 
# You should have received a copy of the GNU General Public License
# version 2 along with this work; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA 
# 
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 or visit www.sun.com if you need additional
# information or have any questions. 
#
######################################################################
#
# Makefile for javadoc-generated documentation. To be included into
# the top level makefile.
#
######################################################################

DOC_OUTPUT_DIR       = $(JAVACALL_OUTPUT_DIR)doc
DOXYGEN_CONFIG_DIR = $(JAVACALL_DIR)/build/docs


PROJECT_NAME = "phoneME Feature project"
PROJECT_VERSION = 1.0
# Variables used for building doxygen documentation
#
DOXYGEN_DIR = $(DOC_OUTPUT_DIR)/doxygen

# The default location of doxygen binary
# Note: User should change this (or overwrite
# in command line mode) in order to use it.
#
DOXYGEN_CMD = /usr/bin/doxygen

DOXYGEN_CFG = $(DOXYGEN_CONFIG_DIR)/doxygen.conf
DOXYGEN_CONFIG_FILE = $(DOXYGEN_DIR)/doxygen.conf

# Include share/inc/*.h and include/*.h files
# in doxygen target. (Note this may over generate
# for porting interface documentation.)
#
DOXYGEN_INPUT_LIST = $(JAVACALL_OUTPUT_INCLUDE_DIR)

#DOXYGEN_EXCLUDE_LIST +=
#    $(SUBSYSTEM_DIR)/ams/common/native/share/inc/fileInstallerInternal.h

# Makes sure to tell users to use their copy of doxygen
#
VERIFY_DOXYGEN_CMD:
	@if [ ! -f "$(DOXYGEN_CMD)" ]; then \
	   echo "ERROR: Please set DOXYGEN_CMD to point to your doxygen executable"; \
	   /bin/false; \
	fi;

# Style sheets and other configuration templates
#
DOXYGEN_SUPPORT_LIST += \
    $(DOXYGEN_DIR)/doxygen_style.css

PROJECT_DOXYGEN_SUPPORT_LIST += \
    $(DOXYGEN_DIR)/doxygen_header.txt \
    $(DOXYGEN_DIR)/doxygen_footer.txt

$(DOXYGEN_SUPPORT_LIST): $(DOXYGEN_DIR)/%: $(DOXYGEN_CONFIG_DIR)/%
	@(cp $< $@) $(LOG)

$(PROJECT_DOXYGEN_SUPPORT_LIST): $(DOXYGEN_DIR)/%: $(DOXYGEN_CONFIG_DIR)/%
	@(cp $< $@) $(LOG)

$(DOXYGEN_CONFIG_FILE): $(DOXYGEN_DIR) $(DOXYGEN_CFG)
	-@(sed -e 'sz<OUTPUT_DIR>z$(DOXYGEN_DIR)z' \
	    -e 's;<INPUT_LIST>;$(DOXYGEN_INPUT_LIST);' \
	    -e 'sz<EXCLUDE_LIST>z$(DOXYGEN_EXCLUDE_LIST)z' \
	    -e 'sz<DOXYGEN_DIR>z$(DOXYGEN_DIR)z' \
	    -e 'sz<PROJECT_NAME>z$(PROJECT_NAME)z' \
	    -e 'sz<PROJECT_VERSION>z$(PROJECT_VERSION)z' \
	< $(DOXYGEN_CFG) > $@) $(LOG)

docs_doxy: VERIFY_DOXYGEN_CMD $(DOC_OUTPUT_DIR) $(DOXYGEN_DIR) $(DOXYGEN_CONFIG_FILE) $(DOXYGEN_SUPPORT_LIST) $(PROJECT_DOXYGEN_SUPPORT_LIST)
	$(A)echo +++ $(DOXYGEN_CMD) $(DOXYGEN_CONFIG_FILE) $(LOG_ONLY)
	-@($(DOXYGEN_CMD) $(DOXYGEN_CONFIG_FILE)) $(LOG)

docs_html: verify docs_doxy # docs_javadoc is disabled

docs_all: docs_html

$(DOC_OUTPUT_DIR) $(DOXYGEN_DIR):
	-@(mkdir -p $@) $(LOG)

# Avoid accidents
#
.PHONY: docs_all docs_html docs_doxy

