-
Notifications
You must be signed in to change notification settings - Fork 914
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
GNUmakefile: add install target for linux systems #4365
base: dev
Are you sure you want to change the base?
Conversation
Is there a reason you want to put it in a system path, and not effectively run |
On a multi-user system, it might be useful to install the binary on a system path. |
@dkegel-fastly I saw you have been working on the GNUmakefile, thoughts on this PR? |
@@ -36,6 +38,10 @@ GOTESTPKGS ?= ./builder ./cgo ./compileopts ./compiler ./interp ./transform . | |||
# tinygo binary for tests | |||
TINYGO ?= $(call detect,tinygo,tinygo $(CURDIR)/build/tinygo) | |||
|
|||
# isntalltion location defaults | |||
INSTALL_LOCAL_DIR ?= $(HOME)/go/bin/ |
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.
Have you considered providing the old-school standard variables and targets that packagers rely on and experienced "make" users expect?
In particular, I think autoconf-generated configure scripts let users control installation location in two ways
make install prefix=/alternate/directory
make install DESTDIR=/alternate/directory
If I understand correctly, both are needed because the first method works on windows (as it replaces the whole directory including drive letter), and the second is expected by e.g. dh_auto_install, but they might have identical effect for us.
Debian packagers would thank you :-)
See https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Installation-Names.html
and e.g. https://manpages.debian.org/testing/debhelper/dh_auto_install.1.en.html
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.
Gosh darn it, now I remember: GNUmakefile is only for the static build. "Make install" should copy build/TinyGo, not do "go install". Glad you got that right.
Also, using profile and DESTDIR must stack; DESTDIR applies after profile. (It is for package wranglers only.)
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 @dkegel-fastly for the feedback. I should really adapt this patch to the convention utilizing prefix
and DESTDIR
.
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.
also fix the typos in the comments else the dreaded Spelling Police will come after you :-)
Signed-off-by: leongross <[email protected]>
32ab2a1
to
2f28086
Compare
Small PR adding the option to quickly install custom build binaries to the system path, similar to the way the docs describe it. There are 2 options: local and system-wide installation. The default is system-wide installation.