Changeset 3138 in kBuild for vendor/gnumake/current/dep.h
- Timestamp:
- Mar 12, 2018 7:32:29 PM (7 years ago)
- File:
-
- 1 edited
-
vendor/gnumake/current/dep.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/dep.h
r2596 r3138 1 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, 2008, 2009, 4 2010 Free Software Foundation, Inc. 2 Copyright (C) 1988-2016 Free Software Foundation, Inc. 5 3 This file is part of GNU Make. 6 4 … … 17 15 this program. If not, see <http://www.gnu.org/licenses/>. */ 18 16 19 /* Flag bits for the second argument to `read_makefile'.20 These flags are saved in the `changed' field of each21 `struct dep' in the chain returned by `read_all_makefiles'. */22 17 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 18 /* Structure used in chains of names, for parsing and globbing. */ 19 20 #define NAMESEQ(_t) \ 21 _t *next; \ 22 const char *name 23 24 struct nameseq 25 { 26 NAMESEQ (struct nameseq); 27 }; 28 29 /* Flag bits for the second argument to 'read_makefile'. 30 These flags are saved in the 'flags' field of each 31 'struct goaldep' in the chain returned by 'read_all_makefiles'. */ 32 33 #define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */ 34 #define RM_INCLUDED (1 << 1) /* Search makefile search path. */ 35 #define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */ 36 #define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */ 37 #define RM_NOFLAG 0 28 38 29 39 /* 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. 40 Each struct file's 'deps' points to a chain of these, through 'next'. 41 'stem' is the stem for this dep line of static pattern rule or NULL. */ 33 42 34 Note that the first two words of this match a struct nameseq. */ 43 #define DEP(_t) \ 44 NAMESEQ (_t); \ 45 struct file *file; \ 46 const char *stem; \ 47 unsigned short flags : 8; \ 48 unsigned short changed : 1; \ 49 unsigned short ignore_mtime : 1; \ 50 unsigned short staticpattern : 1; \ 51 unsigned short need_2nd_expansion : 1 35 52 36 53 struct dep 37 54 { 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 unsigned int dontcare : 1; 55 DEP (struct dep); 47 56 }; 48 57 58 /* Structure representing one goal. 59 The goals to be built constitute a chain of these, chained through 'next'. 60 'stem' is not used, but it's simpler to include and ignore it. */ 49 61 50 /* Structure used in chains of names, for parsing and globbing. */ 51 52 struct nameseq 62 struct goaldep 53 63 { 54 struct nameseq *next; 55 const char *name; 64 DEP (struct goaldep); 65 unsigned short error; 66 floc floc; 56 67 }; 57 68 69 /* Options for parsing lists of filenames. */ 58 70 59 #define PARSEFS_NONE (0x0000)60 #define PARSEFS_NOSTRIP (0x0001)61 #define PARSEFS_NOAR (0x0002)62 #define PARSEFS_NOGLOB (0x0004)63 #define PARSEFS_EXISTS (0x0008)64 #define PARSEFS_NOCACHE (0x0010)71 #define PARSEFS_NONE 0x0000 72 #define PARSEFS_NOSTRIP 0x0001 73 #define PARSEFS_NOAR 0x0002 74 #define PARSEFS_NOGLOB 0x0004 75 #define PARSEFS_EXISTS 0x0008 76 #define PARSEFS_NOCACHE 0x0010 65 77 66 78 #define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \ 67 79 (_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f)) 80 #define PARSE_SIMPLE_SEQ(_s,_t) \ 81 (_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE) 68 82 69 83 #ifdef VMS … … 71 85 #else 72 86 void *parse_file_seq (char **stringp, unsigned int size, 73 int stop char, const char *prefix, int flags);87 int stopmap, const char *prefix, int flags); 74 88 #endif 75 89 … … 80 94 #endif 81 95 82 #define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)96 #define dep_name(d) ((d)->name ? (d)->name : (d)->file->name) 83 97 84 #define alloc_dep() (xcalloc (sizeof (struct dep))) 85 #define free_ns(_n) free (_n) 86 #define free_dep(_d) free_ns (_d) 98 #define alloc_seq_elt(_t) xcalloc (sizeof (_t)) 99 void free_ns_chain (struct nameseq *n); 100 101 #if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) 102 /* Use inline to get real type-checking. */ 103 #define SI static inline 104 SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); } 105 SI struct dep *alloc_dep() { return alloc_seq_elt (struct dep); } 106 SI struct goaldep *alloc_goaldep() { return alloc_seq_elt (struct goaldep); } 107 108 SI void free_ns(struct nameseq *n) { free (n); } 109 SI void free_dep(struct dep *d) { free_ns ((struct nameseq *)d); } 110 SI void free_goaldep(struct goaldep *g) { free_dep ((struct dep *)g); } 111 112 SI void free_dep_chain(struct dep *d) { free_ns_chain((struct nameseq *)d); } 113 SI void free_goal_chain(struct goaldep *g) { free_dep_chain((struct dep *)g); } 114 #else 115 # define alloc_ns() alloc_seq_elt (struct nameseq) 116 # define alloc_dep() alloc_seq_elt (struct dep) 117 # define alloc_goaldep() alloc_seq_elt (struct goaldep) 118 119 # define free_ns(_n) free (_n) 120 # define free_dep(_d) free_ns (_d) 121 # define free_goaldep(_g) free_dep (_g) 122 123 # define free_dep_chain(_d) free_ns_chain ((struct nameseq *)(_d)) 124 # define free_goal_chain(_g) free_ns_chain ((struct nameseq *)(_g)) 125 #endif 87 126 88 127 struct dep *copy_dep_chain (const struct dep *d); 89 void free_dep_chain (struct dep *d); 90 void free_ns_chain (struct nameseq *n); 91 struct dep *read_all_makefiles (const char **makefiles); 92 void eval_buffer (char *buffer); 93 int update_goal_chain (struct dep *goals); 128 129 struct goaldep *read_all_makefiles (const char **makefiles); 130 void eval_buffer (char *buffer, const floc *floc); 131 enum update_status update_goal_chain (struct goaldep *goals);
Note:
See TracChangeset
for help on using the changeset viewer.

