From 80f498e55990b43bc954381d6262d610338d9d68 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Fri, 24 Nov 2006 03:56:25 +0000 Subject: [PATCH] Fix another parallel make problem with the generated make file. Define the xxx_OBJPATHS earlier and then use it in the xxx_make target because each obj is actually made through that. This allows the crunch to work with -j32 on sun4v. The makefile generated is still poor, though. It really shouldn't use the general 'make all' to do the submakes in the app directories being crunched because each of those objects is listed as a dependency in the generated crunch makefile. Doing that really requires a unique rule to generate them. --- usr.sbin/crunch/crunchgen/crunchgen.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index ea20caabaa4d..fc75a6a12d82 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -1017,6 +1017,16 @@ void prog_makefile_rules(FILE *outmk, prog_t *p) p->ident); fprintf(outmk, "\n"); + fprintf(outmk, "%s_OBJPATHS=", p->ident); + if (p->objpaths) + output_strlst(outmk, p->objpaths); + else { + for (lst = p->objs; lst != NULL; lst = lst->next) { + fprintf(outmk, " $(%s_OBJDIR)/%s", p->ident, lst->str); + } + fprintf(outmk, "\n"); + } + if (p->srcdir && p->objs) { fprintf(outmk, "%s_SRCDIR=%s\n", p->ident, p->srcdir); fprintf(outmk, "%s_REALSRCDIR=%s\n", p->ident, p->realsrcdir); @@ -1027,6 +1037,7 @@ void prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "%s_OPTS+=", p->ident); output_strlst(outmk, p->buildopts); } + fprintf(outmk, "$(%s_OBJPATHS): %s_make\n\n", p->ident, p->ident); fprintf(outmk, "%s_make:\n", p->ident); fprintf(outmk, "\t(cd $(%s_SRCDIR) && ", p->ident); if (makeobj) @@ -1048,15 +1059,6 @@ void prog_makefile_rules(FILE *outmk, prog_t *p) p->name); } - fprintf(outmk, "%s_OBJPATHS=", p->ident); - if (p->objpaths) - output_strlst(outmk, p->objpaths); - else { - for (lst = p->objs; lst != NULL; lst = lst->next) { - fprintf(outmk, " $(%s_OBJDIR)/%s", p->ident, lst->str); - } - fprintf(outmk, "\n"); - } if (p->libs) { fprintf(outmk, "%s_LIBS=", p->ident); output_strlst(outmk, p->libs);