Only print make venv message when needed.#867
Merged
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
make venvis calledmake clean-venvThis was added in #856, but because of this change, all other targets that have the
venvtarget as a dependency now print the message saying that the venv exist.If
venvis removed from the. PHONYlist it doesn't get reevaluated and doesn't print the message, but this also applies when it's invoked directly, making the message that suggestsmake clean-venvuseless since it's never printed.I wrestled with
Makefilefor a while, and this PR is the best I came up with. It's intelligible, but has some repetition. I tried to get rid of the repetition by creating a Makefile function:but I couldn't find a way to call it from the other target, since they use a bash
if/elsethat can't be used to call makefile functions.Another option is to create a target instead of the function, and call it with
make target:this works, but it launches another instance of
makeand prints some extra messages likemake[1]: Entering/Leaving directory '/home/user/devguide'-- not very elegant.There are other solutions that I explored, including conditional functions or conditional syntax. There are also other ways of detecting dirs and acting upon their presence/absence, but the intelligibility of all these solutions goes downhill pretty quickly.
So the options are:
create-venvtarget with nestedmakecallsif/elsefrom thevenvtarget, documentmake clean-venv, and hope people figure it out by reading the help