1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-16 15:11:52 +00:00

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).
This commit is contained in:
Josef Karthauser 2000-11-03 15:35:27 +00:00
parent 540862484b
commit 65cb078f16
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68285

View File

@ -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);
}