HOL icon indicating copy to clipboard operation
HOL copied to clipboard

Holmakefile INCLUDES cleaner

Open xrchz opened this issue 5 years ago • 1 comments

I propose a mode for Holmake to detect and warn about redundant INCLUDES, i.e., directories that are included but for which no dependencies are found for any targets in the current directory. (I would also propose that missing INCLUDES be printed, but I think those get caught as errors anyway, unless heaps are involved...). Ideally, Holmake could also be instructed to replace the current Holmakefile with a corrected one (with the INCLUDES line stripped of redundant entries).

This could be on by default (e.g., print a warning about redundant INCLUDES even when building ordinary targets, and a reminder of the option to fix the Holmakefile in place), though maybe only makes sense when trying to build all targets.

A reason against doing this would be if INCLUDES are used to build additional directories not just for the sake of dependencies but because they are terminal targets. I don't think this is a common use case, but I'd be happy to learn more.

This could be seen as a grand extension of #384.

xrchz avatar Dec 16 '18 08:12 xrchz

I like idea № 1 (warning about redundant INCLUDES), but cannot abide the idea of Holmake making in-places changes to Holmakefiles for the user. The warning could be turned off with a particular option, which could be part of a CLINE_OPTIONS tag, so that when the rarer situation you describe does arise, the warning can be suppressed in a clean way.

mn200 avatar Dec 31 '18 13:12 mn200