Exemplo n.º 1
0
void
gen_output_makefile(void)
{
	prog_t *p;
	FILE *outmk;
	char line[MAXLINELEN];

	snprintf(line, MAXLINELEN, "generating %s", outmkname);
	status(line);

	if ((outmk = fopen(outmkname, "w")) == NULL) {
		warn("%s", outmkname);
		goterror = 1;
		return;
	}

	fprintf(outmk, "# %s - generated from %s by crunchgen %s\n\n",
	    outmkname, infilename, CRUNCH_VERSION);

	if (outhdrname[0] != '\0')
		fprintf(outmk, ".include \"%s\"\n", outhdrname);

	top_makefile_rules(outmk);
	for (p = progs; p != NULL; p = p->next)
		prog_makefile_rules(outmk, p);

	fprintf(outmk, "\n# ========\n");
	fclose(outmk);
}
Exemplo n.º 2
0
void 
gen_output_makefile(void)
{
	prog_t         *p;
	FILE           *outmk;

	snprintf(line, sizeof(line), "generating %s", outmkname);
	status(line);

	if ((outmk = fopen(outmkname, "w")) == NULL) {
		perror(outmkname);
		goterror = 1;
		return;
	}
	fprintf(outmk, "# %s - generated from %s by crunchgen %s\n\n",
	    outmkname, infilename, CRUNCH_VERSION);

	top_makefile_rules(outmk);

	for (p = progs; p != NULL; p = p->next)
		prog_makefile_rules(outmk, p);

	fprintf(outmk, "\n# ========\n");
	fclose(outmk);
}