Commit cd41e881 authored by Michal Policht's avatar Michal Policht

Improve documentation generations scripts.

parent 6b18463d
......@@ -53,7 +53,7 @@ DOXYGEN_INPUT_DIRS = Doxyfile extensions tools external/recipes
DOXYGEN_OUTPUT_DIRS = doc/Doxygen/docs
DOC_PROJECT_TARGETS = $(DOC_EXTENSIONS_LIST_FILE) $(DOC_TOOLS_LIST_FILE) \
doc_project_doxyqml
doc_extensions_dirs doc_project_doxyqml
# Directory for autogenerated files.
MAKEFILE_PROJECT_AUTOGEN_DIR = $(PROJECT_DIR)/doc/_temp/Makefile.project
......@@ -70,6 +70,9 @@ DOXYQML_PY = $(MAKEFILE_PROJECT_AUTOGEN_DIR)/doxyqml.py
# Product entry print script.
DOCPRODENTRY = awkgward/docprodentry.sh
# Relative product directory script.
RELPRODDIR = awkgward/relproddir.sh
INCLUDE_GUARDS_EXCLUDE = ! -path 'extensions/templates_*'
# Add directory with doxyqml wrapper to the PATH, so that it can be seen by Doxygen.
......@@ -79,7 +82,7 @@ PATH := $(PATH):$(MAKEFILE_PROJECT_AUTOGEN_DIR)
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))Makefile.toolchain
.PHONY: doc_project_doxyqml
.PHONY: doc_project_doxyqml doc_extensions_dirs
$(DOC_TOOLS_LIST_FILE): tools $(MAKEFILE_PROJECT_AUTOGEN_DIR) $(DOCPRODENTRY) | $(SH) $(FIND) $(XARGS) $(SORT) $(BASENAME) $(DIRNAME) $(ECHO)
@$(ECHO) Generating "$@" file...
......@@ -88,13 +91,19 @@ $(DOC_TOOLS_LIST_FILE): tools $(MAKEFILE_PROJECT_AUTOGEN_DIR) $(DOCPRODENTRY) |
| $(SORT) | $(XARGS) -I {} $(SH) $(DOCPRODENTRY) {} >> $@
@$(ECHO) '.' >> $@
$(DOC_EXTENSIONS_LIST_FILE): extensions $(MAKEFILE_PROJECT_AUTOGEN_DIR) $(DOCPRODENTRY) | $(SH) $(FIND) $(XARGS) $(SORT) $(BASENAME) $(DIRNAME) $(ECHO)
$(DOC_EXTENSIONS_LIST_FILE): extensions $(MAKEFILE_PROJECT_AUTOGEN_DIR) $(DOCPRODENTRY) | $(SH) $(FIND) $(XARGS) $(SORT) $(SED) $(DIRNAME) $(ECHO)
@$(ECHO) Generating "$@" file...
@$(ECHO) '<!-- This file has been autogenerated by Makefile.project. -->' > $@
@$(FIND) extensions \( -name 'Doxyfile' -o -name '*.Doxyfile' \) \
| $(SORT) | $(XARGS) -I {} $(SH) $(DOCPRODENTRY) {} >> $@
@$(ECHO) '.' >> $@
# This is required, because Doxygen can not create **multiple** (e.g. CuteHMI/Test.0) output directores on its own.
doc_extensions_dirs: | $(RELPRODDIR) $(SH) $(FIND) $(XARGS) $(BASENAME) $(DIRNAME) $(ECHO) $(MKDIR)
@$(ECHO) Creating documentation output directories...
@$(FIND) extensions \( -name 'Doxyfile' -o -name '*.Doxyfile' \) \
| $(XARGS) -I {} $(SH) $(RELPRODDIR) {} | $(XARGS) -I {} $(MKDIR) -p $(DOXYGEN_OUTPUT_DIRS)/{}
$(DOXYQML_PY): $(DOXYQML) $(PYTHON) | $(ECHO)
@$(ECHO) Generating doxyqml wrapper "$@"...
@$(ECHO) "# This file has been autogenerated by Makefile.project." > $@
......
......@@ -13,7 +13,7 @@
# parameters:
# doxygen_file - a Doxygen file.
#
# required tools: sh, dirname, basename, echo.
# required tools: sh, dirname, echo, sed.
usage()
......@@ -35,6 +35,7 @@ if [ $# -lt 1 ]; then
fi
dir=$(dirname $doxygen_file)
basedir=$(basename $dir)
echo - \<a href=\"$basedir/index.html\"\>$basedir\<\/a\>
productdir=${dir#*/}
prodname=$(echo "$productdir" | sed 's|/|\.|g' | sed 's|\(.*\)\.|\1 |')
echo - \<a href=\"$productdir/index.html\"\>$prodname\<\/a\>
#!/bin/sh
#
# Copyright (c) 2018, Michal Policht. This file is dually licensed under terms of
# either WTFPL or BEER-WARE LICENSE. You may obtain the copy of WTFPL or BEER-WARE
# LICENSE by googling it. NO WARRANTY. YOU WILL PAY ALL COSTS FOR ANY REPAIRS.
#
# For a given Doxygen file path, prints product directory relative to the
# directory containing a class of products (such as extensions or tools).
#
# usage: relproddir.sh product_file
# example: relproddir.sh extensions/CuteHMI/Test.0/cutehmi.doxygen.Doxyfile
#
# parameters:
# product_file - file path.
#
# required tools: sh, dirname, echo.
usage()
{
echo "usage: $0 product_file"
}
product_file=$1
if [ ! -e $product_file ]; then
echo $product_file "does not exist"
exit 1
fi
if [ $# -lt 1 ]; then
echo "error: too few arguments"
usage
exit 0
fi
dir=$(dirname $product_file)
productdir=${dir#*/}
echo $productdir
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment