Make dependency checking for the pull-over make's actually work.

The make depend needs to be it's own separate make so it's done before the
main make runs. This also fixes issues w. -j breaking on 'depend <target'.

In addition, force the sub cross-over make to always run or otherwise it'll
never check dependencies once a valid foo.cro has been created.

Bump to 20050208
This commit is contained in:
jmc 2005-02-10 16:03:04 +00:00
parent dc984029fd
commit 1bd5227b67
1 changed files with 17 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: crunchgen.c,v 1.66 2005/01/31 23:48:38 christos Exp $ */
/* $NetBSD: crunchgen.c,v 1.67 2005/02/10 16:03:04 jmc Exp $ */
/*
* Copyright (c) 1994 University of Maryland
* All Rights Reserved.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: crunchgen.c,v 1.66 2005/01/31 23:48:38 christos Exp $");
__RCSID("$NetBSD: crunchgen.c,v 1.67 2005/02/10 16:03:04 jmc Exp $");
#endif
#include <stdlib.h>
@ -52,7 +52,7 @@ __RCSID("$NetBSD: crunchgen.c,v 1.66 2005/01/31 23:48:38 christos Exp $");
#include <sys/param.h>
#include <sys/utsname.h>
#define CRUNCH_VERSION "20050131"
#define CRUNCH_VERSION "20050208"
#define MAXLINELEN 16384
#define MAXFIELDS 2048
@ -993,19 +993,28 @@ prog_makefile_rules(FILE *outmk, prog_t *p)
output_strlst(outmk, p->objs);
}
fprintf(outmk, "%s:\n\t mkdir %s\n", p->ident, p->ident);
fprintf(outmk, "%s_make: %s\n", p->ident, p->ident);
fprintf(outmk, "\tcd %s; printf '.PATH: ${%s_SRCDIR}\\n"
fprintf(outmk, "%s_make: %s .PHONY\n", p->ident, p->ident);
fprintf(outmk, "\t( cd %s; printf '.PATH: ${%s_SRCDIR}\\n"
".CURDIR:= ${%s_SRCDIR}\\n"
".include \"$${.CURDIR}/Makefile\"\\n",
p->ident, p->ident, p->ident);
for (lst = vars; lst != NULL; lst = lst->next)
fprintf(outmk, "%s\\n", lst->str);
fprintf(outmk, "'\\\n");
fprintf(outmk, "\t| ${MAKE} -f- CRUNCHEDPROG=1 DBG=\"${DBG}\" depend ");
fprintf(outmk, "\t| ${MAKE} -f- CRUNCHEDPROG=1 DBG=\"${DBG}\" depend");
fprintf(outmk, " )\n");
fprintf(outmk, "\t( cd %s; printf '.PATH: ${%s_SRCDIR}\\n"
".CURDIR:= ${%s_SRCDIR}\\n"
".include \"$${.CURDIR}/Makefile\"\\n",
p->ident, p->ident, p->ident);
for (lst = vars; lst != NULL; lst = lst->next)
fprintf(outmk, "%s\\n", lst->str);
fprintf(outmk, "'\\\n");
fprintf(outmk, "\t| ${MAKE} -f- CRUNCHEDPROG=1 DBG=\"${DBG}\" ");
if (p->objs)
fprintf(outmk, "${%s_OBJS}\n\n", p->ident);
fprintf(outmk, "${%s_OBJS} ) \n\n", p->ident);
else
fprintf(outmk, "%s.ro\n\n", p->name);
fprintf(outmk, "%s.ro ) \n\n", p->name);
} else
fprintf(outmk, "%s_make:\n\t@echo \"** Using existing objs for %s\"\n\n",
p->ident, p->name);