summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-12-30 15:29:50 +0000
committerru <ru@FreeBSD.org>2005-12-30 15:29:50 +0000
commit9d1801a10554429dd1cfce2268b2f14d02e25509 (patch)
tree89491ff57608e5c7f7419acbfdb5462531473285 /usr.sbin/config/mkmakefile.c
parente1d71bf7ffd9ed8d01e36055fb6e58ec68e88197 (diff)
downloadFreeBSD-src-9d1801a10554429dd1cfce2268b2f14d02e25509.zip
FreeBSD-src-9d1801a10554429dd1cfce2268b2f14d02e25509.tar.gz
Clean up most of the "XXX"-tagged items:
- The code that creates hints.c and env.c from the skeleton files moved into separate functions. - Sanity checks for missing "ident" and "cputype" directives moved into main(), alongside the existing check for "machine". PR: bin/90310 Submitted by: Matt Emmerton <matt@gsicomp.on.ca>
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 9ef2adf..157cff6 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -113,7 +113,6 @@ makefile(void)
char line[BUFSIZ];
struct opt *op;
int versreq;
- char *s;
read_files();
snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename);
@@ -125,12 +124,6 @@ makefile(void)
if (ifp == 0)
err(1, "%s", line);
- /* XXX this check seems to be misplaced. */
- if (SLIST_EMPTY(&cputype)) {
- printf("cpu type must be specified\n");
- exit(1);
- }
-
ofp = fopen(path("Makefile.new"), "w");
if (ofp == 0)
err(1, "%s", path("Makefile.new"));
@@ -181,8 +174,18 @@ makefile(void)
(void) fclose(ifp);
(void) fclose(ofp);
moveifchanged(path("Makefile.new"), path("Makefile"));
+}
+
+/*
+ * Build hints.c from the skeleton
+ */
+void
+makehints(void)
+{
+ FILE *ifp, *ofp;
+ char line[BUFSIZ];
+ char *s;
- /* XXX makefile() should make the Makefile, not hints.c. */
if (hints) {
ifp = fopen(hints, "r");
if (ifp == NULL)
@@ -234,8 +237,18 @@ makefile(void)
fclose(ifp);
fclose(ofp);
moveifchanged(path("hints.c.new"), path("hints.c"));
+}
+
+/*
+ * Build env.c from the skeleton
+ */
+void
+makeenv(void)
+{
+ FILE *ifp, *ofp;
+ char line[BUFSIZ];
+ char *s;
- /* XXX makefile() should make the Makefile, not env.c. */
if (env) {
ifp = fopen(env, "r");
if (ifp == NULL)
@@ -518,10 +531,6 @@ read_files(void)
char fname[MAXPATHLEN];
struct files_name *nl, *tnl;
- if (ident == NULL) {
- printf("no ident line specified\n");
- exit(1);
- }
(void) snprintf(fname, sizeof(fname), "../../conf/files");
read_file(fname);
(void) snprintf(fname, sizeof(fname),
OpenPOWER on IntegriCloud