Lines Matching full:guard

1 # $NetBSD: directive-include-guard.mk,v 1.19 2025/04/11 17:21:31 rillig Exp $
5 # A file that is guarded by a multiple-inclusion guard has one of the
14 # .if !target(guard-target)
17 # When such a file is included for the second or later time, and the guard
18 # variable or the guard target is defined, the file is skipped completely, as
23 # https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
30 # This is the canonical form of a variable-based multiple-inclusion guard.
39 # A file that reuses a guard from a previous file (or whose guard is defined
50 # The guard variable cannot be a number, as numbers are interpreted
60 # The guard variable cannot be a number, as numbers are interpreted
69 # Comments and empty lines do not affect the multiple-inclusion guard.
93 # A file that reuses a guard from a previous file (or whose guard is defined
114 # If the guard variable is enclosed in spaces, it does not have an effect, as
124 # If the guard variable condition is enclosed in parentheses, it does not have
134 # A conditional other than '.if' or '.ifndef' does not guard the file, even if
153 # If the guard variable condition is enclosed in parentheses, it does not have
165 # condition, but this case is so uncommon that the guard mechanism doesn't
166 # accept '!' in the guard variable name. Furthermore, when defining the
179 # on the left side of a variable assignment. For guard variable names, the
192 # choice a bad idea, therefore these characters are not allowed in guard
202 # The guard condition must consist of only the guard variable, nothing else.
212 # The guard condition must consist of only the guard variable, nothing else.
222 # The variable name in an '.ifndef' guard must be given directly, it must not
232 # The variable name in an '.if' guard must be given directly, it must not
242 # The variable name in the guard condition must only contain alphanumeric
243 # characters and underscores. The place where the guard variable is defined
254 # The time at which the guard variable is defined doesn't matter, as long as
265 # The time at which the guard variable is defined doesn't matter, as long as
279 # If the guard variable is defined before the file is included for the first
293 # If the guard variable is defined before the file is included the first time,
294 # the file is processed but its content is skipped. If that same guard
308 # several, as each of these conditionals would require its separate guard.
322 # When multiple files use the same guard variable name, the optimization of
325 # Choosing unique guard names is the responsibility of the makefile authors.
326 # A typical pattern of guard variable names is '${PROJECT}_${DIR}_${FILE}_MK'.
327 # System-provided files typically start the guard names with '_'.
345 # If the guard variable is undefined between the first and the second time the
357 # If the guard variable is undefined while the file is included the first
358 # time, the guard does not have an effect, and the file is included again.
368 # If the file does not define the guard variable, the guard does not have an
441 # The guard can also be a target instead of a variable. Using a target as a
442 # guard has the benefit that a target cannot be undefined once it is defined.
469 # and once for determining the guard name. This double evaluation should not
470 # matter in practice, as guard expressions are expected to be simple,
480 # A common form of guard target is __${.PARSEFILE}__. This form can only be
494 # for the target guard name, as the expressions expand to different strings.
504 # guard is the same as in the test case 'target-indirect-PARSEFILE', as the
505 # guard name only contains the basename but not the directory name. So even
506 # without defining the guard target, the file is considered guarded.
514 # Another common form of guard target is __${.PARSEDIR}/${.PARSEFILE}__
527 # subdirectory gets a different guard target name than the previous one.
538 # If the guard target is not defined when including the file the next time,
547 # The guard condition must consist of only the guard target, nothing else.
556 # If the guard target is defined before the file is included the first time,
584 # If the guard target name has leading spaces, it does not have an effect,
594 # If the guard target name has trailing spaces, it does not have an effect,
604 # If the guard target condition is enclosed in parentheses, it does not have
615 # still recognized as a guard condition. This case is entirely uncommon, but
616 # at the point where the guard condition is checked, line continuations have
630 # the debug output. The files that properly guard against multiple inclusion