Emit spaces for -MD

TCCs make dependency generator is incompatible with the GNU
depcomp script which is widely used.  For TCC it has to go over
the output of -MD, (it detects it as ICC compatible), but the
sed commands it uses are confused by tabs in the output, so that
some rewrites aren't done.

Those tabs will then finally confuse make itself when the
generated .d files are included.  It reads them as goal commands
(leading tab), and is totally lost then.

Short of changing depcomp (hard because distributed with all kinds
of software), simply emit spaces for -MD.
This commit is contained in:
Michael Matz 2012-05-13 02:03:47 +02:00
parent 9ca9c82ff8
commit 0394caf784

View File

@ -1667,7 +1667,7 @@ PUB_FUNC void tcc_gen_makedeps(TCCState *s, const char *target, const char *file
fprintf(depout, "%s : \\\n", target);
for (i=0; i<s->nb_target_deps; ++i)
fprintf(depout, "\t%s \\\n", s->target_deps[i]);
fprintf(depout, " %s \\\n", s->target_deps[i]);
fprintf(depout, "\n");
fclose(depout);
}