Passing flags to the Makefile
to see actual compilation commands:
The default optimizer flag is -Os (optimize for size) which might be inconvenient for debugging as code rearrangement and optimized-out variables
get in the way; to turn off all optimization for easier debugging, call make as 'make OPT=-O0' (disable optimization)
non-standard compiler flags: pass via a DEBUG= argument to make (default is currently = '-g -Wall' - see DEBUG= in src/Makefile?)
non-standard linker flags: pass via a LDFLAGS= argument to make (see LDFLAGS= in src/Makefile?)
for instance, compile and link for gprof profiling, which involves adding '-pg' to compile and link phases:
make V=1 DEBUG='-g -Wall -pg' LDFLAGS="-L"$LD_LIBRARY_PATH" -Wl,-rpath,"$LD_LIBRARY_PATH" -pg"