summaryrefslogtreecommitdiffstats
path: root/usr.sbin/crunch
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-11-03 15:35:27 +0000
committerjoe <joe@FreeBSD.org>2000-11-03 15:35:27 +0000
commita39072b06dbbedcedf43501eb8cafd7287850ec3 (patch)
treea95ab31b8048259097e1da4226abcede448adb93 /usr.sbin/crunch
parentea844cd6741e5416239d1118fcd8329a11a932a2 (diff)
downloadFreeBSD-src-a39072b06dbbedcedf43501eb8cafd7287850ec3.zip
FreeBSD-src-a39072b06dbbedcedf43501eb8cafd7287850ec3.tar.gz
A missing feature of crunchgen was the ability to supply make options on
a per program basis. This has now been added in the following way: * Harness the make header file that's specified with the -h argument: - Allow the user to define $(OPTS) to specify make arguments that should be added to every program target. - Allow the user to define $(prog_OPTS) to specify make arguments that should just be added to the build of 'prog'. * Make sure that $(OPTS) and $(prog_OPTS) are defined when looking through each program's make file to determine which object files to crunch. * When building the crunchgen makefile add $(OPTS) and $(prog_OPTS) to the depend and build rules for $(prog_OBJS).
Diffstat (limited to 'usr.sbin/crunch')
-rw-r--r--usr.sbin/crunch/crunchgen/crunchgen.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c
index be25005..ae7b0cb 100644
--- a/usr.sbin/crunch/crunchgen/crunchgen.c
+++ b/usr.sbin/crunch/crunchgen/crunchgen.c
@@ -572,7 +572,9 @@ void fillin_program_objs(prog_t *p, char *path)
fprintf(f, ".if defined(PROG) && !defined(%s)\n", objvar);
fprintf(f, "%s=${PROG}.o\n", objvar);
fprintf(f, ".endif\n");
- fprintf(f, "crunchgen_objs:\n\t@echo 'OBJS= '${%s}\n", objvar);
+ fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar);
+ fprintf(f, "crunchgen_objs:\n\t@make -f %s $(OPTS) $(%s_OPTS) loop\n",
+ tempfname, p->ident);
fclose(f);
sprintf(line, "make -f %s crunchgen_objs 2>&1", tempfname);
@@ -809,8 +811,10 @@ void prog_makefile_rules(FILE *outmk, prog_t *p)
fprintf(outmk, "%s_OBJS=", p->ident);
output_strlst(outmk, p->objs);
fprintf(outmk, "%s_make:\n", p->ident);
- fprintf(outmk, "\t(cd $(%s_SRCDIR) && make depend && make $(%s_OBJS))\n",
- p->ident, p->ident);
+ fprintf(outmk, "\t(cd $(%s_SRCDIR) && make obj && \\\n"
+ "\t\tmake $(OPTS) $(%s_OPTS) depend && \\\n"
+ "\t\tmake $(OPTS) $(%s_OPTS) $(%s_OBJS))\n",
+ p->ident, p->ident, p->ident, p->ident);
fprintf(outmk, "%s_clean:\n", p->ident);
fprintf(outmk, "\t(cd $(%s_SRCDIR) && make clean)\n\n", p->ident);
}
OpenPOWER on IntegriCloud