title: Makefile to generate JSON from Python scripts in separate directories
body: <p>I have a Makefile which generates JSON from several different Python scripts (the scripts print to stdout) in a single directory, e.g.</p>
  
  <pre><code>/src
      scriptOne.py
      scriptTwo.py
      scriptThree.py
  </code></pre>
  
  <p>Which outputs the JSON to a folder:</p>
  
  <pre><code>/templates
     scriptOne.json
     scriptTwo.json
     scriptThree.json
  </code></pre>
  
  <p>I'm trying to restructure so that, for example, each script is in its own subdirectory and the Makefile creates the JSON templates in their consequent subdirectories as follows:</p>
  
  <pre><code>/src
     /importantTemplates
         scriptOne.py 
     /notSoImportantTemplates
         scriptTwo.py
         scriptThree.py
  </code></pre>
  
  <p>And the output:</p>
  
  <pre><code>/templates
     /importantTemplates
         scriptOne.json 
     /notSoImportantTemplates
         scriptTwo.json
         scriptThree.json
  </code></pre>
  
  <p>The current Makefile is as follows:</p>
  
  <pre><code>SOURCES := $(shell echo src/*.py)
  TARGETS := $(patsubst src/%.py,templates/%.json,$(SOURCES))
  
  all: $(TARGETS)
  
  clean:
      rm -f $(TARGETS)
  
  templates/%.json: src/%.py
      python2 $&lt; &gt; $@
  </code></pre>
  
  <p>I've tried changing the wildcards to include a subdirectory for each line e.g. <code>/src/*/*.py</code>, although I just end up with the following:</p>
  
  <pre><code>make: Nothing to be done for `all'.
  </code></pre>