Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Move GYP file to the project root
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 8, 2011
1 parent f03ea70 commit db1bf67
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 109 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ node_g
/.project
/.cproject

gyp-mac-tool
tools/gyp
tools/all.Makefile
tools/all.target.mk
tools/node_js2c.host.mk
tools/node_js2c.target.mk
out/
/out

# various stuff that VC++ produces/uses
Debug/
Expand All @@ -36,3 +30,5 @@ ipch/
*.opensdf

/options.gypi
*-nodegyp*
/gyp-mac-tool
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
BUILDTYPE ?= Release

all: out/Makefile
$(MAKE) -C out BUILDTYPE=$(BUILDTYPE)
$(MAKE) -f Makefile-nodegyp BUILDTYPE=$(BUILDTYPE)
-ln -fs out/Release/node node
-ln -fs out/Debug/node node_g

out/Release/node: all

out/Makefile: tools/all.gyp deps/uv/build/all.gyp
out/Makefile: node.gyp deps/uv/build/all.gyp
tools/gyp_node -f make

clean:
Expand Down
182 changes: 86 additions & 96 deletions tools/all.gyp → node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,39 @@
'type': 'executable',

'dependencies': [
'../deps/http_parser/http_parser.gyp:http_parser',
'../deps/v8/tools/gyp/v8.gyp:v8',
'../deps/uv/build/all.gyp:uv',
'deps/http_parser/http_parser.gyp:http_parser',
'deps/v8/tools/gyp/v8.gyp:v8',
'deps/uv/build/all.gyp:uv',
'node_js2c#host',
],

'include_dirs': [
'../src',
'../deps/uv/src/ares',
'src',
'deps/uv/src/ares',
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
],

'sources': [
'../src/cares_wrap.cc',
'../src/handle_wrap.cc',
'../src/node.cc',
'../src/node_buffer.cc',
'../src/node_constants.cc',
'../src/node_dtrace.cc',
'../src/node_extensions.cc',
'../src/node_file.cc',
'../src/node_http_parser.cc',
'../src/node_javascript.cc',
'../src/node_main.cc',
'../src/node_os.cc',
'../src/node_script.cc',
'../src/node_string.cc',
'../src/pipe_wrap.cc',
'../src/stdio_wrap.cc',
'../src/stream_wrap.cc',
'../src/tcp_wrap.cc',
'../src/timer_wrap.cc',
'../src/process_wrap.cc',
'src/cares_wrap.cc',
'src/handle_wrap.cc',
'src/node.cc',
'src/node_buffer.cc',
'src/node_constants.cc',
'src/node_dtrace.cc',
'src/node_extensions.cc',
'src/node_file.cc',
'src/node_http_parser.cc',
'src/node_javascript.cc',
'src/node_main.cc',
'src/node_os.cc',
'src/node_script.cc',
'src/node_string.cc',
'src/pipe_wrap.cc',
'src/stdio_wrap.cc',
'src/stream_wrap.cc',
'src/tcp_wrap.cc',
'src/timer_wrap.cc',
'src/process_wrap.cc',
],

