title: How to simplify listing of dependencies in make file
body: <p><strong>Goal</strong> </p>
  
  <p>I am trying to use a Make file to automate the generation of a panel figure. The data and figures are generated from Rscripts and subsequently combined using latex to generate a PDF. </p>
  
  <p><strong>Problem description</strong></p>
  
  <p>Let's say, I would like to generate a panel figure consisting of 4 subfigures, arranged in a 2x2 grid. By using the following make file, I am able to generate the data as well as the subfigures:</p>
  
  <pre><code>all : data/plot1.txt plots/plot1.pdf \
  data/plot2.txt plots/plot2.pdf \
  data/plot3.txt plots/plot3.pdf \
  data/plot4.txt plots/plot4.pdf \
  plots/figure_5.pdf
  
  #Panel Figure#
  
  #Plot 1
  data/plot1.txt : scripts/plot1_sim.R
      Rscript scripts/plot1_sim.R $@
  
  plots/plot1.pdf : scripts/plot1_sim.R data/plot1.txt
      Rscript scripts/plot1.R $@
  
  #Plot 2
  data/plot2.txt : scripts/plot2_sim.R
      Rscript scripts/plot2_sim.R $@
  
  plots/plot2.pdf : scripts/plot2_sim.R data/plot2.txt
      Rscript scripts/plot2.R $@
  
  #Plot 3
  data/plot3.txt : scripts/plot3_sim.R
      Rscript scripts/plot3_sim.R $@
  
  plots/plot3.pdf : scripts/plot3_sim.R data/plot3.txt
      Rscript scripts/plot3.R $@
  
  #Plot 4
  data/plot4.txt : scripts/plot4_sim.R
      Rscript scripts/plot4_sim.R $@
  
  plots/plot4.pdf : scripts/plot4_sim.R data/plot4.txt
      Rscript scripts/plot4.R $@
  </code></pre>
  
  <p>Using a latex file, e.g. <code>figure.tex</code> I am able to compile a panel figure as desired.</p>
  
  <p>However, now I would like to add the construction of the final PDF by latex to the make file. This file is, of course, dependent on <code>plots/plot1.pdf</code> up to and including <code>plots/plot4.pdf</code>. </p>
  
  <p>I added it to the code like this:</p>
  
  <pre><code>plots/figure.pdf : scripts/figure.tex plots/plot1.pdf plots/plot2.pdf plots/plot3.pdf plots/plot4.pdf
      pdflatex scripts/figure.tex
  </code></pre>
  
  <p>With four subfigures it is doable (but maybe ugly) to do it like this, but if you generate a panel figure with e.g. 16 subfigures, the code becomes unreadable. </p>
  
  <p><strong>Question</strong></p>
  
  <p>Is there a better way to include a larger list of dependencies, in this case for generating panel figures using make and latex?</p>