Add support for "::=" simple assignment operator.

The next POSIX standard will define "::=" to have the same behavior
as GNU make's ":=", so add support for this new operator.
This commit is contained in:
Paul Smith
2012-01-30 00:21:57 +00:00
parent fca11f6039
commit ef6461611b
9 changed files with 208 additions and 79 deletions

View File

@@ -35,7 +35,7 @@ enum variable_origin
enum variable_flavor
{
f_bogus, /* Bogus (error) */
f_simple, /* Simple definition (:=) */
f_simple, /* Simple definition (:= or ::=) */
f_recursive, /* Recursive definition (=) */
f_append, /* Appending definition (+=) */
f_conditional, /* Conditional definition (?=) */
@@ -52,9 +52,9 @@ enum variable_flavor
struct variable
{
char *name; /* Variable name. */
int length; /* strlen (name) */
char *value; /* Variable value. */
struct floc fileinfo; /* Where the variable was defined. */
int length; /* strlen (name) */
unsigned int recursive:1; /* Gets recursively re-evaluated. */
unsigned int append:1; /* Nonzero if an appending target-specific
variable. */
@@ -160,7 +160,7 @@ struct variable *do_variable_definition (const struct floc *flocp,
enum variable_flavor flavor,
int target_var);
char *parse_variable_definition (const char *line,
enum variable_flavor *flavor);
struct variable *v);
struct variable *assign_variable_definition (struct variable *v, char *line);
struct variable *try_variable_definition (const struct floc *flocp, char *line,
enum variable_origin origin,