Added support for a %SFILES token to auto-generate a SFILES= file list in
the same way that is done for CFILES. Files ending in .s or .S that match the option criteria will be included in this list.
This commit is contained in:
@@ -205,6 +205,8 @@ makefile()
|
||||
do_objs(ofp);
|
||||
else if (eq(line, "%CFILES\n"))
|
||||
do_cfiles(ofp);
|
||||
else if (eq(line, "%SFILES\n"))
|
||||
do_sfiles(ofp);
|
||||
else if (eq(line, "%RULES\n"))
|
||||
do_rules(ofp);
|
||||
else if (eq(line, "%LOAD\n"))
|
||||
@@ -583,6 +585,31 @@ do_cfiles(fp)
|
||||
putc('\n', fp);
|
||||
}
|
||||
|
||||
do_sfiles(fp)
|
||||
FILE *fp;
|
||||
{
|
||||
register struct file_list *tp;
|
||||
register int lpos, len;
|
||||
|
||||
fputs("SFILES=", fp);
|
||||
lpos = 8;
|
||||
for (tp = ftab; tp; tp = tp->f_next)
|
||||
if (tp->f_type != INVISIBLE) {
|
||||
len = strlen(tp->f_fn);
|
||||
if (tp->f_fn[len - 1] != 'S' && tp->f_fn[len - 1] != 's')
|
||||
continue;
|
||||
if ((len = 3 + len) + lpos > 72) {
|
||||
lpos = 8;
|
||||
fputs("\\\n\t", fp);
|
||||
}
|
||||
fprintf(fp, "$S/%s ", tp->f_fn);
|
||||
lpos += len + 1;
|
||||
}
|
||||
if (lpos != 8)
|
||||
putc('\n', fp);
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
tail(fn)
|
||||
char *fn;
|
||||
|
||||
Reference in New Issue
Block a user