Changes between Version 1 and Version 2 of Developer/Coding/Doxygen
- Timestamp:
- 05/08/08 12:46:53 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Developer/Coding/Doxygen
v1 v2 2 2 3 3 4 RTEMS is much older than [http://www.doxygen.org Doxygen] and the documentation in the .h and .inl files was obviously not written with [http://www.stack.nl/~dimitri/doxygen/manual.html Doxygen markup]. In 2007, [wiki:TBR/User/JoelSherrill JoelSherrill] undertook converting the documentation in the .h and .inl files in the RTEMS SuperCore to Doxygen format. As a result of this effort, the Doxygen for the CVS version of the RTEMS SuperCore is now built automatically multiple times per day and made available on the RTEMS Website. In April 2008, [wiki:TBR/User/JoelSherrill JoelSherrill] began to update the Classic API (e.g. cpukit/rtems) .h and .inl files to include [http://www.stack.nl/~dimitri/doxygen/manual.html Doxygen markup]. 4 RTEMS is much older than [http://www.doxygen.org Doxygen] and the documentation in the .h and .inl files was obviously not written with [http://www.stack.nl/~dimitri/doxygen/manual.html Doxygen markup]. In 2007, [wiki:TBR/User/JoelSherrill JoelSherrill] undertook converting the documentation in the .h and .inl files in the RTEMS SuperCore to Doxygen format. As a result of this effort, the Doxygen for the CVS version of the RTEMS SuperCore is now built automatically multiple times per day and made available on the RTEMS Website. In April 2008, [wiki:TBR/User/JoelSherrill JoelSherrill] began to update the Classic API (e.g. cpukit/rtems) .h and .inl files to include [http://www.stack.nl/~dimitri/doxygen/manual.html Doxygen markup]. 5 = Files = 5 6 6 This page is currently just a place holder but should include RTEMS Project recommendations on writing Doxygen so we all have consistent results. 7 You can document a file with the ''@file [filename]'' directive. If you omit the filename Doxygen will use it for the documentation of the file containing this directive. This is the preferred way to document files which can be read by Doxygen. You should not use ''@file name_of_current_file'' to document the current file because this instructs Doxygen to document a file with the filename ''name_of_current_file'' and this is not necessarily the current one and may lead to ambiguity if someone from outside reuses your stuff to generate her documentation. Within one Doxygen run all files are unique and specified by the current Doxyfile. You can define how the generated output of path and filenames looks like in the Doxyfile via the 8 FULL_PATH_NAMES, STRIP_FROM_PATH and STRIP_FROM_INC_PATH options. 9 = Header Files = 7 10 8 This is an area in which volunteer activity is highly appreciated. 11 It is a RTEMS build feature that header files need to be installed in order to be useful. One workaround to generate documentation which allows automatic link generation is to use the installed header files as documentation input. Assume that we have the RTEMS sources in the ''rtems'' directory and the build of our BSP in ''build/powerpc-rtems4.9/mybsp'' relative to a common top level directory. Then you can configure Doxygen like: 9 12 10 TBD 13 {{{ 14 INPUT = rtems/c/src/lib/libbsp/powerpc/mybsp \ 15 rtems/c/src/lib/libcpu/powerpc/mycpu \ 16 rtems/make/custom/mybsp.cfg \ 17 build/powerpc-rtems4.9/mybsp/lib/include/myincludes 18 19 RECURSIVE = YES 20 21 EXCLUDE = rtems/c/src/lib/libbsp/powerpc/mybsp/include \ 22 rtems/c/src/lib/libcpu/powerpc/mycpu/include 23 24 FULL_PATH_NAMES = YES 25 26 STRIP_FROM_PATH = build/powerpc-rtems4.9/mybsp/lib/include \ 27 rtems 28 }}} 29 = Script and Assembly Files = 30 31 Doxygen cannot cope with script (= files with #-like comments) or assembly files. But you can add filter programs for them (TODO: Add source code for filter programs somewhere): 32 {{{ 33 FILTER_PATTERNS = *.S=c-comments-only \ 34 *.s=c-comments-only \ 35 *.cfg=script-comments-only \ 36 *.am=script-comments-only \ 37 *.ac=script-comments-only 38 }}} 39 = Assembly Example = 40 41 {{{ 42 /** 43 * @fn void mpc55xx_fmpll_reset_config() 44 * 45 * @brief Configure FMPLL after reset. 46 * 47 * Sets the system clock from 12 MHz in two steps up to 128 MHz. 48 */ 49 GLOBAL_FUNCTION mpc55xx_fmpll_reset_config 50 /* Save link register */ 51 mflr r3 52 53 LA r4, FMPLL_SYNCR 54 }}} 55 You have to put a declaration of this function somewhere in a header file. 56 = Script Example = 57 58 {{{ 59 ## 60 # 61 # @file 62 # 63 # @ingroup mpc55xx_config 64 # 65 # @brief Configure script of LibBSP for the MPC55xx evaluation boards. 66 # 67 68 AC_PREREQ(2.60) 69 AC_INIT([rtems-c-src-lib-libbsp-powerpc-mpc55xxevb],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) 70 }}} 71 = Functions = 72 73 For documentation of function arguments there are basically to ways: The first one uses @param: 74 {{{ 75 /** 76 * Copies bytes from a source memory area to a destination memory area, 77 * where both areas may not overlap. 78 * @param[out] dest The memory area to copy to. 79 * @param[in] src The memory area to copy from. 80 * @param[in] n The number of bytes to copy. 81 */ 82 }}} 83 84 This leads likely to copy&paste within the comment, bloats simple function comments and is not very fluent to read. 85 86 One alternative is this: 87 {{{ 88 /** 89 * Copies @a n bytes from a source memory area @a src to a destination memory 90 * area @a dest, where both areas may not overlap. 91 */ 92 }}} 93 94 The @a indicates that the next word is a function argument and deserves some kind of high-lightning. 95 = GCC Attributes = 96 97 The Doxygen C/C++ parser cannot cope with the GCC __attribute__((something)) stuff. But you can discard such features with pre-defined preprocessor macros: 98 {{{ 99 ENABLE_PREPROCESSING = YES 100 MACRO_EXPANSION = YES 101 EXPAND_ONLY_PREDEF = YES 102 PREDEFINED = __attribute__(x)= 103 104 }}} 105 = JAVADOC_AUTOBRIEF and QT_AUTOBRIEF = 106 107 We should agree on either NO or YES for both.