title: Debug Flag With GCC (compile phase / link phase)
body: <p>I have a this Makefile</p>
  
  <pre><code>application=&lt;somebinaryname&gt;
  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 $&lt; -o $@
  
  # rest of Makefile not relevant to my question
  </code></pre>
  
  <p>Can someone please tell me if the <em>-g</em> 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):</p>
  
  <pre><code>gcc -g -o binary source.cpp
  </code></pre>
  
  <p>I get that, but it doesn't tell me much.</p>
  
  <p>Any more clarity on this?</p>