Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Strict level 4 further tightens up the build system by implementing the following changes: 1. Changes the syntax for recognising MAM variable expansions from ${...} to %{...}. The old sh-like ${...} form is now only recognised in strict level 3 and below, and is not treated specially in strict level 4. This allows the shell's ${...} syntax to be used in shell script actions without any risk of conflicts or confusion with MAM. 2. Disables my change from 45feaa5 that allows 'prev' to declare a simple file prerequisite in one line, with optional attributes, as an equivalent of an empty make...done block. It was confusing and not well designed to mix this with prev's original function: referencing a previously made rule. 3. Adds a 'makp' command that may now be used to declare a simple file prerequisite instead. 4. Gets rid of the 'implicit' attribute. It has never worked as documented! That functionality was simply not implemented. Instead, it was a simple equivalent of 'dontcare', which is certainly not what is wanted where 'implicit' was indicated. src/cmd/INIT/mamake.c: - Delete RULE_implicit symbol (the 'implicit' attribute) which, when used with 'make', had the same effect as RULE_dontcare. - attributes(): Make 'implicit' attribute unavailable in strict level 4+; use RULE_dontcare for it otherwise. - substitute(): - Add %{ as the default prefix for MAM variable expansions. This is done regardless of strict level. The character combination %{ has never appeared in any Mamfile up to now, so there are no backward compatibility conerns, and this way, the new prefix can be used internally without complications. - Disable %{ at strict < 4. - For %{, disable special handling of ':', '=' and '['; these were just hacks to mitigate conflicts with sh/ksh syntax. - For %{, make it an error to expand an undefined variable when one of the two special expansion syntaxes is not used. - make(): Add makp command. For backward compatibility with previous strict levels, it shares it code with prev, so the same block (somewhat refactored) continues to have both functions. - Change internal expansions to use %{ instead of ${. src/cmd/INIT/mkdeps.sh: - Use %{ instead of ${ in generated dependencies. - No longer emit the broken implicit attribute. - For brevity, do not repeat rule name in 'done'. **/Mamfile: - Adapt to the new strict level 4, applying some slight refactoring where necessary. (The new strict level exposed one remaining dependency bug, in the generation of lc.h in libast/Mamfile, previously masked by the fact that 'implicit' was 'dontcare').
- Loading branch information