blob: 35f8220526a4c3322f6150f46e920d7af1fb92db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
These utilities help clean up #include file usage. They should be run
in this order so that the include files have the proper includes before
the C files are tested.
pgfixinclude change #include's to <> or ""
pgcompinclude [-v]
report which #include files can not compile on their own
pgrminclude [-v]
remove extra #include's
pgcheckdefines
check for #ifdef tests on symbols defined in files that
weren't included --- this is a necessary sanity check on
pgrminclude
pgdefine create macro calls for all defines in the file (used by
the above routines)
It is also a good idea to sort the pg-specific include files in
alphabetic order. This is best done with a text editor. Typical usage
order would be:
pgfixinclude
sort include references
run multiple times:
pgcompinclude
pgrminclude /src/include
pgrminclude /
pgcheckdefines
There is a complexity when modifying /src/include. If include file 1
includes file 2, and file 2 includes file 3, then when file 1 is
processed, it needs only file 2, not file 3. However, if later, include
file 2 is processed, and file 3 is not needed by file 2 and is removed,
file 1 might then need to include file 3. For this reason, the
pgcompinclude and pgrminclude /src/include steps must be run several
times until all includes compile cleanly.
|