binutils-gdb/gprof/gen-c-prog.awk
Daniel Jacobowitz 82fe033f4c 2002-02-10 Daniel Jacobowitz <drow@mvista.com>
* gprof.c: Include "getopt.h" after other includes, so that
	the proper macros are defined.
	* gen-c-prog.awk: Emit a prototype for the generated function.
2002-02-10 18:52:30 +00:00

29 lines
657 B
Awk

NR == 1 {
FS="\"";
print "/* ==> Do not modify this file!! It is created automatically"
printf " from %s using the gen-c-prog.awk script. <== */\n\n", FILE
print "#include <stdio.h>"
print "#include \"ansidecl.h\""
}
{
if (curfun != FUNCTION)
{
if (curfun)
print "}"
curfun = FUNCTION
print ""
print "void ", FUNCTION, "PARAMS ((FILE *));"
print "void";
printf "%s (file)\n", FUNCTION
print " FILE *file;";
print "{";
}
printf " fputs (\"";
for (i = 1; i < NF; i++)
printf "%s\\\"", $i;
printf "%s\\n\", file);\n", $NF;
}
END { print "}" }