canonical / sphinx-docs-starter-pack

A documentation starter-pack
https://canonical-starter-pack.readthedocs-hosted.com/
Other
15 stars 40 forks source link

Makefile improvements #78

Closed akcano closed 1 year ago

ru-fu commented 1 year ago

Do you want to have another look before I merge @evildmp ?

evildmp commented 1 year ago

I think we are getting to a stage where there is danger of introducing more complexity than is really warranted. We don't need this to be bulletproof. I'd like the knowledge of what is happening and why not to be obscured from the user.

That said, this looks like a reasonable balance to arrive at.

One thing that I find a bit unsatisfactory: there is no intuitive distinction between the commands clean and clean-doc. Cleaning means doing some ordinary housework, like removing some build files. Deleting and rebuilding a virtualenv is a much more substantial piece of work.

ru-fu commented 1 year ago

One thing that I find a bit unsatisfactory: there is no intuitive distinction between the commands clean and clean-doc. Cleaning means doing some ordinary housework, like removing some build files. Deleting and rebuilding a virtualenv is a much more substantial piece of work.

In Makefiles, clean is usually "get rid of everything" - so it makes sense that this gets rid of the virtualenv. And I personally need the clean-doc very frequently, since it's the quickest way to do a "clean" build that rebuilds all files. And for that, you need to get rid of the output files, but there's no need to delete the virtualenv.

akcano commented 1 year ago

In Makefiles, clean is usually "get rid of everything" - so it makes sense that this gets rid of the virtualenv. And I personally need the clean-doc very frequently, since it's the quickest way to do a "clean" build that rebuilds all files. And for that, you need to get rid of the output files, but there's no need to delete the virtualenv.

I concur; there's obviously a need to keep the two targets. However, I believe that GNU lore has a solution:

For example, here ‘make cleanall’ will delete the object files, the difference files, and the file program:

.PHONY: cleanall cleanobj cleandiff

cleanall : cleanobj cleandiff
        rm program

Thus, we have clean for intermediate build artifacts and cleanall for some serious cleanup.

ru-fu commented 1 year ago

I don't care about the target names, as long as I have a way to do a clean build without having to install all prereqs again. ;)

lblythen commented 1 year ago

clean is near-universal for "clean everything"; I've seen cleanall and had to use it but it's rare. Do we have artefacts, intermediate between what clean and clean-doc currently get rid of, that call for extra targets? If not, I'd say follow convention and avoid complexity.

akcano commented 1 year ago

I think I'm fine with the current clean* target names.

ru-fu commented 1 year ago

Let's get this in - the clean targets haven't changed, and we can take this discussion up again later if we see they cause confusion.