summaryrefslogtreecommitdiff
path: root/variable.h
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2003-05-02 01:44:59 +0000
committerPaul Smith <psmith@gnu.org>2003-05-02 01:44:59 +0000
commit1a5beef51f5c32081116e502c1c90a3e32813020 (patch)
tree5cf133d3615d2674df02234f6d5708d22175a67d /variable.h
parent652234e967b825478d0b756a65353f252adf73d3 (diff)
downloadgunmake-1a5beef51f5c32081116e502c1c90a3e32813020.tar.gz
- Fix bug #1405: allow multiple pattern-specific variables to match a target.
- Fix some uncleanliness about the implementation of patterns-specific vars. - Some enhancements to the OS/2 port.
Diffstat (limited to 'variable.h')
-rw-r--r--variable.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/variable.h b/variable.h
index 5ce1944..613278a 100644
--- a/variable.h
+++ b/variable.h
@@ -47,7 +47,6 @@ enum variable_flavor
chained through `next'. */
#define EXP_COUNT_BITS 15 /* This gets all the bitfields into 32 bits */
-
#define EXP_COUNT_MAX ((1<<EXP_COUNT_BITS)-1)
struct variable
@@ -57,20 +56,21 @@ struct variable
char *value; /* Variable value. */
struct floc fileinfo; /* Where the variable was defined. */
unsigned int recursive:1; /* Gets recursively re-evaluated. */
- unsigned int per_target:1; /* Nonzero if a target-specific variable. */
unsigned int append:1; /* Nonzero if an appending target-specific
variable. */
+ unsigned int conditional:1; /* Nonzero if set with a ?=. */
+ unsigned int per_target:1; /* Nonzero if a target-specific variable. */
unsigned int special:1; /* Nonzero if this is a special variable. */
+ unsigned int exportable:1; /* Nonzero if the variable _could_ be
+ exported. */
unsigned int expanding:1; /* Nonzero if currently being expanded. */
unsigned int exp_count:EXP_COUNT_BITS;
/* If >1, allow this many self-referential
expansions. */
-
+ enum variable_flavor
+ flavor ENUM_BITFIELD (3); /* Variable flavor. */
enum variable_origin
origin ENUM_BITFIELD (3); /* Variable origin. */
-
- unsigned int exportable:1; /* Nonzero if the variable _could_ be
- exported. */
enum variable_export
{
v_export, /* Export this variable. */
@@ -95,6 +95,17 @@ struct variable_set_list
struct variable_set *set; /* Variable set. */
};
+/* Structure used for pattern-specific variables. */
+
+struct pattern_var
+ {
+ struct pattern_var *next;
+ char *target;
+ unsigned int len;
+ char *suffix;
+ struct variable variable;
+ };
+
extern char *variable_buffer;
extern struct variable_set_list *current_variable_set_list;
@@ -131,8 +142,9 @@ extern void define_automatic_variables PARAMS ((void));
extern void initialize_file_variables PARAMS ((struct file *file, int read));
extern void print_file_variables PARAMS ((struct file *file));
extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix));
-extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
+extern void merge_variable_set_lists PARAMS ((struct variable_set_list **to_list, struct variable_set_list *from_list));
extern struct variable *do_variable_definition PARAMS ((const struct floc *flocp, const char *name, char *value, enum variable_origin origin, enum variable_flavor flavor, int target_var));
+extern struct variable *parse_variable_definition PARAMS ((struct variable *v, char *line));
extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin, int target_var));
extern void init_hash_global_variable_set PARAMS ((void));
extern void hash_init_function_table PARAMS ((void));
@@ -179,6 +191,8 @@ extern struct variable *define_variable_in_set
extern char **target_environment PARAMS ((struct file *file));
+extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
+
extern int export_all_variables;
#define MAKELEVEL_NAME "MAKELEVEL"