How to document makefile templates and include *.mk file interfaces?

旧时模样 提交于 2019-12-03 17:18:44

"Is there a simple way to achieve this using any valid doxygen syntax/configuration?"

Yes, you can use doxygen's INPUT_FILTER, FILE_PATTERNS and FILTER_SOURCE_FILES configuration settings as stolen from this blog post

Put these settings in your Doxyfile configuration

FILE_PATTERNS = *.mk 
INPUT_FILTER = "sed -e 's|##|//!|'" 
FILTER_SOURCE_FILES = YES 

The INPUT_FILTER actually does the trick, the sed command is used by doxygen to open a pipe filtering the input files along the specified command.

Note:
The above mentioned command isn't embedded into a shell, thus chained command statements like

"grep '##' | sed -e 's|##|//!|'"

won't work.


Put your comments as proposed in the sample ## will expand for comments seen by doxygen

## @file
## @brief doaction.mk is purposed to ...
## 
## Some more detailed descriptions about rules applied ...
## @param GENERIC_PARAM1-y Parameter1 description ...
## @param GENERIC_PARAM2-y Parameter2 description ...

Additionally you should put a

## @cond
...
## @endcond

around your makefile rules/templates code, to avoid doxygen parsing these parts.

The above sample should render as follows in the generated documentation HTML

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!