diff options
author | harti <harti@FreeBSD.org> | 2004-08-09 19:18:19 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-08-09 19:18:19 +0000 |
commit | f6d1039bdc19006c5b5334fcdc56488f9cc89848 (patch) | |
tree | 9ea1c3acb5059a48bbfc2f3e1bb4833e85a70040 /usr.sbin/crunch/crunchgen | |
parent | 8c107931a74f41598439dfd37fdf3399527f7ecb (diff) | |
download | FreeBSD-src-f6d1039bdc19006c5b5334fcdc56488f9cc89848.zip FreeBSD-src-f6d1039bdc19006c5b5334fcdc56488f9cc89848.tar.gz |
Fix a 4.X -> 5.X upgrade problem: crunchgen used to emit a line 'MAKE=make'
or 'env MAKEOBJDIRPREFIX=... make' depending on the setting of
MAKEOBJDIRPREFIX in the environment. In any case this line kills the
original value of ${MAKE}. When during buildworld a new make is built (as
is the case during the upgrade) this causes a wrong make to be picked up
(the first one in the path). Use the same technique as Makefile.inc1:
create a MAKEENV variable and a CRUNCHMAKE that calls ${MAKE} with that
MAKEENV prefixed. Use CRUNCHMAKE instead of MAKE throughout the generated
makefile. This leaves the original ${MAKE} undisturbed.
Diffstat (limited to 'usr.sbin/crunch/crunchgen')
-rw-r--r-- | usr.sbin/crunch/crunchgen/crunchgen.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 078b14f..7984d54 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -927,10 +927,10 @@ void top_makefile_rules(FILE *outmk) if (makeobj) { fprintf(outmk, "MAKEOBJDIRPREFIX?=%s\n", objprefix); - fprintf(outmk, "MAKE=env MAKEOBJDIRPREFIX=$(MAKEOBJDIRPREFIX) " - "make\n"); + fprintf(outmk, "MAKEENV=env MAKEOBJDIRPREFIX=$(MAKEOBJDIRPREFIX)\n"); + fprintf(outmk, "CRUNCHMAKE=$(MAKEENV) $(MAKE)\n"); } else { - fprintf(outmk, "MAKE=make\n"); + fprintf(outmk, "CRUNCHMAKE=$(MAKE)\n"); } if (buildopts) { @@ -990,17 +990,17 @@ void prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "%s_make:\n", p->ident); fprintf(outmk, "\t(cd $(%s_SRCDIR) && ", p->ident); if (makeobj) - fprintf(outmk, "$(MAKE) obj && "); + fprintf(outmk, "$(CRUNCHMAKE) obj && "); fprintf(outmk, "\\\n"); - fprintf(outmk, "\t\t$(MAKE) $(BUILDOPTS) $(%s_OPTS) depend &&", + fprintf(outmk, "\t\t$(CRUNCHMAKE) $(BUILDOPTS) $(%s_OPTS) depend &&", p->ident); fprintf(outmk, "\\\n"); - fprintf(outmk, "\t\t$(MAKE) $(BUILDOPTS) $(%s_OPTS) " + fprintf(outmk, "\t\t$(CRUNCHMAKE) $(BUILDOPTS) $(%s_OPTS) " "$(%s_OBJS))", p->ident, p->ident); fprintf(outmk, "\n"); fprintf(outmk, "%s_clean:\n", p->ident); - fprintf(outmk, "\t(cd $(%s_SRCDIR) && $(MAKE) $(BUILDOPTS) clean cleandepend)\n\n", + fprintf(outmk, "\t(cd $(%s_SRCDIR) && $(CRUNCHMAKE) $(BUILDOPTS) clean cleandepend)\n\n", p->ident); } else { fprintf(outmk, "%s_make:\n", p->ident); |