I have a question: Many repositories do not include libraries that have debug symbols in them. So that means I have to install them myself, and usually they install into different directories than the libraries I would get from my distribution.
Obviously(?) I want to run my actual application with stripped, optimized libraries, however now my makefiles are written so they work with custom compiled libraries (which include the dbg symbols)…example:
-I/usr/local/include/whatever is now the correct path, but on deployment I think I will need -I/usr/include/whatever
This is just a simple example, but it shows how everything is different on my development machine and on my deployment machine. Surely there must be some solution people have come up with to combat this? Can you help? (other than obvious things like writing if’s into the makefile, that is ugly and errorprone)
I just don’t understand how anyone can work like this. The only solution is to compile everything always myself..?
A debug or release build is normally not decided within the Makefile, but rather by a configure script. That is, you have one source tree and two builds from it, the one build a debug build using debug flags (-O0, -ggdb) of your libraries (via -I, -L, possibly setting the rpath) and the other build being a production build using production flags and the normal environment.
A typical setup would look like: