We’re doing one of those here for all compiled languages in a month. I’m starting work on the materials this week. I can send you what we come up with. Need at least configure to tell them they need to use --prefix but that’s as far as we’ll go with those tools.
Here is nice intro to compiling and linking in c++ : https://github.com/green7ea/cpp-compilation
Here is a small detour towards understanding how shared libraries work : https://amir.rachum.com/blog/2016/09/17/shared-libraries/
Finally, spack has an excellent overview of multiple build systems for a large variety of programming languages here : https://spack.readthedocs.io/en/latest/build_systems.html