title: how I run node-gyp?
body: <p>I follow this link:<a href="http://www.swig.org/Doc3.0/Javascript.html#Javascript_running_swig" rel="nofollow">http://www.swig.org/Doc3.0/Javascript.html#Javascript_running_swig</a>
  to make nodejs extension.So I create a folder test which contain example.c</p>
  
  <pre><code>    #include &lt;time.h&gt;
   double My_variable = 3.0;
  
   int fact(int n) {
       if (n &lt;= 1) return 1;
       else return n*fact(n-1);
   }
  
   int my_mod(int x, int y) {
       return (x%y);
   }
  
   char *get_time()
   {
       time_t ltime;
       time(&amp;ltime);
       return ctime(&amp;ltime);
   }
  </code></pre>
  
  <p>example.i:</p>
  
  <pre><code> %module example
   %{
   /* Put header files here or function declarations like below */
   extern double My_variable;
   extern int fact(int n);
   extern int my_mod(int x, int y);
   extern char *get_time();
   %}
  
   extern double My_variable;
   extern int fact(int n);
   extern int my_mod(int x, int y);
   extern char *get_time();
  </code></pre>
  
  <p>binding.gyp:</p>
  
  <pre><code>    {
    "targets": [
      {
        "target_name": "example",
        "sources": [ "example.cxx", "example_wrap.cxx" ]
      }
    ]
  }
  </code></pre>
  
  <p>I run this command:</p>
  
  <pre><code>sudo npm install -g node-gyp
  </code></pre>
  
  <p>Then:</p>
  
  <pre><code>swig -javascript -node -c++ example.i
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>node-gyp configure
  </code></pre>
  
  <p>when I run node-gyp build I got these errors:</p>
  
  <pre><code>    gyp info it worked if it ends with ok
  gyp info using node-gyp@2.0.2
  gyp info using node@0.12.7 | linux | ia32
  gyp info spawn make
  gyp infomake: Entering directory `/home/slim/test/build'
  make: *** No rule to make target `Release/obj.target/example/example.o', needed by `Release/obj.target/example.node'.  Stop.
  make: Leaving directory `/home/slim/test/build'
   spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:269:23)
  gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
  gyp ERR! System Linux 3.13.0-32-generic
  gyp ERR! command "node" "/usr/bin/node-gyp" "build"
  gyp ERR! cwd /home/slim/test
  gyp ERR! node -v v0.12.7
  gyp ERR! node-gyp -v v2.0.2
  gyp ERR! not ok 
  </code></pre>
  
  <p>I found many posts in this subject but it doesn't work for me,I run npm -g install node-gyp and after I run node-gyp-build but it doesn't work.</p>