checkpoint for pmake
[unix-history] / usr / src / usr.sbin / config / mkmakefile.c
index 934883c..4acf9e5 100644 (file)
@@ -1,12 +1,23 @@
 /*
 /*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1980,1990 Regents of the University of California.
+ * 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.15 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)mkmakefile.c       5.26 (Berkeley) %G%";
+#endif /* not lint */
 
 /*
  * Build the makefile for the system, from
 
 /*
  * Build the makefile for the system, from
@@ -18,6 +29,7 @@ static char sccsid[] = "@(#)mkmakefile.c      5.15 (Berkeley) %G%";
 #include <ctype.h>
 #include "y.tab.h"
 #include "config.h"
 #include <ctype.h>
 #include "y.tab.h"
 #include "config.h"
+#include "pathnames.h"
 
 #define next_word(fp, wd) \
        { register char *word = get_word(fp); \
 
 #define next_word(fp, wd) \
        { register char *word = get_word(fp); \
@@ -159,9 +171,7 @@ makefile()
                if (profiling && strncmp(line, "COPTS=", 6) == 0) {
                        register char *cp;
 
                if (profiling && strncmp(line, "COPTS=", 6) == 0) {
                        register char *cp;
 
-                       fprintf(ofp, 
-                           "GPROF.EX=/usr/src/lib/libc/%s/csu/gmon.ex\n",
-                           machinename);
+                       fprintf(ofp, _PATH_GPROF, machinename);
                        cp = index(line, '\n');
                        if (cp)
                                *cp = 0;
                        cp = index(line, '\n');
                        if (cp)
                                *cp = 0;
@@ -388,7 +398,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;
                }
@@ -432,7 +442,7 @@ do_cfiles(fp)
                }
        for (fl = conf_list; fl; fl = fl->f_next)
                if (fl->f_type == SYSTEMSPEC) {
                }
        for (fl = conf_list; fl; fl = fl->f_next)
                if (fl->f_type == SYSTEMSPEC) {
-                       sprintf(swapname, "swap%s.c", fl->f_fn);
+                       (void) sprintf(swapname, "swap%s.c", fl->f_fn);
                        if ((len = 3 + strlen(swapname)) + lpos > 72) {
                                lpos = 8;
                                fputs("\\\n\t", fp);
                        if ((len = 3 + strlen(swapname)) + lpos > 72) {
                                lpos = 8;
                                fputs("\\\n\t", fp);
@@ -480,7 +490,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);
@@ -590,9 +600,9 @@ 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, " ${INLINE} locore.o emulate.o");
+               fprintf(f, " ${INLINECMD} locore.o emulate.o");
        else if (machine == MACHINE_TAHOE)
                fprintf(f, " ${INLINE} locore.o");
        else
        else if (machine == MACHINE_TAHOE)
                fprintf(f, " ${INLINE} locore.o");
        else
@@ -621,8 +631,7 @@ do_systemspec(f, fl, first)
        }
        fprintf(f, "swap%s.o\n", fl->f_fn);
        fprintf(f, "\t@echo rearranging symbols\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",
-           machinename, fl->f_needs);
+       fprintf(f, "\t@-symorder machine/symbols.sort %s\n", fl->f_needs);
        fprintf(f, "\t@size %s\n", fl->f_needs);
        fprintf(f, "\t@chmod 755 %s\n\n", fl->f_needs);
        do_swapspec(f, fl->f_fn);
        fprintf(f, "\t@size %s\n", fl->f_needs);
        fprintf(f, "\t@chmod 755 %s\n\n", fl->f_needs);
        do_swapspec(f, fl->f_fn);