goeddek
goeddek

Reputation: 109

Doxygen ignores wellformed comments in makefile

I try to document my build system (at moment a bunch of make files and shell scripts) with doxygen. the only helpful tip I found is:

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

I used πάντα ῥεῖ answer to edit my 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

but my documentation produces this:

 //!
 //! @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
 //!

So it used the filter but didnt process the commentar. The doxygen documentation is sparse at this point, has anyone an idea what I do wrong?

Thank you,

Kai


After the help of Arthur I learned one additional thing (for interested people): instead of

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

I set

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

now it filters only *.mk files :-).

Hth,

Kai

Upvotes: 1

Views: 351

Answers (1)

Artur Kink
Artur Kink

Reputation: 528

Your file extension is still .mk which is not a supported extension.

As noted for FILE_PATTERNS and for INPUT_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.

So you need to add

EXTENSION_MAPPING = mk=c

Upvotes: 2

Related Questions