diff options
author | peter <peter@FreeBSD.org> | 1995-12-11 10:52:34 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-12-11 10:52:34 +0000 |
commit | 7a7fb14fa9b36f5a77f0861c85e6bb995aa6b757 (patch) | |
tree | ef03c70fe9e388e67ab0c2e18b675681568a8009 /usr.sbin/config/mkmakefile.c | |
parent | d7af2f0a80cee1f5b4fa606c79490ec68445ee7b (diff) | |
download | FreeBSD-src-7a7fb14fa9b36f5a77f0861c85e6bb995aa6b757.zip FreeBSD-src-7a7fb14fa9b36f5a77f0861c85e6bb995aa6b757.tar.gz |
Implement support for conf/options and i386/conf/options.i386
Note that this code is dormant unless the options files exist.
Also, parsing of quoted options in the config files is improved.
What this allows, is all the options in LINT to be specified to be
configured as #defines in a file rather than on the CC command line at
kernel build time. This means that 'make depend' will catch dependencies
on actual *options*, meaning that you can run 'config' and 'make depend'
in complete safety WITHOUT removing the compile directory each time.
Unfortunately, this requires a pass over the source to get the individual
files to #include the new .h files that would be generated by config.
This has a small compile time penalty (appears up to about 2% slower)
from a "fresh" build. Of course, you should not be needing to do complete
rebuilds very often once this was completed, so it would be an overall
win for most people.
Since this code is dormant and we've got a lot of other things happening
on the kernel tree at the moment (prototypes, devfs, static declarations
etc) I am not planning on doing any changes to activate this feature just
yet.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r-- | usr.sbin/config/mkmakefile.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 1a347e8..8f6ca3a 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -63,6 +63,7 @@ static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93"; static struct file_list *fcur; char *tail(); +extern int old_config_present; /* * Lookup a file, by name. @@ -139,6 +140,7 @@ makefile() char line[BUFSIZ]; struct opt *op; struct users *up; + int warn_make_clean = 0; read_files(); strcpy(line, "Makefile."); @@ -157,19 +159,27 @@ makefile() fprintf(ofp, "IDENT="); if (profiling) fprintf(ofp, " -DGPROF"); + if (cputype == 0) { printf("cpu type must be specified\n"); exit(1); } +#if 0 + /* XXX: moved to cputype.h */ { struct cputype *cp; for (cp = cputype; cp; cp = cp->cpu_next) fprintf(ofp, " -D%s", cp->cpu_name); } - for (op = opt; op; op = op->op_next) - if (op->op_value) - fprintf(ofp, " -D%s=\"%s\"", op->op_name, op->op_value); - else - fprintf(ofp, " -D%s", op->op_name); +#endif + for (op = opt; op; op = op->op_next) { + if (!op->op_ownfile) { + warn_make_clean++; + if (op->op_value) + fprintf(ofp, " -D%s=%s", op->op_name, op->op_value); + else + fprintf(ofp, " -D%s", op->op_name); + } + } fprintf(ofp, "\n"); if ((unsigned)machine > NUSERS) { printf("maxusers config info isn't present, using vax\n"); @@ -220,6 +230,15 @@ makefile() } (void) fclose(ifp); (void) fclose(ofp); +#ifdef notyet + if (warn_make_clean) { + printf("WARNING: Unknown options used (not in ../../conf/options or ./options.%s).\n", machinename); + if (old_config_present) { + printf("It is VERY important that you do a ``make clean'' before recompiling!\n"); + } + } + printf("Don't forget to do a ``make depend''\n"); +#endif } /* @@ -395,6 +414,7 @@ nextparam: } if (std) { dp = (struct device *) malloc(sizeof *dp); + bzero(dp, sizeof *dp); init_dev(dp); dp->d_name = ns(wd); dp->d_type = PSEUDO_DEVICE; |