[Contribution] How do you point to the binary that's being moved to /usr/local/bin?

So, there’s a program that I wanna contribute in a formula called TerminalImageViewer. It builds a binary with make, and with sudo make install it moves the binary to /usr/local/bin. However, when I was implementing this in the formula, I reallized that you need sudo to move a file in that location. But, I still need to point to homebrew which binary is the binary. How do I do that?

make install rules often have an argument to specify the installation location, like for example make install PREFIX=$HOME/…, but it varies from program to program. You’ll need to read the source of the Makefile. Simpler may be to run make but not make install and instead run bin.install "TerminalImageViewer" in the formula. You can also use inreplace to modify the installation location in the Makefile.