Some tweaks to (hopefully) make the crunchgen-generated makefile

parallel-build-safe.
This commit is contained in:
sommerfeld 2002-05-02 21:18:31 +00:00
parent ab8f2fbc01
commit 508e207b01
1 changed files with 35 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: crunchgen.c,v 1.36 2002/04/29 04:20:56 sommerfeld Exp $ */
/* $NetBSD: crunchgen.c,v 1.37 2002/05/02 21:18:31 sommerfeld Exp $ */
/*
* Copyright (c) 1994 University of Maryland
* All Rights Reserved.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: crunchgen.c,v 1.36 2002/04/29 04:20:56 sommerfeld Exp $");
__RCSID("$NetBSD: crunchgen.c,v 1.37 2002/05/02 21:18:31 sommerfeld Exp $");
#endif
#if HAVE_CONFIG_H
@ -865,14 +865,15 @@ void prog_makefile_rules(FILE *outmk, prog_t *p)
fprintf(outmk, "%s_SRCDIR=%s\n", p->ident, p->srcdir);
fprintf(outmk, "%s_OBJS=", p->ident);
output_strlst(outmk, p->objs);
fprintf(outmk, "%s_make: ${%s_OBJPATHS}\n", p->ident, p->ident);
fprintf(outmk, "${%s_OBJPATHS}: \n", p->ident);
fprintf(outmk, "\tif [ \\! -d %s ]; then mkdir %s; fi; cd %s; \\\n",
p->ident, p->ident, p->ident);
fprintf(outmk, "%s_directory::\n", p->ident);
fprintf(outmk, "\t[ -d %s ] || mkdir %s\n", p->ident, p->ident);
fprintf(outmk, "%s_make:: .MAKE %s_directory\n", p->ident, p->ident);
fprintf(outmk, "\tcd %s; \\\n", p->ident);
fprintf(outmk, "\tprintf \".PATH: ${%s_SRCDIR}\\n.CURDIR:= ${%s_SRCDIR}\\n"
".include \\\"\\$${.CURDIR}/Makefile\\\"\\n\" \\\n", p->ident, p->ident);
fprintf(outmk, "\t| ${MAKE} CRUNCHEDPROG=1 DBG=\"${DBG}\" -f- depend ${%s_OBJS}\n\n",
p->ident);
fprintf(outmk, "${%s_OBJPATHS}:: %s_make\n", p->ident, p->ident);
}
else
fprintf(outmk, "%s_make:\n\t@echo \"** Using existing objs for %s\"\n\n",