title: Find files in makefile
body: <p>I'm creating a makefile for GNU make.
  I want to find all files within a directory structure.
  For this I tried:</p>
  <pre><code>find_files_recursive = $(wildcard $(1)/*)$(foreach dir,$(wildcard $(1)/*),$(call find_files_recursive,$(dir)))
  
  $(info $(call find_files_recursive,.))
  </code></pre>
  <p>The problem is that this prints also the directories, not only files. Any ideas how to eliminate directories?</p>
  <p><strong>Edit:</strong>
  I have to create an OS independent solution. So the Unix-way <code>find -type f</code> is no alternative. But it is exactly what I have to solve.</p>
  <p><strong>Used solution:</strong>
  Based on the accepted answer I developed a shorter version:</p>
  <pre><code>find_files_recursive = $(foreach item,$(wildcard $(1)/*),$(if $(wildcard $(item)/.),$(call find_files_recursive,$(item),$(2)),$(item)))
  </code></pre>