Closed
Description
Running something like:
rustc --emit dep-info -o x.o lib.rs
will produce a depfile containing a rule like:
x.o: /path/to/lib.rs /path/to/a.rs /path/to/b.rs
This output has a problem: if a.rs
is deleted from the filesystem and dependencies on it erased from lib.rs
, then make
will attempt to look for a rule to generate a.rs
when we request that things be remade. Not finding one, it will helpfully complain that there is no rule to make a.rs
and exit.
This can, of course, be worked around by clearing out your entire build directory and starting over, but this seems undesirable.
GCC has an option (-MP
) to produce "phony" targets for all the dependencies of the object file; this prevents issues in cases like the above:
x.o: /path/to/lib.rs /path/to/a.rs /path/to/b.rs
/path/to/lib.rs:
/path/to/a.rs:
/path/to/b.rs:
since make
now understands how to "generate" a.rs
if it doesn't find it.
Metadata
Metadata
Assignees
Labels
No labels