Skip to content

Commit

Permalink
build: set up basic multi-arch/mode build
Browse files Browse the repository at this point in the history
Make `make -f Makefile.build ia32.release x64.debug` work.  It's not
perfect yet: it requires running `./configure` first and the generated
`config.gypi` is shared across builds.

PR-URL: node-forward/node#24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
bnoordhuis committed Oct 16, 2014
1 parent 91b2492 commit 5ec2b3f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ CXX ?= g++
LINK ?= g++
OUTDIR ?= out
TESTJOBS ?=
GYPFLAGS ?=
# TODO(bnoordhuis) Make i18n support configurable.
GYPFLAGS ?= -Dv8_enable_i18n_support=0
TESTFLAGS ?=
ANDROID_NDK_ROOT ?=
ANDROID_NDK_HOST_ARCH ?=
Expand Down Expand Up @@ -229,9 +230,16 @@ ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x
NACL_ARCHES = nacl_ia32 nacl_x64

# List of files that trigger Makefile regeneration:
GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \
build/toolchain.gypi samples/samples.gyp src/compiler/compiler.gyp \
src/d8.gyp test/cctest/cctest.gyp tools/gyp/v8.gyp
GYPFILES = \
common.gypi \
deps/cares/cares.gyp \
deps/debugger-agent/debugger-agent.gyp \
deps/http_parser/http_parser.gyp \
deps/openssl/openssl.gyp \
deps/uv/uv.gyp \
deps/v8/tools/gyp/v8.gyp \
deps/zlib/zlib.gyp \
node.gyp \

# If vtunejit=on, the v8vtune.gyp will be appended.
ifeq ($(vtunejit), on)
Expand Down Expand Up @@ -403,21 +411,20 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
cut -f 2 -d " " | cut -f 1 -d "-" ))
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \
-Icommon.gypi --depth=. \
-Dtarget_arch=$(V8_TARGET_ARCH) \
-Dv8_target_arch=$(V8_TARGET_ARCH) \
$(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
-Dtarget_arch=$(V8_TARGET_ARCH),) \
$(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \
-S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)

$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \
-Icommon.gypi --depth=. -S.native $(GYPFLAGS)

must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN:
ifndef ANDROID_NDK_ROOT
Expand Down
6 changes: 6 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
'clang%': 0,
'python%': 'python',

'node_tag%': '',
'uv_library%': 'static_library',

# Default to -O0 for debug builds.
'v8_optimized_debug%': 0,

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,

Expand Down

0 comments on commit 5ec2b3f

Please sign in to comment.