blob: 0ef21da5e733732a4e2e16b77ddb89ac55a41ae5 [file] [log] [blame]
###############################################################################
#
# <:copyright-BRCM:2016:proprietary:standard
#
# Broadcom Ltd. Proprietary and Confidential.(c) 2016 Broadcom Ltd.
# All Rights Reserved
#
# This program is the proprietary software of Broadcom Ltd. and/or its
# licensors, and may only be used, duplicated, modified or distributed pursuant
# to the terms and conditions of a separate, written license agreement executed
# between you and Broadcom Ltd. (an "Authorized License"). Except as set forth in
# an Authorized License, Broadcom Ltd. grants no license (express or implied), right
# to use, or waiver of any kind with respect to the Software, and Broadcom Ltd.
# expressly reserves all rights in and to the Software and all intellectual
# property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE
# NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY
# BROADCOM LTD AND DISCONTINUE ALL USE OF THE SOFTWARE.
#
# Except as expressly set forth in the Authorized License,
#
# 1. This program, including its structure, sequence and organization,
# constitutes the valuable trade secrets of Broadcom Ltd., and you shall use
# all reasonable efforts to protect the confidentiality thereof, and to
# use this information only in connection with your use of Broadcom Ltd.
# integrated circuit products.
#
# 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
# AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
# WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
# RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND
# ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT,
# FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR
# COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE
# TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF USE OR
# PERFORMANCE OF THE SOFTWARE.
#
# 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR
# ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL,
# INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY
# WAY RELATING TO YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN
# IF BROADCOM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES;
# OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
# SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE LIMITATIONS
# SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY
# LIMITED REMEDY.
# :>
#
###############################################################################
#
# Makefile for building doxygen for bal source code
#
###############################################################################
PROJECT_NUMBER=$(shell ./genProjectNumber.sh)
TMP_FILE=cfg.tmp
OUTPUT_FILE=doxygen_output.txt
WARNINGS_FILE=doxygen_warnings.txt
GEN_GRAPHS ?= NO
.PHONY: docs
docs:
@if [ "$(GEN_GRAPHS)" != "YES" ]; then \
echo "#####################################################################" ; \
echo "# Graphs will NOT be generated #" ; \
echo "# Type 'make GEN_GRAPHS=YES' to instruct doxygen to generate graphs #" ; \
echo "#####################################################################" ; \
sleep 3 ; \
fi
$(call gen_doc_cmd,$(OUT_DOCS_DIR)/bal_internal,bal.doxy)
$(call gen_doc_cmd,$(OUT_DOCS_DIR)/bal_public,bal_public.doxy)
$(call gen_doc_cmd,$(OUT_DOCS_DIR)/sdn_pal,sdn_pal.doxy)
$(call gen_doc_cmd,$(OUT_DOCS_DIR)/omcisvc,omcisvc.doxy)
define gen_doc_cmd
rm -fr $1
mkdir -p $1
sed -e 's@%OUT_DOCS_DIR@$1@g' \
-e 's@%SRC_DIR@$(TOP_SRC_DIR)@g' \
-e 's@%PROJECT_NUMBER@$(PROJECT_NUMBER)@g' \
-e 's@%HAVE_DOT@$(GEN_GRAPHS)@g' \
-e 's@%MODEL_DIR@$(OUT_DIR_BASE)/src/common/include@g' \
-e 's@%OMCI_MODEL_DIR@$(OUT_DIR_BASE)/src/lib/libomcisvc@g' \
$2 > $1/Doxyfile
rm -fr $1/$(OUTPUT_FILE) $1/$(WARNINGS_FILE)
cd $1 && doxygen 2>$1/$(WARNINGS_FILE) | tee $1/$(OUTPUT_FILE)
@echo ""
@echo "############################################"
@echo "# Checking doxygen output for warnings... #"
@echo "############################################"
@cat $1/$(WARNINGS_FILE)
@test -s $1/$(WARNINGS_FILE) && echo -ne "\n!!! WARNINGS WERE FOUND!!!\n\nPlease see warnings listed above and check $1/$(WARNINGS_FILE) for more information\n\n" && exit -1 || echo "Done."
rm -fr $1/$(OUTPUT_FILE) $1/$(WARNINGS_FILE) $1/Doxyfile
endef