I am trying to make software install to a specific directory. I found several ways, but not sure what are the differences between them.
./configure --pre
From openssl/INSTALL
Package builders who want to configure the library for standard locations, but have the package installed somewhere else so that it can easily be packaged, can use
$ make INSTALL_PREFIX=/tmp/package-root install
(or specify "--install_prefix=/tmp/package-root" as a configure option). The specified prefix will be prepended to all installation target filenames.
This is non-standard but INSTALL_PREFIX is used in some other programs.
This works for OpenSSL versions before 1.1.x. OpenSSL 1.1.x and later are able to recognize usual DESTDIR
.