Bug 12354 – rdmd --makedep(end|file) doesn't output empty rules for all source files
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
tools
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-12T14:31:00Z
Last change time
2014-04-24T16:45:34Z
Keywords
industry, pull
Assigned to
nobody
Creator
leandro.lucarella
Comments
Comment #0 by leandro.lucarella — 2014-03-12T14:31:28Z
When using automatic dependencies, if you include an old dependencies file that have a file that was removed, make will issue an error like:
make: *** No rule to make target `missing_file.d', needed by `some_rule'. Stop.
To avoid this there is a popular trick used by GCC consisting in adding empty rules for each source file. Make treats any empty rule (no prerequisites, no actions) as if they were .PHONY (and not issuing any errors), so the effect of doing this is, if a file that was listed as a dependency is gone, a rebuild will be triggered.
rdmd should do the same.
Comment #1 by leandro.lucarella — 2014-03-12T15:04:09Z