title: Why does my Makefile with pattern rules not create debugging symbols for main?
body: <p>I am using this auto-generated Makefile with pattern rules, that I oviously do not understand yet. I want to create debuggins symbols and then debug main, but it doesn't work. There is a <code>-g</code> flag. Adding <code>$(LDFLAGS)</code> statement above after <code>$(ODIR)</code> does not print one as expcted.</p>
  <pre><code>IDIR =./include                                                                                                                                             
  CC=g++                                                                                                                                                      
  CFLAGS = -I$(IDIR)                                                                                                                                          
  LDFLAGS = -g                                                                                                                                                
                                                                                                                                                              
  ODIR=./                                                                                                                                                     
                                                                                                                                                              
  LIBS=                                                                                                                                                       
                                                                                                                                                              
  _OBJ = main.o                                                                                                                                             
  OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))                                                                                                                       
                                                                                                                                                              
  $(ODIR)/%.o: %.c                                                                                                                                            
          $(CC) -c -o $@ $&lt; $(CFLAGS)                                                                                                                         
                                                                                                                                                              
  main: $(OBJ)                                                                                                                                              
          $(CC) $(LDFLAGS) -o $@ $^ $(CFLAGS) $(LIBS)                                                                                                         
                                                                                                                                                              
  .PHONY: clean                                                                                                                                               
                                                                                                                                                              
  clean:                                                                                                                                                      
          rm -f $(ODIR)/*.o     
  </code></pre>
  <p>This is the terminal output</p>
  <pre><code>g++    -c -o Source.o Source.cpp                                                                                    
  g++ -g -o Source Source.o -I./include 
  </code></pre>