Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

README++

  • Loading branch information...
commit 74226882634ad9b6cebacca14ef97db3b0f30269 1 parent 2d991d1
Nathan Rajlich authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 README.md
32 README.md
View
@@ -53,6 +53,9 @@ that:
$ node-gyp configure --target=0.7
```
+__Note__: The `configure` step looks for the first `.gyp` file to processs. See
+below for instructions on the `.gyp` file.
+
Now you will have either a `Makefile` (on Unix platforms) or a
`vcxproj` file (on Windows) in the current directory. Next invoke the `build`
step:
@@ -65,6 +68,9 @@ Now you have your compiled `.node` bindings file! The compiled bindings end up i
`out/Debug` or `out/Release`, depending on the build mode. At this point you can
require the `.node` file with Node and run your tests!
+__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or
+`-d`) switch to `build`.
+
-------------------
__(Optional)__ Copy the compiled bindings into an appropriate directory for
@@ -79,6 +85,32 @@ is `0.7`, then the `copy` command above would copy the bindings from
`out/Release/bindings.node` to `compiled/0.7/darwin/x64/bindings.node`.
+The "gyp" file
+--------------
+
+Previously when node had `node-waf` you had to write a `wscript` file. The
+replacement for that is the `bindings.gyp` file, which describes the configuration
+to build your module in a JSON-like format. A barebones `gyp` file appropriate for
+building a node addon looks like:
+
+``` json
+{
+ 'targets': [
+ {
+ 'target_name': 'bindings',
+ 'sources': [ 'src/bindings.cc' ]
+ }
+ ]
+}
+```
+
+Some additional resources:
+
+ * [Hello World node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)
+ * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)
+ * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)
+
+
Commands
--------
Please sign in to comment.
Something went wrong with that request. Please try again.