title: GNU make call function with multiple arguments and multiple commands
body: <p>I am trying to write a GNU make call function (example below) which has multiple shell commands to execute, such that it can be called with different arguments.</p>
  
  <pre><code>shell_commands = $(shell echo $(1); ls -ltr $(2))
  
  try:
    $(call shell_commands,$(FILE1),$(FILE2))
  </code></pre>
  
  <p>1) Is above the correct way to write a call function with multiple commands? By using a semi-colon to separate them? To make it readable, I write my targets as shown below. Is there a similar way to write a call function?</p>
  
  <pre><code>shell_commands:
    echo $(1)
    ls -ltr $(2)
  </code></pre>
  
  <p>2) I get this error from make when I execute <code>make -B try</code>. It looks like it is trying to execute /home/user/file1. But why?</p>
  
  <pre><code>make: execvp: /home/user/file1: Permission denied
  make: *** [try] Error 127
  </code></pre>
  
  <p>3) Is it possible to pass variable number of parameters to a call function? Like pass in just the second parameter and not the first one.</p>
  
  <pre><code>$(call shell_commands,,$(FILE2))
  </code></pre>
  
  <p>I tried google-ing, searching on SO, and looking on gnu.org but I did not get any solutions. Will appreciate any answers or pointers to any resources which document call function with multiple optional arguments and commands.</p>