somehow the -p option went away
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Fri, 10 Dec 1982 13:34:31 +0000 (05:34 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Fri, 10 Dec 1982 13:34:31 +0000 (05:34 -0800)
SCCS-vsn: usr.sbin/config/main.c 1.8
SCCS-vsn: usr.sbin/config/Makefile 1.8
SCCS-vsn: usr.sbin/config/mkheaders.c 1.13
SCCS-vsn: usr.sbin/config/mkmakefile.c 1.22

usr/src/usr.sbin/config/Makefile
usr/src/usr.sbin/config/main.c
usr/src/usr.sbin/config/mkheaders.c
usr/src/usr.sbin/config/mkmakefile.c

index ff1ea56..28440e9 100644 (file)
@@ -1,14 +1,14 @@
 #
 #
-#      Makefile        1.7     82/10/25
+#      Makefile        1.8     82/12/09
 #
 CFILES=        y.tab.c main.c lex.yy.c mkioconf.c mkmakefile.c mkubglue.c mkheaders.c
 #
 CFILES=        y.tab.c main.c lex.yy.c mkioconf.c mkmakefile.c mkubglue.c mkheaders.c
-OFILES=        y.tab.o main.o lex.yy.o mkioconf.o mkmakefile.o mkubglue.o mkheaders.o
+OBJS=  y.tab.o main.o lex.yy.o mkioconf.o mkmakefile.o mkubglue.o mkheaders.o
 
 
-CFLAGS=
+CFLAGS=-O
 LDFLAGS=-ll
 
 LDFLAGS=-ll
 
-config: ${OFILES}
-       ${CC} ${OFILES} -o config ${LDFLAGS}
+config: ${OBJS}
+       ${CC} ${OBJS} -o config ${LDFLAGS}
 
 lex.yy.c: config.l
        lex config.l
 
 lex.yy.c: config.l
        lex config.l
index 21ee13a..5f2f362 100644 (file)
@@ -1,4 +1,4 @@
-/*     main.c  1.7     82/10/25        */
+/*     main.c  1.8     82/12/09        */
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -14,8 +14,12 @@ main(argc, argv)
        char **argv;
 {
 
        char **argv;
 {
 
+       if (argc > 1 && eq("-p", argv[1])) {
+               profiling++;
+               argc--, argv++;
+       }
        if (argc != 2) {
        if (argc != 2) {
-               fprintf(stderr, "usage: config sysname\n");
+               fprintf(stderr, "usage: config [ -p ] sysname\n");
                exit(1);
        }
        PREFIX = argv[1];
                exit(1);
        }
        PREFIX = argv[1];
index 4feb3d1..116b579 100644 (file)
@@ -1,4 +1,4 @@
-/*     mkheaders.c     1.12    82/10/25        */
+/*     mkheaders.c     1.13    82/12/09        */
 
 /*
  * Make all the .h files for the optional entries
 
 /*
  * Make all the .h files for the optional entries
@@ -32,7 +32,8 @@ do_count(dev, hname, search)
        for (count = 0,dp = dtab; dp != 0; dp = dp->d_next)
                if (dp->d_unit != -1 && eq(dp->d_name, dev)) {
                        if (dp->d_type == PSEUDO_DEVICE) {
        for (count = 0,dp = dtab; dp != 0; dp = dp->d_next)
                if (dp->d_unit != -1 && eq(dp->d_name, dev)) {
                        if (dp->d_type == PSEUDO_DEVICE) {
-                               count = dp->d_slave != UNKNOWN ? dp->d_slave : 1;
+                               count =
+                                   dp->d_slave != UNKNOWN ? dp->d_slave : 1;
                                break;
                        }
                        count++;
                                break;
                        }
                        count++;
@@ -95,7 +96,7 @@ do_header(dev, hname, count)
                        inc = count;
                }
                cp = get_word(inf);
                        inc = count;
                }
                cp = get_word(inf);
-               if (cp == 0 || cp == (char *)EOF)
+               if (cp == (char *)EOF)
                        break;
                fl = (struct file_list *) malloc(sizeof *fl);
                fl->f_fn = inw;
                        break;
                fl = (struct file_list *) malloc(sizeof *fl);
                fl->f_fn = inw;
index afecf46..01ba6e9 100644 (file)
@@ -1,4 +1,4 @@
-/*     mkmakefile.c    1.21    82/10/25        */
+/*     mkmakefile.c    1.22    82/12/09        */
 
 /*
  * Build the makefile for the system, from
 
 /*
  * Build the makefile for the system, from
@@ -148,9 +148,9 @@ makefile()
                        fprintf(stderr,
                            "Unknown %% construct in generic makefile: %s",
                            line);
                        fprintf(stderr,
                            "Unknown %% construct in generic makefile: %s",
                            line);
-               (void) fclose(ifp);
-               (void) fclose(ofp);
        }
        }
+       (void) fclose(ifp);
+       (void) fclose(ofp);
 }
 
 /*
 }
 
 /*
@@ -172,7 +172,7 @@ read_files()
 openit:
        fp = fopen(fname, "r");
        if (fp == 0) {
 openit:
        fp = fopen(fname, "r");
        if (fp == 0) {
-               perror("../conf/files");
+               perror(fname);
                exit(1);
        }
 next:
                exit(1);
        }
 next:
@@ -207,7 +207,7 @@ next:
        if (eq(wd, "standard"))
                goto checkdev;
        if (!eq(wd, "optional")) {
        if (eq(wd, "standard"))
                goto checkdev;
        if (!eq(wd, "optional")) {
-               printf("%s: %s must be optional or standard",
+               printf("%s: %s must be optional or standard\n",
                    fname, this);
                exit(1);
        }
                    fname, this);
                exit(1);
        }
@@ -216,8 +216,10 @@ nextopt:
        if (wd == 0)
                goto doneopt;
        devorprof = wd;
        if (wd == 0)
                goto doneopt;
        devorprof = wd;
-       if (eq(wd, "device-driver") || eq(wd, "profiling-routine"))
+       if (eq(wd, "device-driver") || eq(wd, "profiling-routine")) {
+               next_word(fp, wd);
                goto save;
                goto save;
+       }
        nreqs++;
        if (needs == 0)
                needs = ns(wd);
        nreqs++;
        if (needs == 0)
                needs = ns(wd);
@@ -251,6 +253,8 @@ save:
                    fname, this);
                exit(1);
        }
                    fname, this);
                exit(1);
        }
+       if (eq(devorprof, "profiling-routine") && profiling == 0)
+               goto next;
        tp = new_fent();
        tp->f_fn = this;
        if (eq(devorprof, "device-driver"))
        tp = new_fent();
        tp->f_fn = this;
        if (eq(devorprof, "device-driver"))
@@ -400,7 +404,7 @@ for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
                        fprintf(f, "\t${CC} -I. -c -S %s ../%sc\n", COPTS, np);
                        fprintf(f, "\tex - %ss < ${CRT0.EX}\n", tp);
                        fprintf(f,
                        fprintf(f, "\t${CC} -I. -c -S %s ../%sc\n", COPTS, np);
                        fprintf(f, "\tex - %ss < ${CRT0.EX}\n", tp);
                        fprintf(f,
-                 "\t/lib/cpp %ss | sed -f ../conf/asm.sed | ${AS} -o %so\n",
+                 "\t/lib/cpp %ss | sed -f ../vax/asm.sed | ${AS} -o %so\n",
                          tp, tp);
                        fprintf(f, "\trm -f %ss\n\n", tp);
                        break;
                          tp, tp);
                        fprintf(f, "\trm -f %ss\n\n", tp);
                        break;
@@ -410,6 +414,7 @@ for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
                            "config: don't know how to profile kernel on sun\n");
                        break;
                }
                            "config: don't know how to profile kernel on sun\n");
                        break;
                }
+               break;
 
        default:
                printf("Don't know rules for %s", np);
 
        default:
                printf("Don't know rules for %s", np);