diff options
author | harti <harti@FreeBSD.org> | 2004-07-19 14:42:57 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-07-19 14:42:57 +0000 |
commit | 4265ad191432ff75ed8c189aa8e4910c6f672e6b (patch) | |
tree | c4f7ba9da712cd9c0733c4aa2c47610ebb4661f4 | |
parent | a83177cdc35cb930c19a5b58f587060cfba90d8c (diff) | |
download | FreeBSD-src-4265ad191432ff75ed8c189aa8e4910c6f672e6b.zip FreeBSD-src-4265ad191432ff75ed8c189aa8e4910c6f672e6b.tar.gz |
Make it clearer what means 'won't work' for .if string == ${VAR}.
Replace the use of '=' in conditionals in the examples
by the more correct '=='.
Clarify the example explaining that .for expansion takes place before
.if handling by showing the correct code instead of saying 'the other
way around'. Change a variable name there so the example is more parseable
to the human reader.
PR: docs/65400
Submitted by: Roman Neuhauser <neuhauser@chello.cz>
-rw-r--r-- | usr.bin/make/make.1 | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index f08fb76..a55c5bc 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -1270,19 +1270,26 @@ in a test is very simple-minded. Currently, the only form that works is .Ql .if ${VAR} op something For instance, you should write tests as -.Ql .if ${VAR} = "string" -not the other way around, which doesn't work. +.Ql .if ${VAR} == "string" +not the other way around, which would give you an error. .Pp For loops are expanded before tests, so a fragment such as: .Bd -literal -offset indent -\&.for TMACHINE in ${SHARED_ARCHS} -\&.if ${TMACHINE} = ${MACHINE} +\&.for ARCH in ${SHARED_ARCHS} +\&.if ${ARCH} == ${MACHINE} ... \&.endif \&.endfor .Ed .Pp -won't work, and should be rewritten the other way around. +won't work, and should be rewritten as: +.Bd -literal -offset indent +\&.for ARCH in ${SHARED_ARCHS} +\&.if ${MACHINE} == ${ARCH} + ... +\&.endif +\&.endfor +.Ed .Pp The parsing code is broken with respect to handling a semicolon after a colon, so a fragment like this will fail: |