title: Gnu Make and z/OS USS make
body: <p>1) We have a need for Makefiles to build C++ on both z/OS USS and a Linux platform. Is it advisable to use gnu make on z/OS USS in order to keep our makefiles common ? </p>
  
  <p>2) If the Makefiles are common, then some steps in the Makefiles, would still be conditional to the platform. Can we do that by steps that are similar to conditional compilation? If yes, can we please get help with the syntax? </p>
  
  <p>3) Our z/OS USS Makefiles have shell scripts or groups of commands, as in example below, with the square brackets [] presenting the commands to the shell as a group, rather than one line at a time. It seems that using the GNU make, we had to modify these commands to become one line, which is messy, and the nested loop was a problem. Is there an easier way to group commands using gmake? </p>
  
  <pre><code>  [ 
    dirs=$(targets) 
    rc=0 
    for dir in $$dirs 
    do 
      cd $$dir/src 
      make -r 
      rc=$$? 
      if [ $$rc != 0 ]; then 
        echo "build failed for directory:" $$dir: 
        break; 
      fi 
      cd ../..
     done 
     echo "return code from make = " $$rc 
   ]
  </code></pre>