diff options
author | obrien <obrien@FreeBSD.org> | 2012-06-25 22:07:09 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2012-06-25 22:07:09 +0000 |
commit | ad273a91614629640b48f57aa80aee1941fdee78 (patch) | |
tree | 38dc3f280ee1ac2a7a70f46b81112346682b3f63 /usr.sbin | |
parent | bd3a5ebcffb46c17e5d0570df8e96ee4d9351582 (diff) | |
download | FreeBSD-src-ad273a91614629640b48f57aa80aee1941fdee78.zip FreeBSD-src-ad273a91614629640b48f57aa80aee1941fdee78.tar.gz |
MFC: r237574: crunchen uses the same make binary as the rest of the build
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/crunch/crunchgen/crunchgen.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 752acc6..2440b3e 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -92,6 +92,7 @@ char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; 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 *path) fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar); fprintf(f, "crunchgen_objs:\n" - "\t@cd %s && make -f %s $(BUILDOPTS) $(%s_OPTS)", - p->srcdir, tempfname, p->ident); + "\t@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; |