title: Windows Sublime Text 3 "make: *** No targets specified and no makefile found. Stop."
body: <p>Tons of people have apparently run into this issue for one reason or another, but I have yet to find any answered questions that apply to my particular case. If there's one out there that I missed, I will certainly appreciate being pointed to it (in a respectful manner, preferably).</p>
  
  <p>As the question indicates, I'm using Sublime Text 3 (Stable channel, Build 3059) on a Windows 7 x64 machine. I'm using the <code>make</code> build system for my project because that's what I use on my Mac at work and, while it doesn't necessarily make the most sense on Windows (no pun intended), it really should work with the proper setup.  I realize that I could circumvent this issue by not using <code>make</code>, but I'd prefer to understand what the problem is rather than (or in addition to) just doing something else. Here's some info from the command line (i.e. the plain vanilla Windows Command Prompt):</p>
  
  <pre><code>C:\Users\xt\code\d3&gt;where make
  C:\cygwin64\bin\make.exe
  
  C:\Users\xt\code\d3&gt;echo %path%
  C:\Users\xt\AppData\Roaming\npm;C:\Cygwin64\bin\;C:\Python27\;C:\Python27\Script
  s\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\
  x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\
  WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Sta
  tic;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x8
  6)\Git\bin;C:\julia;C:\Users\xt\AppData\Roaming\npm
  </code></pre>
  
  <p>Note that Windows finds the <code>make</code> command at <code>C:\cygwin64\bin\make.exe</code> and <code>C:\Cygwin64\bin\</code> is also in my PATH. I don't think the capitalization difference is the issue since Sublime Text isn't complaining about being unable to find <code>make</code>, but about not finding a makefile.</p>
  
  <p>Here is the directory structure I'm using</p>
  
  <pre><code>C:\Users\xt\code\d3&gt;ls -R
  .:
  Makefile  README.txt  coffee  css  index.html  js  license.txt
  
  ./coffee:
  index.coffee
  
  ./css:
  style.css
  
  ./js:
  </code></pre>
  
  <p>Note that <code>Makefile</code> does in fact exist in the <code>d3</code> directory. </p>
  
  <p>I open the <code>d3</code> directory in Sublime Text as follows:</p>
  
  <ol>
  <li>Open Sublime Text from the Start menu</li>
  <li>In Sublime Text, File > Open Folder... > C:\Users\xt\code\d3</li>
  <li>Click <code>Makefile</code> in the Sidebar</li>
  </ol>
  
  <p>Here are the contents of <code>Makefile</code>:</p>
  
  <pre><code>.PHONY: all
  all: js/index.js
  
  js/%.js: coffee/%.coffee
      coffee -co $(@D) $&lt;
  
  .PHONY: clean
  clean:
      rm -r js
  </code></pre>
  
  <p>For the record, each recipe line starts with a <code>TAB</code> character, not spaces.</p>
  
  <p>Looking at Tools > Build Systems shows that my current Build System is <code>Automatic</code>. Running Build produces the following output:</p>
  
  <pre><code>make: *** No targets specified and no makefile found.  Stop.
  [Finished in 0.2s with exit code 2]
  [shell_cmd: make]
  [dir: C:\Users\xt\code\d3]    
  [path: C:\Cygwin64\bin\;C:\Python27\;C:\Python27\Scripts\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\julia;C:\Users\xt\AppData\Roaming\npm]
  </code></pre>
  
  <p>So, it's finding the <code>make</code> command, and it's running from the <code>C:\Users\xt\code\d3</code> directory which, as noted before, does contain a makefile called <code>Makefile</code>.</p>
  
  <p>When I try the same thing on the command line, I get the following:</p>
  
  <pre><code>C:\Users\xt\code\d3&gt;make
  coffee -co js coffee/index.coffee
  </code></pre>
  
  <p>... and, to confirm the successful results:</p>
  
  <pre><code>C:\Users\xt\code\d3&gt;ls -R
  .:
  Makefile  README.txt  coffee  css  index.html  js  license.txt
  
  ./coffee:
  index.coffee
  
  ./css:
  style.css
  
  ./js:
  index.js
  </code></pre>
  
  <p>I tried debugging the make process in Sublime Text by creating a new Build System (Tools > Build System > New Build System...) saved as <code>C:\Users\xt\AppData\Roaming\Sublime Text 3\Packages\User\Make (debug).sublime-build</code> with the following content:</p>
  
  <pre><code>{
      "shell_cmd": "make -dr"
  }
  </code></pre>
  
  <p>When I try to build using this new Build System, <code>Make (debug)</code>, I get the following results:</p>
  
  <pre><code>GNU Make 4.0
  Built for x86_64-pc-cygwin
  Copyright (C) 1988-2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  Reading makefiles...
  Updating makefiles....
   Considering target file 'GNUmakefile'.
    File 'GNUmakefile' does not exist.
    Looking for an implicit rule for 'GNUmakefile'.
    No implicit rule found for 'GNUmakefile'.
    Finished prerequisites of target file 'GNUmakefile'.
   Must remake target 'GNUmakefile'.
   Failed to remake target file 'GNUmakefile'.
   Considering target file 'makefile'.
    File 'makefile' does not exist.
    Looking for an implicit rule for 'makefile'.
    No implicit rule found for 'makefile'.
    Finished prerequisites of target file 'makefile'.
   Must remake target 'makefile'.
   Failed to remake target file 'makefile'.
   Considering target file 'Makefile'.
    File 'Makefile' does not exist.
    Looking for an implicit rule for 'Makefile'.
    No implicit rule found for 'Makefile'.
    Finished prerequisites of target file 'Makefile'.
   Must remake target 'Makefile'.
   Failed to remake target file 'Makefile'.
  make: *** No targets specified and no makefile found.  Stop.
  [Finished in 0.2s with exit code 2]
  [shell_cmd: make -dr]
  [dir: C:\Users\xt\code\d3]
  [path: C:\Cygwin64\bin\;C:\Python27\;C:\Python27\Scripts\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\julia;C:\Users\xt\AppData\Roaming\npm]
  </code></pre>
  
  <p>Unsurprisingly, <code>make</code> can't find <code>GNUmakefile</code> or <code>makefile</code>, but for some reason it can't find <code>Makefile</code> either, despite claiming to be running in <code>[dir: C:\Users\xt\code\d3]</code>. For comparison, here's the corresponding command line output:</p>
  
  <pre><code>C:\Users\xt\code\d3&gt;make -dr
  GNU Make 4.0
  Built for x86_64-pc-cygwin
  Copyright (C) 1988-2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  Reading makefiles...
  Reading makefile 'Makefile'...
  Updating makefiles....
   Considering target file 'Makefile'.
    Looking for an implicit rule for 'Makefile'.
    No implicit rule found for 'Makefile'.
    Finished prerequisites of target file 'Makefile'.
   No need to remake target 'Makefile'.
  Updating goal targets....
  Considering target file 'all'.
   File 'all' does not exist.
    Considering target file 'js/index.js'.
     Looking for an implicit rule for 'js/index.js'.
     Trying pattern rule with stem 'index'.
     Trying implicit prerequisite 'coffee/index.coffee'.
     Found an implicit rule for 'js/index.js'.
      Considering target file 'coffee/index.coffee'.
       Looking for an implicit rule for 'coffee/index.coffee'.
       No implicit rule found for 'coffee/index.coffee'.
       Finished prerequisites of target file 'coffee/index.coffee'.
      No need to remake target 'coffee/index.coffee'.
     Finished prerequisites of target file 'js/index.js'.
     Prerequisite 'coffee/index.coffee' is older than target 'js/index.js'.
    No need to remake target 'js/index.js'.
   Finished prerequisites of target file 'all'.
  Must remake target 'all'.
  Successfully remade target file 'all'.
  make: Nothing to be done for 'all'.
  </code></pre>
  
  <p>Here, <code>make</code> finds <code>Makefile</code>, right where we know it is. And that's where I reach the end of my proverbial bag of tricks.</p>
  
  <p>So...thank you to anyone who bothered reading all this, and I appreciate your feedback.</p>