From: Sam Leffler Date: Fri, 10 Dec 1982 13:34:31 +0000 (-0800) Subject: somehow the -p option went away X-Git-Tag: BSD-4_1c_2-Snapshot-Development~1549 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/73845e077106f53e08551e65d60de9183789c364 somehow the -p option went away 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 --- diff --git a/usr/src/usr.sbin/config/Makefile b/usr/src/usr.sbin/config/Makefile index ff1ea56a3b..28440e99eb 100644 --- a/usr/src/usr.sbin/config/Makefile +++ b/usr/src/usr.sbin/config/Makefile @@ -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 -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 -config: ${OFILES} - ${CC} ${OFILES} -o config ${LDFLAGS} +config: ${OBJS} + ${CC} ${OBJS} -o config ${LDFLAGS} lex.yy.c: config.l lex config.l diff --git a/usr/src/usr.sbin/config/main.c b/usr/src/usr.sbin/config/main.c index 21ee13aaab..5f2f362278 100644 --- a/usr/src/usr.sbin/config/main.c +++ b/usr/src/usr.sbin/config/main.c @@ -1,4 +1,4 @@ -/* main.c 1.7 82/10/25 */ +/* main.c 1.8 82/12/09 */ #include #include @@ -14,8 +14,12 @@ main(argc, argv) char **argv; { + if (argc > 1 && eq("-p", argv[1])) { + profiling++; + argc--, argv++; + } if (argc != 2) { - fprintf(stderr, "usage: config sysname\n"); + fprintf(stderr, "usage: config [ -p ] sysname\n"); exit(1); } PREFIX = argv[1]; diff --git a/usr/src/usr.sbin/config/mkheaders.c b/usr/src/usr.sbin/config/mkheaders.c index 4feb3d19a4..116b579114 100644 --- a/usr/src/usr.sbin/config/mkheaders.c +++ b/usr/src/usr.sbin/config/mkheaders.c @@ -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 @@ -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) { - count = dp->d_slave != UNKNOWN ? dp->d_slave : 1; + count = + dp->d_slave != UNKNOWN ? dp->d_slave : 1; break; } count++; @@ -95,7 +96,7 @@ do_header(dev, hname, count) 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; diff --git a/usr/src/usr.sbin/config/mkmakefile.c b/usr/src/usr.sbin/config/mkmakefile.c index afecf4620e..01ba6e9675 100644 --- a/usr/src/usr.sbin/config/mkmakefile.c +++ b/usr/src/usr.sbin/config/mkmakefile.c @@ -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 @@ -148,9 +148,9 @@ makefile() 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) { - perror("../conf/files"); + perror(fname); exit(1); } next: @@ -207,7 +207,7 @@ next: 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); } @@ -216,8 +216,10 @@ nextopt: 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; + } nreqs++; if (needs == 0) needs = ns(wd); @@ -251,6 +253,8 @@ save: 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")) @@ -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, - "\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; @@ -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; } + break; default: printf("Don't know rules for %s", np);