summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2011-03-21 09:40:01 +0000
committerjeff <jeff@FreeBSD.org>2011-03-21 09:40:01 +0000
commit2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338 (patch)
tree79d67d85de5b498560d0272509bd0b1bfccf7d86 /usr.sbin/config/mkmakefile.c
parent3420a736119b646db3defc2c3e24d534e35d73a0 (diff)
downloadFreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.zip
FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.tar.gz
- Merge changes to the base system to support OFED. These include
a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND, and other miscellaneous small features.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c49
1 files changed, 35 insertions, 14 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index dd7aaa9..2372839 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -312,6 +312,7 @@ read_file(char *fname)
struct device *dp;
struct opt *op;
char *wd, *this, *compilewith, *depends, *clean, *warning;
+ const char *objprefix;
int compile, match, nreqs, std, filetype,
imp_rule, no_obj, before_depend, mandatory, nowerror;
@@ -326,6 +327,7 @@ next:
* [ compile-with "compile rule" [no-implicit-rule] ]
* [ dependency "dependency-list"] [ before-depend ]
* [ clean "file-list"] [ warning "text warning" ]
+ * [ obj-prefix "file prefix"]
*/
wd = get_word(fp);
if (wd == (char *)EOF) {
@@ -373,6 +375,7 @@ next:
before_depend = 0;
nowerror = 0;
filetype = NORMAL;
+ objprefix = "";
if (eq(wd, "standard")) {
std = 1;
/*
@@ -467,6 +470,16 @@ nextparam:
warning = ns(wd);
goto nextparam;
}
+ if (eq(wd, "obj-prefix")) {
+ next_quoted_word(fp, wd);
+ if (wd == 0) {
+ printf("%s: %s missing object prefix string.\n",
+ fname, this);
+ exit(1);
+ }
+ objprefix = ns(wd);
+ goto nextparam;
+ }
nreqs++;
if (eq(wd, "local")) {
filetype = LOCAL;
@@ -535,6 +548,7 @@ doneparam:
tp->f_depends = depends;
tp->f_clean = clean;
tp->f_warn = warning;
+ tp->f_objprefix = objprefix;
goto next;
}
@@ -619,11 +633,12 @@ do_objs(FILE *fp)
cp = sp + (len = strlen(sp)) - 1;
och = *cp;
*cp = 'o';
+ len += strlen(tp->f_objprefix);
if (len + lpos > 72) {
lpos = 8;
fprintf(fp, "\\\n\t");
}
- fprintf(fp, "%s ", sp);
+ fprintf(fp, "%s%s ", tp->f_objprefix, sp);
lpos += len + 1;
*cp = och;
}
@@ -699,30 +714,33 @@ do_rules(FILE *f)
och = *cp;
if (ftp->f_flags & NO_IMPLCT_RULE) {
if (ftp->f_depends)
- fprintf(f, "%s: %s\n", np, ftp->f_depends);
+ fprintf(f, "%s%s: %s\n",
+ ftp->f_objprefix, np, ftp->f_depends);
else
- fprintf(f, "%s: \n", np);
+ fprintf(f, "%s%s: \n", ftp->f_objprefix, np);
}
else {
*cp = '\0';
if (och == 'o') {
- fprintf(f, "%so:\n\t-cp $S/%so .\n\n",
- tail(np), np);
+ fprintf(f, "%s%so:\n\t-cp $S/%so .\n\n",
+ ftp->f_objprefix, tail(np), np);
continue;
}
if (ftp->f_depends) {
- fprintf(f, "%sln: $S/%s%c %s\n", tail(np),
- np, och, ftp->f_depends);
+ fprintf(f, "%s%sln: $S/%s%c %s\n",
+ ftp->f_objprefix, tail(np), np, och,
+ ftp->f_depends);
fprintf(f, "\t${NORMAL_LINT}\n\n");
- fprintf(f, "%so: $S/%s%c %s\n", tail(np),
- np, och, ftp->f_depends);
+ fprintf(f, "%s%so: $S/%s%c %s\n",
+ ftp->f_objprefix, tail(np), np, och,
+ ftp->f_depends);
}
else {
- fprintf(f, "%sln: $S/%s%c\n", tail(np),
- np, och);
+ fprintf(f, "%s%sln: $S/%s%c\n",
+ ftp->f_objprefix, tail(np), np, och);
fprintf(f, "\t${NORMAL_LINT}\n\n");
- fprintf(f, "%so: $S/%s%c\n", tail(np),
- np, och);
+ fprintf(f, "%s%so: $S/%s%c\n",
+ ftp->f_objprefix, tail(np), np, och);
}
}
compilewith = ftp->f_compilewith;
@@ -750,7 +768,10 @@ do_rules(FILE *f)
compilewith = cmd;
}
*cp = och;
- fprintf(f, "\t%s\n\n", compilewith);
+ if (strlen(ftp->f_objprefix))
+ fprintf(f, "\t%s $S/%s\n\n", compilewith, np);
+ else
+ fprintf(f, "\t%s\n\n", compilewith);
}
}
OpenPOWER on IntegriCloud