title: Makefile - Why is this sub-make not working?
body: <p>I am looking for an explanation of why the sub-make doesn't work as expected. I need the sub-make because I need to run some few check before copying the files to the target directory.</p>
  
  <p>The following works, but I don't have room to do my checks before the copy:</p>
  
  <pre><code>SRC_DIR=../src/
  TRG_DIR=../../../trg/
  
  target1.PREREQUISITES = file11.sth file12.sth file13.sth
  target2.PREREQUISITES = file21.sth file22.sth file23.sth
  
  copyToLocalTraining : $(TRG_DIR)file21.sth
          @echo $(SRC_DIR)file21.sth
          @echo $(TRG_DIR)file21.sth
  
  $(TRG_DIR)% : $(SRC_DIR)%
          @echo cp -fp $^ $@
          @echo ls -ltr $? $@
  
  
  .IGNORE:
  .SUFFIXES: .sfx .sth
  </code></pre>
  
  <p>and the following does not work: </p>
  
  <pre><code>SRC_DIR=../src/
  TRG_DIR=../../../trg/
  
  target1.PREREQUISITES = file11.sth file12.sth file13.sth
  target2.PREREQUISITES = file21.sth file22.sth file23.sth
  
  copyToLocalTraining :
          @echo "My Checks Here"
          $(MAKE) $(TRG_DIR)file21.sth
  
  $(TRG_DIR)% : $(SRC_DIR)%
          @echo cp -fp $^ $@
          @echo ls -ltr $? $@
  
  
  .IGNORE:
  .SUFFIXES: .sfx .sth
  </code></pre>
  
  <p><strong>No rule to make target ../../../trg/file21.sth</strong></p>
  
  <p>I am introducing an intermediate step to see if I make it work but it doesn't:</p>
  
  <pre><code>SRC_DIR=../src/
  TRG_DIR=../../../trg/
  
  target1.PREREQUISITES = file11.sth file12.sth file13.sth
  target2.PREREQUISITES = file21.sth file22.sth file23.sth
  
  copyToLocalTraining :
          @echo "My Checks Here"
          $(MAKE) intermediateStep
  
  intermediateStep : $(TRG_DIR)file21.sth
  
  $(TRG_DIR)% : $(SRC_DIR)%
          @echo cp -fp $^ $@
          @echo ls -ltr $? $@
  
  
  .IGNORE:
  .SUFFIXES: .sfx .sth
  </code></pre>
  
  <p>I get: <strong>No rule to make target intermediateStep</strong></p>