install correct aliases file
[unix-history] / usr / src / usr.sbin / config / mkmakefile.c
index 3cda4e0..f99b466 100644 (file)
@@ -1,12 +1,23 @@
 /*
  * Copyright (c) 1980 Regents of the University of California.
 /*
  * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkmakefile.c       5.9 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)mkmakefile.c       5.21 (Berkeley) %G%";
+#endif /* not lint */
 
 /*
  * Build the makefile for the system, from
 
 /*
  * Build the makefile for the system, from
@@ -90,6 +101,7 @@ static       struct users {
        int     u_max;
 } users[] = {
        { 24, 8, 1024 },                /* MACHINE_VAX */
        int     u_max;
 } users[] = {
        { 24, 8, 1024 },                /* MACHINE_VAX */
+       { 4, 2, 128 },                  /* MACHINE_TAHOE */
 };
 #define        NUSERS  (sizeof (users) / sizeof (users[0]))
 
 };
 #define        NUSERS  (sizeof (users) / sizeof (users[0]))
 
@@ -387,7 +399,7 @@ do_objs(fp)
                for (fl = conf_list; fl; fl = fl->f_next) {
                        if (fl->f_type != SWAPSPEC)
                                continue;
                for (fl = conf_list; fl; fl = fl->f_next) {
                        if (fl->f_type != SWAPSPEC)
                                continue;
-                       sprintf(swapname, "swap%s.c", fl->f_fn);
+                       (void) sprintf(swapname, "swap%s.c", fl->f_fn);
                        if (eq(sp, swapname))
                                goto cont;
                }
                        if (eq(sp, swapname))
                                goto cont;
                }
@@ -411,23 +423,37 @@ cont:
 do_cfiles(fp)
        FILE *fp;
 {
 do_cfiles(fp)
        FILE *fp;
 {
-       register struct file_list *tp;
+       register struct file_list *tp, *fl;
        register int lpos, len;
        register int lpos, len;
+       char swapname[32];
 
 
-       fprintf(fp, "CFILES=");
+       fputs("CFILES=", fp);
        lpos = 8;
        lpos = 8;
-       for (tp = ftab; tp != 0; tp = tp->f_next) {
-               if (tp->f_type == INVISIBLE)
-                       continue;
-               if (tp->f_fn[strlen(tp->f_fn)-1] != 'c')
-                       continue;
-               if ((len = 3 + strlen(tp->f_fn)) + lpos > 72) {
-                       lpos = 8;
-                       fprintf(fp, "\\\n\t");
+       for (tp = ftab; tp; tp = tp->f_next)
+               if (tp->f_type != INVISIBLE) {
+                       len = strlen(tp->f_fn);
+                       if (tp->f_fn[len - 1] != 'c')
+                               continue;
+                       if ((len = 3 + len) + lpos > 72) {
+                               lpos = 8;
+                               fputs("\\\n\t", fp);
+                       }
+                       fprintf(fp, "../%s ", tp->f_fn);
+                       lpos += len + 1;
+               }
+       for (fl = conf_list; fl; fl = fl->f_next)
+               if (fl->f_type == SYSTEMSPEC) {
+                       (void) sprintf(swapname, "swap%s.c", fl->f_fn);
+                       if ((len = 3 + strlen(swapname)) + lpos > 72) {
+                               lpos = 8;
+                               fputs("\\\n\t", fp);
+                       }
+                       if (eq(fl->f_fn, "generic"))
+                               fprintf(fp, "../%s/%s ", machinename, swapname);
+                       else
+                               fprintf(fp, "%s ", swapname);
+                       lpos += len + 1;
                }
                }
-               fprintf(fp, "../%s ", tp->f_fn);
-               lpos += len + 1;
-       }
        if (lpos != 8)
                putc('\n', fp);
 }
        if (lpos != 8)
                putc('\n', fp);
 }
@@ -465,7 +491,7 @@ for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
        och = *cp;
        *cp = '\0';
        if (och == 'o') {
        och = *cp;
        *cp = '\0';
        if (och == 'o') {
-               fprintf(f, "%so:\n\t-cp ../%so .\n", tail(np), np);
+               fprintf(f, "%so:\n\t-cp ../%so .\n\n", tail(np), np);
                continue;
        }
        fprintf(f, "%so: ../%s%c\n", tail(np), np, och);
                continue;
        }
        fprintf(f, "%so: ../%s%c\n", tail(np), np, och);
