One option is to make a deb package.
Another option is to compile the application to a directory of its own. This is a good idea whenever you compile something without using a package manager. Most open source applications use automake and autoconf with typical configurations and default to installing under
/usr/local. You can usually configure the application to install to a different directory by passing
--prefix=… to the
Stow is a program that manages symbolic links for packages installed in their own directory, so if myapp has a binary that gets installed as
stow myapp-4.2 in the
/usr/local/stow directory will create a symbolic link to that binary in
/usr/local/bin. See Keeping track of programs for more information about stow.
Once you've installed the program in its own directory, you can easily build a zip or tar archive of it and unpack it on another machine. Run stow on the other machine as well.
Note that compiling a program on one system may produce executables that don't work on the other systems. Between two installations of the same version of the same distribution, you won't have any problem. But if the systems have different versions of shared libraries, the binary will sometimes not work on the other machine for lack of the required libraries. You can get around this by linking some libraries statically or by installing the right development packages on the build machine.