1 | /* Definitions of dependency data structures for GNU Make.
|
---|
2 | Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
|
---|
3 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
---|
4 | Foundation, Inc.
|
---|
5 | This file is part of GNU Make.
|
---|
6 |
|
---|
7 | GNU Make is free software; you can redistribute it and/or modify it under the
|
---|
8 | terms of the GNU General Public License as published by the Free Software
|
---|
9 | Foundation; either version 2, or (at your option) any later version.
|
---|
10 |
|
---|
11 | GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
---|
13 | A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
---|
14 |
|
---|
15 | You should have received a copy of the GNU General Public License along with
|
---|
16 | GNU Make; see the file COPYING. If not, write to the Free Software
|
---|
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
|
---|
18 |
|
---|
19 | /* Flag bits for the second argument to `read_makefile'.
|
---|
20 | These flags are saved in the `changed' field of each
|
---|
21 | `struct dep' in the chain returned by `read_all_makefiles'. */
|
---|
22 |
|
---|
23 | #define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
---|
24 | #define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
---|
25 | #define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
---|
26 | #define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
---|
27 | #define RM_NOFLAG 0
|
---|
28 |
|
---|
29 | /* Structure representing one dependency of a file.
|
---|
30 | Each struct file's `deps' points to a chain of these,
|
---|
31 | chained through the `next'. `stem' is the stem for this
|
---|
32 | dep line of static pattern rule or NULL.
|
---|
33 |
|
---|
34 | Note that the first two words of this match a struct nameseq. */
|
---|
35 |
|
---|
36 | struct dep
|
---|
37 | {
|
---|
38 | struct dep *next;
|
---|
39 | const char *name;
|
---|
40 | const char *stem;
|
---|
41 | struct file *file;
|
---|
42 | unsigned int changed : 8;
|
---|
43 | unsigned int ignore_mtime : 1;
|
---|
44 | unsigned int staticpattern : 1;
|
---|
45 | unsigned int need_2nd_expansion : 1;
|
---|
46 | #ifdef CONFIG_WITH_INCLUDEDEP
|
---|
47 | unsigned int includedep : 1;
|
---|
48 | #endif
|
---|
49 | };
|
---|
50 |
|
---|
51 |
|
---|
52 | /* Structure used in chains of names, for parsing and globbing. */
|
---|
53 |
|
---|
54 | struct nameseq
|
---|
55 | {
|
---|
56 | struct nameseq *next;
|
---|
57 | const char *name;
|
---|
58 | };
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 | #ifndef CONFIG_WITH_ALLOC_CACHES
|
---|
63 | struct nameseq *multi_glob (struct nameseq *chain, unsigned int size);
|
---|
64 | #else
|
---|
65 | struct nameseq *multi_glob (struct nameseq *chain, struct alloccache *cache);
|
---|
66 | #endif
|
---|
67 | #ifdef VMS
|
---|
68 | struct nameseq *parse_file_seq ();
|
---|
69 | #else
|
---|
70 | # ifndef CONFIG_WITH_ALLOC_CACHES
|
---|
71 | struct nameseq *parse_file_seq (char **stringp, int stopchar, unsigned int size, int strip);
|
---|
72 | # else
|
---|
73 | struct nameseq *parse_file_seq (char **stringp, int stopchar, struct alloccache *cache, int strip);
|
---|
74 | # endif
|
---|
75 | #endif
|
---|
76 | char *tilde_expand (const char *name);
|
---|
77 |
|
---|
78 | #ifndef NO_ARCHIVES
|
---|
79 | struct nameseq *ar_glob (const char *arname, const char *member_pattern, unsigned int size);
|
---|
80 | #endif
|
---|
81 |
|
---|
82 | #define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)
|
---|
83 |
|
---|
84 | struct dep *alloc_dep (void);
|
---|
85 | void free_dep (struct dep *d);
|
---|
86 | struct dep *copy_dep_chain (const struct dep *d);
|
---|
87 | void free_dep_chain (struct dep *d);
|
---|
88 | void free_ns_chain (struct nameseq *n);
|
---|
89 | struct dep *read_all_makefiles (const char **makefiles);
|
---|
90 | #ifndef CONFIG_WITH_VALUE_LENGTH
|
---|
91 | int eval_buffer (char *buffer);
|
---|
92 | #else
|
---|
93 | int eval_buffer (char *buffer, char *eos);
|
---|
94 | #endif
|
---|
95 | int update_goal_chain (struct dep *goals);
|
---|
96 | void uniquize_deps (struct dep *);
|
---|
97 |
|
---|
98 | #ifdef CONFIG_WITH_INCLUDEDEP
|
---|
99 | /* incdep.c */
|
---|
100 | enum incdep_op { incdep_read_it, incdep_queue, incdep_flush };
|
---|
101 | void eval_include_dep (const char *name, struct floc *f, enum incdep_op op);
|
---|
102 | void incdep_flush_and_term (void);
|
---|
103 |
|
---|
104 | /* read.c */
|
---|
105 | void record_files (struct nameseq *filenames, const char *pattern,
|
---|
106 | const char *pattern_percent, struct dep *deps,
|
---|
107 | unsigned int cmds_started, char *commands,
|
---|
108 | unsigned int commands_idx, int two_colon,
|
---|
109 | const struct floc *flocp);
|
---|
110 | #endif
|
---|
111 |
|
---|