4
static int rcmp(Rule *r, char *target, Word *tail);
8
addrule(char *head, Word *tail, char *body, Word *ahead, int attr, int hline, char *prog)
17
if(sym = symlook(head, S_TARGET, 0)){
18
for(r = (Rule *)sym->value; r; r = r->chain)
19
if(rcmp(r, head, tail) == 0){
25
r = (Rule *)Malloc(sizeof(Rule));
27
r->shellcmd = shellcmd;
34
r->alltargets = ahead;
38
rr = (Rule *)symlook(head, S_TARGET, (void *)r)->value;
47
if((attr®EXP) || shellt->charin(head, "%&")){
53
r->pat = regcomp(head);
75
dumpr(char *s, Rule *r)
77
Bprint(&bout, "%s: start=%ld shelltype=%s shellcmd=%s\n",
78
s, r, r->shellt->name, wtos(r->shellcmd, ' '));
79
for(; r; r = r->next){
80
Bprint(&bout, "\tRule %ld: %s[%d] attr=%x next=%ld chain=%ld alltarget='%s'",
81
r, r->file, r->line, r->attr, r->next, r->chain, wtos(r->alltargets, ' '));
83
Bprint(&bout, " prog='%s'", r->prog);
84
Bprint(&bout, "\n\ttarget=%s: %s\n", r->target, wtos(r->tail, ' '));
85
Bprint(&bout, "\trecipe@%ld='%s'\n", r->recipe, r->recipe);
90
rcmp(Rule *r, char *target, Word *tail)
94
if(strcmp(r->target, target))
96
for(w = r->tail; w && tail; w = w->next, tail = tail->next)
97
if(strcmp(w->s, tail->s))
108
memset(s, 0, nrules);