'defines': [
Expand All @@ -118,14 +118,14 @@
[ 'node_use_openssl=="true"', {
'libraries': [ '-lssl', '-lcrypto' ],
'defines': [ 'HAVE_OPENSSL=1' ],
'sources': [ '../src/node_crypto.cc' ],
'sources': [ 'src/node_crypto.cc' ],
}, {
'defines': [ 'HAVE_OPENSSL=0' ]
}],

[ 'OS=="win"', {
'dependencies': [
'../deps/uv/deps/pthread-win32/build/all.gyp:pthread-win32',
'deps/uv/deps/pthread-win32/build/all.gyp:pthread-win32',
],
# openssl is not built using gyp, and needs to be
# built separately and placed outside the hierarchy.
Expand All @@ -138,12 +138,12 @@
'defines!': [ 'HAVE_OPENSSL=1' ],
'defines': [ 'HAVE_OPENSSL=0' ],
'libraries!': [ '-lssl', '-lcrypto' ],
'sources!': [ '../src/node_crypto.cc' ],
'sources!': [ 'src/node_crypto.cc' ],
'sources': [
'../src/platform_win32.cc',
'../src/node_stdio_win32.cc',
'src/platform_win32.cc',
'src/node_stdio_win32.cc',
# file operations depend on eio to link. uv contains eio in unix builds, but not win32. So we need to compile it here instead.
'../deps/uv/src/eio/eio.c',
'deps/uv/src/eio/eio.c',
],
'defines': [
'PTW32_STATIC_LIB',
Expand All @@ -163,18 +163,18 @@
},{ # POSIX
'defines': [ '__POSIX__' ],
'sources': [
'../src/node_cares.cc',
'../src/node_net.cc',
'../src/node_signal_watcher.cc',
'../src/node_stat_watcher.cc',
'../src/node_io_watcher.cc',
'../src/node_stdio.cc',
'../src/node_child_process.cc',
'../src/node_timer.cc'
'src/node_cares.cc',
'src/node_net.cc',
'src/node_signal_watcher.cc',
'src/node_stat_watcher.cc',
'src/node_io_watcher.cc',
'src/node_stdio.cc',
'src/node_child_process.cc',
'src/node_timer.cc'
]
}],
[ 'OS=="mac"', {
'sources': [ '../src/platform_darwin.cc' ],
'sources': [ 'src/platform_darwin.cc' ],
'libraries': [ '-framework Carbon' ],
}]
]
Expand All @@ -186,68 +186,58 @@
'toolsets': ['host'],
'variables': {
'library_files': [
'../src/node.js',
'../lib/_debugger.js',
'../lib/_linklist.js',
'../lib/assert.js',
'../lib/buffer.js',
'../lib/buffer_ieee754.js',
'../lib/child_process_legacy.js',
'../lib/child_process_uv.js',
'../lib/console.js',
'../lib/constants.js',
'../lib/crypto.js',
'../lib/dgram.js',
'../lib/dns_legacy.js',
'../lib/dns_uv.js',
'../lib/events.js',
'../lib/freelist.js',
'../lib/fs.js',
'../lib/http.js',
'../lib/http2.js',
'../lib/https.js',
'../lib/https2.js',
'../lib/module.js',
'../lib/net_legacy.js',
'../lib/net_uv.js',
'../lib/os.js',
'../lib/path.js',
'../lib/punycode.js',
'../lib/querystring.js',
'../lib/readline.js',
'../lib/repl.js',
'../lib/stream.js',
'../lib/string_decoder.js',
'../lib/sys.js',
'../lib/timers_legacy.js',
'../lib/timers_uv.js',
'../lib/tls.js',
'../lib/tty.js',
'../lib/tty_posix.js',
'../lib/tty_win32.js',
'../lib/url.js',
'../lib/util.js',
'../lib/vm.js',
'src/node.js',
'lib/_debugger.js',
'lib/_linklist.js',
'lib/assert.js',
'lib/buffer.js',
'lib/buffer_ieee754.js',
'lib/child_process_legacy.js',
'lib/child_process_uv.js',
'lib/console.js',
'lib/constants.js',
'lib/crypto.js',
'lib/dgram.js',
'lib/dns_legacy.js',
'lib/dns_uv.js',
'lib/events.js',
'lib/freelist.js',
'lib/fs.js',
'lib/http.js',
'lib/http2.js',
'lib/https.js',
'lib/https2.js',
'lib/module.js',
'lib/net_legacy.js',
'lib/net_uv.js',
'lib/os.js',
'lib/path.js',
'lib/punycode.js',
'lib/querystring.js',
'lib/readline.js',
'lib/repl.js',
'lib/stream.js',
'lib/string_decoder.js',
'lib/sys.js',
'lib/timers_legacy.js',
'lib/timers_uv.js',
'lib/tls.js',
'lib/tty.js',
'lib/tty_posix.js',
'lib/tty_win32.js',
'lib/url.js',
'lib/util.js',
'lib/vm.js',
],
},

'actions': [

# {
# 'action_name': 'test',
# 'inputs': [],
# 'outputs': [],
# 'action': [
# 'python',
# '../tools/test.py',
# ],
# },

{
'action_name': 'node_js2c',

'inputs': [
'../tools/js2c.py',
'./tools/js2c.py',
'<@(library_files)',
],

Expand All @@ -263,17 +253,17 @@
[ 'node_use_dtrace=="true"', {
'action': [
'python',
'../tools/js2c.py',
'tools/js2c.py',
'<@(_outputs)',
'<@(library_files)'
],
}, { # No Dtrace
'action': [
'python',
'../tools/js2c.py',
'tools/js2c.py',
'<@(_outputs)',
'<@(library_files)',
'../src/macros.py'
'src/macros.py'
],
}]
],
Expand Down
6 changes: 2 additions & 4 deletions tools/gyp_node
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def run_gyp(args):

if __name__ == '__main__':
args = sys.argv[1:]
args.append(os.path.join(script_dir, 'all.gyp'))
args.append(os.path.join(os.path.abspath(node_root), 'node.gyp'))

options_fn = os.path.abspath(os.path.join(node_root, 'options.gypi'))
if os.path.exists(options_fn):
Expand All @@ -31,12 +31,10 @@ if __name__ == '__main__':
args.append('--depth=' + node_root)

if sys.platform != 'win32':
# Tell gyp to write the Makefiles into output_dir
args.extend(['--generator-output', output_dir])

# Tell make to write its output into the same dir
args.extend(['-Goutput_dir=' + output_dir])

args.append('-S-nodegyp')
args.append('-Dtarget_arch=ia32')
args.append('-Dcomponent=static_library')
args.append('-Dlibrary=static_library')
Expand Down

0 comments on commit db1bf67

Please sign in to comment.