@@ -487,6 +513,7 @@ for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
                switch (machine) {
 
                case MACHINE_VAX:
                switch (machine) {
 
                case MACHINE_VAX:
+               case MACHINE_TAHOE:
                        fprintf(f, "\t${CC} -c -S ${COPTS} %s../%sc\n",
                                extras, np);
                        fprintf(f, "\t${C2} %ss | ${INLINE} | ${AS} -o %so\n",
                        fprintf(f, "\t${CC} -c -S ${COPTS} %s../%sc\n",
                                extras, np);
                        fprintf(f, "\t${C2} %ss | ${INLINE} | ${AS} -o %so\n",
@@ -500,6 +527,7 @@ for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
                switch (machine) {
 
                case MACHINE_VAX:
                switch (machine) {
 
                case MACHINE_VAX:
+               case MACHINE_TAHOE:
                        fprintf(f, "\t${CC} -c -S ${COPTS} %s../%sc\n",
                                extras, np);
                        fprintf(f,"\t${C2} -i %ss | ${INLINE} | ${AS} -o %so\n",
                        fprintf(f, "\t${CC} -c -S ${COPTS} %s../%sc\n",
                                extras, np);
                        fprintf(f,"\t${C2} -i %ss | ${INLINE} | ${AS} -o %so\n",
@@ -519,6 +547,15 @@ for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
                }
                switch (machine) {
 
                }
                switch (machine) {
 
+               case MACHINE_TAHOE:
+                       fprintf(f, "\t${CC} -c -S %s %s../%sc\n",
+                               COPTS, extras, np);
+                       fprintf(f, "\tex - %ss < ${GPROF.EX}\n", tp);
+                       fprintf(f,"\t${C2} %ss | ${INLINE} | ${AS} -o %so\n",
+                           tp, tp);
+                       fprintf(f, "\trm -f %ss\n\n", tp);
+                       break;
+
                case MACHINE_VAX:
                        fprintf(f, "\t${CC} -c -S %s %s../%sc\n",
                                COPTS, extras, np);
                case MACHINE_VAX:
                        fprintf(f, "\t${CC} -c -S %s %s../%sc\n",
                                COPTS, extras, np);
@@ -544,24 +581,17 @@ do_load(f)
        register FILE *f;
 {
        register struct file_list *fl;
        register FILE *f;
 {
        register struct file_list *fl;
-       int first = 1;
+       register int first;
        struct file_list *do_systemspec();
 
        struct file_list *do_systemspec();
 
-       fl = conf_list;
-       while (fl) {
-               if (fl->f_type != SYSTEMSPEC) {
-                       fl = fl->f_next;
-                       continue;
-               }
-               fl = do_systemspec(f, fl, first);
-               if (first)
-                       first = 0;
-       }
-       fprintf(f, "all:");
-       for (fl = conf_list; fl != 0; fl = fl->f_next)
+       for (first = 1, fl = conf_list; fl; first = 0)
+               fl = fl->f_type == SYSTEMSPEC ?
+                       do_systemspec(f, fl, first) : fl->f_next;
+       fputs("all:", f);
+       for (fl = conf_list; fl; fl = fl->f_next)
                if (fl->f_type == SYSTEMSPEC)
                        fprintf(f, " %s", fl->f_needs);
                if (fl->f_type == SYSTEMSPEC)
                        fprintf(f, " %s", fl->f_needs);
-       fprintf(f, "\n");
+       putc('\n', f);
 }
 
 struct file_list *
 }
 
 struct file_list *
@@ -571,11 +601,14 @@ do_systemspec(f, fl, first)
        int first;
 {
 
        int first;
 {
 
-       fprintf(f, "%s: Makefile", fl->f_needs);
+       fprintf(f, "%s: Makefile ../machine/symbols.sort", fl->f_needs);
        if (machine == MACHINE_VAX)
        if (machine == MACHINE_VAX)
-               fprintf(f, " ${INLINECMD}", machinename);
-       fprintf(f, " locore.o emulate.o ${OBJS} param.o ioconf.o swap%s.o\n",
-           fl->f_fn);
+               fprintf(f, " ${INLINECMD} locore.o emulate.o");
+       else if (machine == MACHINE_TAHOE)
+               fprintf(f, " ${INLINE} locore.o");
+       else
+               fprintf(f, " locore.o");
+       fprintf(f, " ${OBJS} param.o ioconf.o swap%s.o\n", fl->f_fn);
        fprintf(f, "\t@echo loading %s\n\t@rm -f %s\n",
            fl->f_needs, fl->f_needs);
        if (first) {
        fprintf(f, "\t@echo loading %s\n\t@rm -f %s\n",
            fl->f_needs, fl->f_needs);
        if (first) {
@@ -587,9 +620,16 @@ do_systemspec(f, fl, first)
        case MACHINE_VAX:
                fprintf(f, "\t@${LD} -n -o %s -e start -x -T 80000000 ",
                        fl->f_needs);
        case MACHINE_VAX:
                fprintf(f, "\t@${LD} -n -o %s -e start -x -T 80000000 ",
                        fl->f_needs);
+               fprintf(f,
+                   "locore.o emulate.o ${OBJS} vers.o ioconf.o param.o ");
+               break;
+
+       case MACHINE_TAHOE:
+               fprintf(f, "\t@${LD} -n -o %s -e start -x -T C0000800 ",
+                       fl->f_needs);
+               fprintf(f, "locore.o ${OBJS} vers.o ioconf.o param.o ");
                break;
        }
                break;
        }
-       fprintf(f, "locore.o emulate.o ${OBJS} vers.o ioconf.o param.o ");
        fprintf(f, "swap%s.o\n", fl->f_fn);
        fprintf(f, "\t@echo rearranging symbols\n");
        fprintf(f, "\t@-symorder ../%s/symbols.sort %s\n",
        fprintf(f, "swap%s.o\n", fl->f_fn);
        fprintf(f, "\t@echo rearranging symbols\n");
        fprintf(f, "\t@-symorder ../%s/symbols.sort %s\n",
@@ -616,6 +656,7 @@ do_swapspec(f, name)
        switch (machine) {
 
        case MACHINE_VAX:
        switch (machine) {
 
        case MACHINE_VAX:
+       case MACHINE_TAHOE:
                fprintf(f, "\t${CC} -c -S ${COPTS} ");
                fprintf(f, "../%s/swapgeneric.c\n", machinename);
                fprintf(f, "\t${C2} swapgeneric.s | ${INLINE}");
                fprintf(f, "\t${CC} -c -S ${COPTS} ");
                fprintf(f, "../%s/swapgeneric.c\n", machinename);
                fprintf(f, "\t${C2} swapgeneric.s | ${INLINE}");