2016-11-23 49 views
1

我嘗試使用doxygen記錄我的構建系統(當時是一堆make文件和shell腳本)。唯一有用的提示,我發現是:Doxygen忽略makefile中的格式化註釋

Can doxygen be used to document makefile templates and include *.mk file interfaces?

我以前πάντα ῥεῖ答案編輯我的Doxyfile:

FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.h *.hpp *.h++ *.md *.markdown *.mk 
INPUT_FILTER = "sed -e 's|##|//!|'" 
FILTER_PATTERNS = 
FILTER_SOURCE_FILES = YES 

但我的文檔會產生這樣的:

//! 
//! @file environment.mk 
//! @brief Environment variables and definitions for the build system 
//! 
//! Insert detailed descritpion here 
//! 
//! @date 23.11.2016 
//! @author @kgoedde 
//! 

//! 
//! @cond 
//! 
# always the project directory 
export top   = $(abspath $(shell pwd)) 
export project_name = $(notdir $(shell pwd)) 


# Setting compiler and linker 
CXX = clang++ 
LD = clang++ 
AR = ar 

CXXFLAGS = -O0 -g3 -Wall -c -fmessage-length=0 -fPIC -std=c++14 -pthread 
TCXXFLAGS = -Wall -c -fmessage-length=0 -fPIC -std=c++14 -pthread 

LDFLAGS = -pthread 
TLDFLAGS = -pthread 

ARFLAGS = -rs 

# Standard include paths 
INCDIRS  = ${top}/include/thirdparty ${top}/include/main 
TINCDIRS = ${INCDIRS} ${top}/include/test 

# Stadard library paths 
LIBDIRS = /usr/lib64 
//! 
//! @endcond 
//! 

所以它使用了過濾但沒有處理註釋。 doxygen文檔在這一點上是稀少的,有沒有人知道我做錯了什麼?

謝謝


Arthur的幫助下,我學會了一個額外的東西(有興趣的人)後:不是

INPUT_FILTER = "sed -e 's|##|//!|'" 

我設置

FILTER_PATTERNS = *.mk="sed -e 's|##|//!|'" 

現在它只過濾* .mk文件:-)。

H個,

回答

1

您的文件擴展名仍舊是.mk這是不支持擴展。

至於FILE_PATTERNSINPUT_FILTER指出:

# Note that for custom extensions or not directly supported extensions you also 
# need to set EXTENSION_MAPPING for the extension otherwise the files are not 
# read by doxygen. 

所以你需要添加

EXTENSION_MAPPING = mk=c 
+0

它工作:-)謝謝! – goeddek