stamp for sending to dec... still bugs in mkioconf.c
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Fri, 27 Feb 1981 04:48:15 +0000 (20:48 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Fri, 27 Feb 1981 04:48:15 +0000 (20:48 -0800)
SCCS-vsn: usr.sbin/config/lang.l 1.4
SCCS-vsn: usr.sbin/config/mkheaders.c 1.5
SCCS-vsn: usr.sbin/config/mkmakefile.c 1.3
SCCS-vsn: usr.sbin/config/mkubglue.c 1.3

usr/src/usr.sbin/config/lang.l
usr/src/usr.sbin/config/mkheaders.c
usr/src/usr.sbin/config/mkmakefile.c
usr/src/usr.sbin/config/mkubglue.c

index 83e695a..338cffd 100644 (file)
@@ -1,5 +1,5 @@
 %{
 %{
-/*     lang.l  1.3     81/02/25        */
+/*     lang.l  1.4     81/02/26        */
 
 #include <ctype.h>
 #include "y.tab.h"
 
 #include <ctype.h>
 #include "y.tab.h"
@@ -107,6 +107,6 @@ char *str;
 {
        int num;
 
 {
        int num;
 
-       sscanf(str, "%x", &num);
+       sscanf(str+2, "%x", &num);
        return num;
 }
        return num;
 }
index cd26a73..555d351 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- *     mkheaders.c     1.4     81/02/26
+ *     mkheaders.c     1.5     81/02/26
  * Make all the .h files for the optional entries
  */
 
  * Make all the .h files for the optional entries
  */
 
@@ -80,6 +80,10 @@ int count;
     if (inf == NULL)
     {
        outf = fopen(file, "w");
     if (inf == NULL)
     {
        outf = fopen(file, "w");
+       if (outf == NULL) {
+           perror(file);
+           exit(1);
+       }
        fprintf(outf, "#define %s %d\n", name, count);
        fclose(outf);
        return;
        fprintf(outf, "#define %s %d\n", name, count);
        fclose(outf);
        return;
@@ -117,6 +121,10 @@ int count;
        fl_head = fl;
     }
     outf = fopen(file, "w");
        fl_head = fl;
     }
     outf = fopen(file, "w");
+    if (outf == NULL) {
+       perror(file);
+       exit(1);
+    }
     for (fl = fl_head; fl != NULL; fl = fl->f_next)
     {
        fprintf(outf, "#define %s %d\n", fl->f_fn, fl->f_type);
     for (fl = fl_head; fl != NULL; fl = fl->f_next)
     {
        fprintf(outf, "#define %s %d\n", fl->f_fn, fl->f_type);
index e259a21..9fac2ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * mkmakefile.c        1.2     81/02/26
+ * mkmakefile.c        1.3     81/02/26
  *     Functions in this file build the makefile from the files list
  *     and the information in the config table
  */
  *     Functions in this file build the makefile from the files list
  *     and the information in the config table
  */
@@ -61,13 +61,13 @@ struct file_list *new_fent()
 makefile()
 {
     FILE *ifp, *ofp;
 makefile()
 {
     FILE *ifp, *ofp;
-    char line[80];
+    char line[BUFSIZ];
 
     read_files();                      /* Read in the "files" file */
 
     read_files();                      /* Read in the "files" file */
-    ifp = fopen("../unix/makefile", "r");
+    ifp = fopen("../conf/makefile", "r");
     ofp = fopen(path("makefile"), "w");
     fprintf(ofp, "IDENT=-D%s -D%s\n", raise(ident), cpu_type);
     ofp = fopen(path("makefile"), "w");
     fprintf(ofp, "IDENT=-D%s -D%s\n", raise(ident), cpu_type);
-    while(fgets(line, 80, ifp) != NULL)
+    while(fgets(line, BUFSIZ, ifp) != NULL)
     {
        if (*line != '%')
        {
     {
        if (*line != '%')
        {
@@ -83,7 +83,7 @@ makefile()
        else if (eq(line, "%LOAD\n"))
            do_load(ofp);
        else
        else if (eq(line, "%LOAD\n"))
            do_load(ofp);
        else
-           fprintf(stderr, "Unknown %% thingy in generic makefile %s", line);
+           fprintf(stderr, "Unknown %% construct in generic makefile: %s", line);
     }
     fclose(ifp);
     fclose(ofp);
     }
     fclose(ifp);
     fclose(ofp);
@@ -103,8 +103,11 @@ read_files()
     register char *wd, *this;
     int type;
 
     register char *wd, *this;
     int type;
 
-    fp = fopen("../unix/files", "r");
-
+    fp = fopen("../conf/files", "r");
+    if (fp == NULL) {
+       perror("../conf/files");
+       exit(1);
+    }
     ftab = NULL;
     while((wd = get_word(fp)) != EOF)
     {
     ftab = NULL;
     while((wd = get_word(fp)) != EOF)
     {
@@ -288,22 +291,22 @@ register FILE *f;
     putc('\n', f);
     for (fl = conf_list; fl != NULL; fl = fl->f_next)
     {
     putc('\n', f);
     for (fl = conf_list; fl != NULL; fl = fl->f_next)
     {
-       fprintf(f, "\n%s: makefile locore.o ${OBJS} swap%s.o\n",
+       fprintf(f, "\n%s: makefile locore.o ${OBJS} ioconf.o swap%s.o\n",
                fl->f_needs, fl->f_fn);
        fprintf(f, "\t@echo loading %s\n\t@rm -f %s\n\t",
                fl->f_needs, fl->f_needs);
        fprintf(f,
                fl->f_needs, fl->f_fn);
        fprintf(f, "\t@echo loading %s\n\t@rm -f %s\n\t",
                fl->f_needs, fl->f_needs);
        fprintf(f,
-           "@ld -n -o %s -e start -x -T 80000000 locore.o ${OBJS} swap%s.o\n",
+           "@ld -n -o %s -e start -x -T 80000000 locore.o ${OBJS} ioconf.o swap%s.o\n",
            fl->f_needs, fl->f_fn);
        fprintf(f, "\t@echo rearranging symbols\n");
            fl->f_needs, fl->f_fn);
        fprintf(f, "\t@echo rearranging symbols\n");
-       fprintf(f, "\t@-symorder ../conf/symbols.sort %s\n", fl->f_needs);
+       fprintf(f, "\t@-symorder ../sys/symbols.sort %s\n", fl->f_needs);
        fprintf(f, "\t@size %s\n", fl->f_needs);
        fprintf(f, "\t@chmod 755 %s\n", fl->f_needs);
     }
     for (fl = conf_list; fl != NULL; fl = fl->f_next)
     {
        fprintf(f, "\t@size %s\n", fl->f_needs);
        fprintf(f, "\t@chmod 755 %s\n", fl->f_needs);
     }
     for (fl = conf_list; fl != NULL; fl = fl->f_next)
     {
-       fprintf(f, "\nswap%s.o: ../conf/swap%s.c\n", fl->f_fn, fl->f_fn);
-       fprintf(f, "\t${CC} -I. -c -S ${COPTS} ../conf/swap%s.c\n", fl->f_fn);
+       fprintf(f, "\nswap%s.o: ../dev/swap%s.c\n", fl->f_fn, fl->f_fn);
+       fprintf(f, "\t${CC} -I. -c -S ${COPTS} ../dev/swap%s.c\n", fl->f_fn);
        fprintf(f,
            "\t${C2} swap%s.s | sed -f ../sys/asm.sed | ${AS} -o swap%s.o\n",
            fl->f_fn, fl->f_fn);
        fprintf(f,
            "\t${C2} swap%s.s | sed -f ../sys/asm.sed | ${AS} -o swap%s.o\n",
            fl->f_fn, fl->f_fn);
index 80df16a..acda200 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Make the uba interrupt file ubglue.s
 /*
  * Make the uba interrupt file ubglue.s
- *     mkubglue.c      1.2     81/02/26
+ *     mkubglue.c      1.3     81/02/26
  */
 #include <stdio.h>
 #include "config.h"
  */
 #include <stdio.h>
 #include "config.h"
@@ -12,6 +12,10 @@ ubglue()
     register struct device *dp, *mp;
 
     fp = fopen(path("ubglue.s"), "w");
     register struct device *dp, *mp;
 
     fp = fopen(path("ubglue.s"), "w");
+    if (fp == NULL) {
+       perror(path("ubglue.s"));
+       exit(1);
+    }
     for (dp = dtab ; dp != NULL; dp = dp->d_next)
     {
        mp = dp->d_conn;
     for (dp = dtab ; dp != NULL; dp = dp->d_next)
     {
        mp = dp->d_conn;