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