svn commit: r237575 - in projects/bmake: share/mk
usr.sbin/crunch/crunchgen
David E. O'Brien
obrien at FreeBSD.org
Mon Jun 25 22:07:09 UTC 2012
Author: obrien
Date: Mon Jun 25 22:07:09 2012
New Revision: 237575
URL: http://svn.freebsd.org/changeset/base/237575
Log:
MFC: r237574: crunchen uses the same make binary as the rest of the build
Modified:
projects/bmake/share/mk/bsd.crunchgen.mk
projects/bmake/usr.sbin/crunch/crunchgen/crunchgen.c
Directory Properties:
projects/bmake/ (props changed)
Modified: projects/bmake/share/mk/bsd.crunchgen.mk
==============================================================================
--- projects/bmake/share/mk/bsd.crunchgen.mk Mon Jun 25 21:56:36 2012 (r237574)
+++ projects/bmake/share/mk/bsd.crunchgen.mk Mon Jun 25 22:07:09 2012 (r237575)
@@ -105,7 +105,7 @@ $(CONF): Makefile
.MAKEFLAGS:= ${.MAKEFLAGS:N-P}
.ORDER: $(OUTPUTS) objs
$(OUTPUTS): $(CONF)
- MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \
+ MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \
-c $(OUTC) $(CONF)
$(PROG): $(OUTPUTS) objs
Modified: projects/bmake/usr.sbin/crunch/crunchgen/crunchgen.c
==============================================================================
--- projects/bmake/usr.sbin/crunch/crunchgen/crunchgen.c Mon Jun 25 21:56:36 2012 (r237574)
+++ projects/bmake/usr.sbin/crunch/crunchgen/crunchgen.c Mon Jun 25 22:07:09 2012 (r237575)
@@ -92,6 +92,7 @@ char outmkname[MAXPATHLEN], outcfname[MA
char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN];
char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */
char *objprefix; /* where are the objects ? */
+char *path_make;
int linenum = -1;
int goterror = 0;
@@ -127,6 +128,10 @@ int main(int argc, char **argv)
readcache = 1;
*outmkname = *outcfname = *execfname = '\0';
+ path_make = getenv("MAKE");
+ if (path_make == NULL || *path_make == '\0')
+ path_make = "make";
+
p = getenv("MAKEOBJDIRPREFIX");
if (p == NULL || *p == '\0')
objprefix = "/usr/obj"; /* default */
@@ -599,7 +604,8 @@ void gen_outputs(void)
gen_output_makefile();
status("");
fprintf(stderr,
- "Run \"make -f %s\" to build crunched binary.\n", outmkname);
+ "Run \"%s -f %s\" to build crunched binary.\n",
+ path_make, outmkname);
}
/*
@@ -720,16 +726,16 @@ void fillin_program_objs(prog_t *p, char
fprintf(f, "loop:\n\t at echo 'OBJS= '${%s}\n", objvar);
fprintf(f, "crunchgen_objs:\n"
- "\t at cd %s && make -f %s $(BUILDOPTS) $(%s_OPTS)",
- p->srcdir, tempfname, p->ident);
+ "\t at cd %s && %s -f %s $(BUILDOPTS) $(%s_OPTS)",
+ p->srcdir, path_make, tempfname, p->ident);
for (s = p->buildopts; s != NULL; s = s->next)
fprintf(f, " %s", s->str);
fprintf(f, " loop\n");
fclose(f);
- snprintf(line, MAXLINELEN, "cd %s && make -f %s -B crunchgen_objs",
- p->srcdir, tempfname);
+ snprintf(line, MAXLINELEN, "cd %s && %s -f %s -B crunchgen_objs",
+ p->srcdir, path_make, tempfname);
if ((f = popen(line, "r")) == NULL) {
warn("submake pipe");
goterror = 1;
More information about the svn-src-projects
mailing list