tinygo
tinygo copied to clipboard
GNUmakefile: add install target for linux systems
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.
# defaults to system installation
make install
# system installation, INSTALL_SYSTEM_DIR defaults to /usr/bin
INSTALL_SYSTEM_DIR=<customDir> make install
# user installation, INSTALL_LOCAL_DIR defaults to $HOME/go/bin
INSTALL_LOCAL=1 INSTALL_LOCAL_DIR=<customDir> make install
Is there a reason you want to put it in a system path, and not effectively run go install (that puts it in $GOBIN)? Putting it in $GOBIN would make much more sense to me (and in fact, I'd use that a lot if it were available).
On a multi-user system, it might be useful to install the binary on a system path.
Especially when uninstalling the tinygo package from the system path via the systems package manager for development purposes.
But the local installation should be replaced by a go install. I still think it is a good idea to wrap this into a make install, since all the rest of the build system is also wrapped into that so it would just make sense.
@dkegel-fastly I saw you have been working on the GNUmakefile, thoughts on this PR?
Hi @leongross are you still working on this PR?
I stalled it due to other work, maybe someone else can pick this up.