diff options
-rw-r--r-- | Makefile | 27 | ||||
-rwxr-xr-x | configure | 14 |
2 files changed, 30 insertions, 11 deletions
@@ -2,6 +2,7 @@ BUILDTYPE ?= Release PYTHON ?= python +NINJA ?= ninja DESTDIR ?= SIGN ?= @@ -22,22 +23,34 @@ endif # to check for changes. .PHONY: node node_g +ifeq ($(USE_NINJA),1) +node: config.gypi + $(NINJA) -C out/Release/ + ln -fs out/Release/node node + +node_g: config.gypi + $(NINJA) -C out/Debug/ + ln -fs out/Debug/node $@ +else node: config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Release V=$(V) ln -fs out/Release/node node node_g: config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Debug V=$(V) - ln -fs out/Debug/node node_g - -config.gypi: configure - ./configure - -out/Debug/node: - $(MAKE) -C out BUILDTYPE=Debug V=$(V) + ln -fs out/Debug/node $@ +endif out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi +ifeq ($(USE_NINJA),1) + touch out/Makefile + $(PYTHON) tools/gyp_node -f ninja +else $(PYTHON) tools/gyp_node -f make +endif + +config.gypi: configure + ./configure install: all $(PYTHON) tools/install.py $@ $(DESTDIR) @@ -167,7 +167,7 @@ parser.add_option("--with-arm-float-abi", parser.add_option("--ninja", action="store_true", - dest="ninja_build", + dest="use_ninja", help="Generate files for the ninja build system") (options, args) = parser.parse_args() @@ -459,10 +459,16 @@ def write(filename, data): write('config.gypi', "# Do not edit. Generated by the configure script.\n" + pprint.pformat(output, indent=2) + "\n") -write('config.mk', "# Do not edit. Generated by the configure script.\n" + - ("BUILDTYPE=%s\n" % ('Debug' if options.debug else 'Release'))) +config = { + 'BUILDTYPE': 'Debug' if options.debug else 'Release', + 'USE_NINJA': str(int(options.use_ninja or 0)), +} +config = '\n'.join(map('='.join, config.iteritems())) + '\n' + +write('config.mk', + '# Do not edit. Generated by the configure script.\n' + config) -if options.ninja_build: +if options.use_ninja: gyp_args = ['-f', 'ninja'] elif os.name == 'nt': gyp_args = ['-f', 'msvs', '-G', 'msvs_version=2010'] |