| 1 | /* Definitions for using pattern rules in 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 |  | 
|---|
| 20 | /* Structure used for pattern (implicit) rules.  */ | 
|---|
| 21 |  | 
|---|
| 22 | struct rule | 
|---|
| 23 | { | 
|---|
| 24 | struct rule *next; | 
|---|
| 25 | const char **targets;       /* Targets of the rule.  */ | 
|---|
| 26 | unsigned int *lens;         /* Lengths of each target.  */ | 
|---|
| 27 | const char **suffixes;      /* Suffixes (after `%') of each target.  */ | 
|---|
| 28 | struct dep *deps;           /* Dependencies of the rule.  */ | 
|---|
| 29 | struct commands *cmds;      /* Commands to execute.  */ | 
|---|
| 30 | unsigned short num;         /* Number of targets.  */ | 
|---|
| 31 | char terminal;              /* If terminal (double-colon).  */ | 
|---|
| 32 | char in_use;                /* If in use by a parent pattern_search.  */ | 
|---|
| 33 | }; | 
|---|
| 34 |  | 
|---|
| 35 | /* For calling install_pattern_rule.  */ | 
|---|
| 36 | struct pspec | 
|---|
| 37 | { | 
|---|
| 38 | char *target, *dep, *commands; | 
|---|
| 39 | }; | 
|---|
| 40 |  | 
|---|
| 41 |  | 
|---|
| 42 | extern struct rule *pattern_rules; | 
|---|
| 43 | extern struct rule *last_pattern_rule; | 
|---|
| 44 | extern unsigned int num_pattern_rules; | 
|---|
| 45 |  | 
|---|
| 46 | extern unsigned int max_pattern_deps; | 
|---|
| 47 | extern unsigned int max_pattern_targets; | 
|---|
| 48 | extern unsigned int max_pattern_dep_length; | 
|---|
| 49 |  | 
|---|
| 50 | extern struct file *suffix_file; | 
|---|
| 51 | extern unsigned int maxsuffix; | 
|---|
| 52 |  | 
|---|
| 53 |  | 
|---|
| 54 | void count_implicit_rule_limits (void); | 
|---|
| 55 | void convert_to_pattern (void); | 
|---|
| 56 | void install_pattern_rule (struct pspec *p, int terminal); | 
|---|
| 57 | void create_pattern_rule (const char **targets, const char **target_percents, | 
|---|
| 58 | unsigned int num, int terminal, struct dep *deps, | 
|---|
| 59 | struct commands *commands, int override); | 
|---|