Debian Codegraph @

etc/doxygen.cook

raw
1 /*
2 * fstrcmp - fuzzy string compare library
3 * Copyright (C) 2009 Peter Miller
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 doxygen = [find_command doxygen];
20 if [doxygen] then
21 {
22 #if 0
23 integration-build-targets += web-site/doc-external/index.html;
24 all += web-site/doc-internal/index.html;
25 #endif
26 }
27
28 web-site/doc-internal/files =
29 [match_mask lib/%0%.h [source_files]]
30 ;
31
32 web-site/doc-external/files =
33 [sort
34 lib/fstrcmp.h
35 [collect c_incl -nc -ns -eia -nsri
36 [addprefix -I [search_list]]
37 [resolve lib/fstrcmp.h]
38 [addprefix -rlp\= [search_list]]
39 ]
40 ]
41 ;
42
43 /*
44 * The function below is used to remove not names not existing in the
45 * filesystem from a list of path. It is used to clean the
46 * INCLUDE_PATH path variable in doxygen.cfg since doxygen issue a
47 * warning for directory it's unable to find.
48 */
49 function remove_not_existing_paths =
50 {
51 result = ;
52 paths = arg;
53 loop
54 {
55 tmp_path = [head [paths]];
56 if [not [tmp_path]] then
57 loopstop;
58 if [exists [tmp_path]] then
59 result = [result] [tmp_path];
60 paths = [tail [paths]];
61 }
62
63 return [result];
64 }
65
66 web-site/%/index.html: [web-site/%/files] etc/doxygen.cfg
67 set shallow
68 {
69 rm -rf web-site/% doxygen-tmp;
70 cat [resolve etc/doxygen.cfg] - > Doxyfile;
71 data
72 # The OUTPUT_DIRECTORY tag is used to specify the (relative or
73 # absolute) base path where the generated documentation will be
74 # put. If a relative path is entered, it will be relative to the
75 # location where doxygen was started. If left blank the current
76 # directory will be used.
77 OUTPUT_DIRECTORY = doxygen-tmp
78
79 # documented source files. You may enter file names like "myfile.cpp"
80 # or directories like "/usr/src/myproject". Separate the files or
81 # directories with spaces.
82 INPUT = [unsplit " \\\n" [resolve [web-site/%/files]]]
83
84 # The PROJECT_NUMBER tag can be used to enter a project or revision
85 # number. This could be handy for archiving the generated
86 # documentation or if some version control system is used.
87 PROJECT_NUMBER = [version]
88
89 # The INCLUDE_PATH tag can be used to specify one or more directories that
90 # contain include files that are not input files but should be processed by
91 # the preprocessor.
92 INCLUDE_PATH = [remove_not_existing_paths
93 [unsplit " \\\n" [addprefix -I [search_list] ] ] ]
94
95 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
96 # can be used to strip a user defined part of the path. Stripping is
97 # only done if one of the specified strings matches the left-hand part of
98 # the path. It is allowed to use relative paths in the argument list.
99
100 STRIP_FROM_PATH = [addsuffix "/" [search_path] [split ":" [search_list]]]
101 dataend
102 [doxygen] Doxyfile -d web-site/% 2>&1 | tee doxygen.output.tmp
103 /*
104 * Have Cook tell us how long
105 * it takes to cook.
106 */
107 set meter
108 ;
109
110 /*
111 * Test file exists and has a size greater of zero, otherwise fail
112 * this build step. This is to cope with the fact that Doxygen
113 * exits with an exit status of zero even if it finds errors.
114 */
115 test ! -s doxygen.output.tmp;
116
117 rm -rf web-site/%;
118 mv doxygen-tmp/html web-site/%;
119 if [in % doc-internal] then
120 {
121 mkdir -p man/man3;
122 mv "doxygen-tmp/man/man3/*.3" man/man3/.
123 set errok;
124 }
125 rm -rf Doxyfile doxygen-tmp
126 set errok ;
127 }