title: How to get makefile to depend on any files inside a folder
body: <p>I have a simple <code>makefile</code> that I use to build some latex files. The syntax looks like this:</p>
  
  <pre><code>pdf: thesis.tex chapters/a.tex chapters/b.tex chapters/c.tex
      latexmk -pdf -pdflatex="pdflatex thesis.tex
  
  open:
      open thesis.pdf
  </code></pre>
  
  <p>The files inside <code>chapters</code> folder can increase further with <code>d.tex</code>, <code>e.tex</code> and may even contain subfolders <code>f\section1.tex</code>, <code>f\section2.tex</code> etc.</p>
  
  <p>I manually add all the requried tex files inside my <code>thesis.tex</code> like this which is not a problem.</p>
  
  <pre><code>\input{chapters/a.tex}
  \input{chapters/b.tex}
  \input{chapters/c.tex}
  \input{chapters/d.tex}
  \input{chapters/e.tex}
  </code></pre>
  
  <ol>
  <li>How can I get make target <code>pdf</code> to depend upon any file changes inside chapters and its subdirectories?</li>
  <li>How do I write inter task dependency in makefile. If target <code>open</code> depends upon target <code>pdf</code>, how do I write it?</li>
  </ol>