Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update distclean rule to preserve tarball contents #1169

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

koutcher
Copy link
Collaborator

... and replace it with new realclean rule.

Closes #1167

Makefile Outdated
$(RM) doc/*.toc configure~
$(RM) config.h config.log config.make config.status config.h.in~

realclean: distclean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @sbakker

I also thought that make clean deletes all generated files, while make distclean preserves things like documentation and configure scripts.

In Tig it's the other way round, which is weird. However, Git does the same, so we should first understand why to see if it makes sense for us to deviate.

AFACT this behavior was originally introduced to Git in git/git@922aa80
this is the log message:

Do not remove distributed configure script

Before this patch the clean target has removed the
configure script that comes with Git tar file.
That made compiling Git for different architectures
inconvenient.
This patch excludes configure from the files to be
deleted by 'make clean' and adds new target 'distclean'
to preserve old functionality.

(if we stick to a separate target, maybe clean-all is a more familiar/discoverable name)

Copy link

@sbakker sbakker Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not stuck on the pristine name, it's just something I saw occasionally (possibly along with mrproper in the Linux kernel source). The Standard Targets section in the GNU make manual defines clean and distclean:

  • clean - delete files created by the Makefile during the build (compilation) process (.o, .a, .so, etc.), but not configuration files.
  • distclean - delete all files that are created by configuring or building the program (so also config.status, but not the configure script). It should return the state of the directory to that of the unpacked tarball.

There's also a maintainer-clean, but even that one is not supposed to delete the configure script. So veryclean is probably the best choice here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

veryclean would be good for me.

@koutcher
Copy link
Collaborator Author

koutcher commented Nov 27, 2021

What makes things a bit more complicated with Tig is the two-stage delivery process which adds generated artefacts that may not be reproducible to the release branch before using it to build the tarball. The current distclean behaviour is consistent from the point view of the master branch but not when you get a tarball. As for the name, I didn't find enough reference to pristine proposed by @sbakker, so I preferred realclean which is mentioned in Make documentation, though often synonym to distclean. With clean-all there is a risk of confusion with the classic make clean all.

... and replace it with new veryclean rule.

Closes jonas#1167
@koutcher koutcher merged commit 53624f2 into jonas:master Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"make distclean" removes too much
3 participants