From the [PostGIS manual about *Compiling and Install from source*][1] I get the general procedure to be ...

1. Install postgres
1. get a couple of libraries PostGIS depends on
1. download and extract the PostGIS sources
1. run the `configure` shell script
1. run `make` 

that should build PostGIS against (and only working with) the current installed postgres version.

now my questions

1. will you get something out of the build process that you can move to other machines with the same postgres version (and the required libraries) and use it there as well, or
1. build PostGIS into the running postgres installation and be able to use it on that exact machine in that exact combination?
1. if you want to upgrade PostGIS ... do you have to remove the old version after the migration? if so, how do you do that exactly?


  [1]: http://postgis.net/docs/manual-3.2/postgis_installation.html#PGInstall