I have a this Makefile
application=<somebinaryname>
CXXFLAGS=-g -std=c++14 -Wall -Werror -pedantic
LDFLAGS=-g
auto: $(application)
$(application): main.o aaa.o aab.o aba.o baa.o
$(CXX) $(LDFLAGS) -o $@ $^
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# rest of Makefile not relevant to my question
Can someone please tell me if the -g option is supposed to go during the compilation phase (with CXXFLAGS) or during the link phase (with LDFLAGS)? I looked for examples and documentation everywhere, but they all have very trivial examples like (even the manpage):
gcc -g -o binary source.cpp
I get that, but it doesn't tell me much.
Any more clarity on this?
-g
to both the compiler and linker, two say only give-g
to the compiler. – Kaminski