title: For Loop in GNU Makefile -- Gather all Object Files into one Variable Across Mutliple Directories
body: <p>The general idea of what I am trying to be accomplished can hopefully be summed up by this small script.</p>
  
  <pre><code>DIRS = dir1 dir2 dir3 dir4 ...
  OBJS =
  
  all: GENERATE_OBJECT_FILES
  
  GENERATE_OBJECT_FILES: 
          for curr_dir in $(DIRS); \
          do \
                  $(join $(OBJS), `ls $${curr_dir}/*.o`); \
          done
  
          echo $(OBJS);
  </code></pre>
  
  <p>How could I accomplish this with a script within a Makefile?</p>