summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-27 21:41:58 +0000
committerru <ru@FreeBSD.org>2005-11-27 21:41:58 +0000
commitcbff67d85c5cb268b65e8b43497779006a483b30 (patch)
tree4c81f3ed60ddd5c6531684099ee2569e8bac8644 /usr.sbin/config/mkmakefile.c
parentd656f62998b3740c4fd74b3a89b2c8ebdd3063a4 (diff)
downloadFreeBSD-src-cbff67d85c5cb268b65e8b43497779006a483b30.zip
FreeBSD-src-cbff67d85c5cb268b65e8b43497779006a483b30.tar.gz
Make config(8) understand ORed dependecies in "files*" and
improve tracking of known devices. Bump config(8) version.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 5b4f3ad..9ef2adf 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -297,7 +297,7 @@ read_file(char *fname)
struct device *dp;
struct opt *op;
char *wd, *this, *compilewith, *depends, *clean, *warning;
- int nreqs, devfound, std, filetype,
+ int compile, match, nreqs, devfound, std, filetype,
imp_rule, no_obj, before_depend, mandatory, nowerror;
fp = fopen(fname, "r");
@@ -306,7 +306,7 @@ read_file(char *fname)
next:
/*
* filename [ standard | mandatory | optional ]
- * [ dev* | profiling-routine ] [ no-obj ]
+ * [ dev* [ | dev* ... ] | profiling-routine ] [ no-obj ]
* [ compile-with "compile rule" [no-implicit-rule] ]
* [ dependency "dependency-list"] [ before-depend ]
* [ clean "file-list"] [ warning "text warning" ]
@@ -332,6 +332,8 @@ next:
exit(1);
}
tp = fl_lookup(this);
+ compile = 0;
+ match = 1;
nreqs = 0;
compilewith = 0;
depends = 0;
@@ -360,9 +362,21 @@ next:
nextparam:
next_word(fp, wd);
if (wd == 0) {
- if (tp != NULL)
- goto next;
- goto doneparam;
+ compile += match;
+ if (compile && tp == NULL)
+ goto doneparam;
+ goto next;
+ }
+ if (eq(wd, "|")) {
+ if (nreqs == 0) {
+ printf("%s: syntax error describing %s\n",
+ fname, this);
+ exit(1);
+ }
+ compile += match;
+ match = 1;
+ nreqs = 0;
+ goto nextparam;
}
if (eq(wd, "no-obj")) {
no_obj++;
@@ -446,8 +460,6 @@ nextparam:
}
if (devfound)
goto nextparam;
- if (tp != NULL)
- goto skip;
if (mandatory) {
printf("%s: mandatory device \"%s\" not found\n",
fname, wd);
@@ -461,10 +473,8 @@ nextparam:
SLIST_FOREACH(op, &opt, op_next)
if (op->op_value == 0 && opteq(op->op_name, wd))
goto nextparam;
-skip:
- while ((wd = get_word(fp)) != 0)
- ;
- goto next;
+ match = 0;
+ goto nextparam;
doneparam:
if (std == 0 && nreqs == 0) {
OpenPOWER on IntegriCloud