-
Couldn't load subscription status.
- Fork 7.3k
Add make (un)install targets for POSIX systems #2455
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! In the future, it would be very useful to describe your PR, or possibly link to an issue that this is solving. We generally do not accept PRs that are not linked to any particular issue.
Would this be addressing #293? Do you think an uninstall target would make sense too?
Makefile
Outdated
| .PHONY: install install-strip install-dirs | ||
| install-dirs: | ||
| install -d ${DESTDIR}${bindir} | ||
| install-strip: install-dirs bin/gh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on why separate targets install-dirs and install-strip are useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directories need to be created by all install targets, that's the only reason to have a install-dirs target.
install-strip is provided by autotools, so I thought it may be a good idea to support that too.
|
Yes, it's addressing #293, although I didn't see that ticket at the time of making the PR. I'll add the |
|
@ismaell Just remembered: if there was an |
4e75d11 to
3767d01
Compare
Ok, I'll address that next. 😁 |
|
@mislav any ideas on how to track manpages for uninstalling and for preventing the manpages rule to run needlessly? |
3767d01 to
b555025
Compare
|
Maybe it's a good idea to merge this PR then I make another one for the manpages. |
The implementation imitates the behavior of build-systems generated by GNU Automake. Implemented targets: - install - install-strip - uninstall Implemented variables: - DESTDIR - prefix - bindir - INSTALL_STRIP_FLAG Internal implementation details: - install-bins variable collects user binaries to be installed - install-dirs variable collects directories to be created
b555025 to
8d2881d
Compare
|
I've addressed the need to track manual page files by creating a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
I've pushed a commit to simplify things. I wanted to avoid adding additional make target install-strip (since it's unnecessary for now), tracking binaries via install-bins/remove-bins (since it's unlikely that we're going to ship more binaries in the near future), and needing an intermediate file manpages.list (we simply remove man pages named gh*.1 while uninstalling).
Your version of the Makefile was definitely more sophisticated and suitable for a larger project, but for sake of maintainability, for our purposes it's best if it's simple as possible.
The implementation imitates the behavior of build-systems generated by GNU Automake.
Installs and uninstalls binaries and manual pages.
Implemented targets:
installinstall-stripuninstallImplemented variables:
DESTDIRprefix(default:/usr/local)bindir(default:${prefix}/bin)mandir(default:${prefix}/share/man)INSTALL_STRIP_FLAG