summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-10-29 11:07:17 +0000
committerdg <dg@FreeBSD.org>1995-10-29 11:07:17 +0000
commit0f9a89c4926b6bf2e03c1e37c351d007a5935de2 (patch)
treef5693e7e7fec63d59617b05587a37dc138f32a81 /usr.sbin/config
parentf0cafc464defe251540da8583acef38fe72c8dc2 (diff)
downloadFreeBSD-src-0f9a89c4926b6bf2e03c1e37c351d007a5935de2.zip
FreeBSD-src-0f9a89c4926b6bf2e03c1e37c351d007a5935de2.tar.gz
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.
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/mkmakefile.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 7313f46..1a347e8 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -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;
OpenPOWER on IntegriCloud