Add -MP option

Adds a phony target to every included file, mimicking gcc's
This commit is contained in:
ISSOtm
2019-09-10 02:04:45 +02:00
parent e7eac583da
commit bfa8da78a6
3 changed files with 27 additions and 6 deletions

View File

@@ -337,8 +337,11 @@ FILE *fstk_FindFile(char *fname, char **incPathUsed)
f = fopen(fname, "rb");
if (f != NULL || errno != ENOENT) {
if (dependfile)
if (dependfile) {
fprintf(dependfile, "%s: %s\n", tzObjectname, fname);
if (oGeneratePhonyDeps)
fprintf(dependfile, "%s:\n", fname);
}
return f;
}
@@ -364,8 +367,11 @@ FILE *fstk_FindFile(char *fname, char **incPathUsed)
if (f != NULL || errno != ENOENT) {
if (dependfile) {
fprintf(dependfile, "%s: %s\n", tzObjectname,
path);
fname);
if (oGeneratePhonyDeps)
fprintf(dependfile, "%s:\n", fname);
}
if (incPathUsed)
*incPathUsed = IncludePaths[i];
return f;