Changes from Ralf Wildenhues.
[make.git] / dep.h
blobec2420e19120aa574528acdf1c15529d7abbf15f
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, 2007 Free Software
4 Foundation, Inc.
5 This file is part of GNU Make.
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 3 of the License, or (at your option) any later
10 version.
12 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along with
17 this program. If not, see <http://www.gnu.org/licenses/>. */
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'. */
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
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.
34 Note that the first two words of this match a struct nameseq. */
36 struct dep
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;
49 /* Structure used in chains of names, for parsing and globbing. */
51 struct nameseq
53 struct nameseq *next;
54 const char *name;
58 struct nameseq *multi_glob (struct nameseq *chain, unsigned int size, int exists_only);
59 #ifdef VMS
60 struct nameseq *parse_file_seq ();
61 #else
62 struct nameseq *parse_file_seq (char **stringp, int stopchar, unsigned int size, int strip);
63 #endif
64 char *tilde_expand (const char *name);
66 #ifndef NO_ARCHIVES
67 struct nameseq *ar_glob (const char *arname, const char *member_pattern, unsigned int size);
68 #endif
70 #define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)
72 struct dep *alloc_dep (void);
73 void free_dep (struct dep *d);
74 struct dep *copy_dep_chain (const struct dep *d);
75 void free_dep_chain (struct dep *d);
76 void free_ns_chain (struct nameseq *n);
77 struct dep *read_all_makefiles (const char **makefiles);
78 int eval_buffer (char *buffer);
79 int update_goal_chain (struct dep *goals);
80 void uniquize_deps (struct dep *);