3 ms·
But it is a bug in your Makefile to assume a particular version of a tool (or path to a tool, etc) without first checking (or otherwise forcing the correct thin
by SAI_Peregrinus 4y ago
But it is a bug in your Makefile to assume a particular version of a tool (or path to a tool, etc) without first checking (or otherwise forcing the correct thing to be used).
For forcing the existence of tools, you can start your Makefile by setting up $PATH with the dependencies your script has (everything not guaranteed by POSIX, for example). E.g. with Nix
`export PATH := $(shell nix-shell -p DEPENDENCY1 DEPENDENCY2 --run 'echo $$PATH')`
Will cause `make` to include DEPENDENCY1 and DEPENDENCY2 from the Nix store in $PATH for the rest of the Makefile. You can get more complex and pin particular versions where it matters.
Other cross-platform package management tools presumably have similar tricks that can be used, or you can bundle binaries for the tools you need. Then your build instructions only need to tell the user to have Make and the package management tool installed, and everything else can be set up in the Makefile.
Of course this is a PITA.