Skip to content

Commit 5ec2b3f

Browse files
committed
build: set up basic multi-arch/mode build
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>
1 parent 91b2492 commit 5ec2b3f

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

Makefile.build

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ CXX ?= g++
3131
LINK ?= g++
3232
OUTDIR ?= out
3333
TESTJOBS ?=
34-
GYPFLAGS ?=
34+
# TODO(bnoordhuis) Make i18n support configurable.
35+
GYPFLAGS ?= -Dv8_enable_i18n_support=0
3536
TESTFLAGS ?=
3637
ANDROID_NDK_ROOT ?=
3738
ANDROID_NDK_HOST_ARCH ?=
@@ -229,9 +230,16 @@ ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x
229230
NACL_ARCHES = nacl_ia32 nacl_x64
230231

231232
# List of files that trigger Makefile regeneration:
232-
GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \
233-
build/toolchain.gypi samples/samples.gyp src/compiler/compiler.gyp \
234-
src/d8.gyp test/cctest/cctest.gyp tools/gyp/v8.gyp
233+
GYPFILES = \
234+
common.gypi \
235+
deps/cares/cares.gyp \
236+
deps/debugger-agent/debugger-agent.gyp \
237+
deps/http_parser/http_parser.gyp \
238+
deps/openssl/openssl.gyp \
239+
deps/uv/uv.gyp \
240+
deps/v8/tools/gyp/v8.gyp \
241+
deps/zlib/zlib.gyp \
242+
node.gyp \
235243

236244
# If vtunejit=on, the v8vtune.gyp will be appended.
237245
ifeq ($(vtunejit), on)
@@ -403,21 +411,20 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
403411
cut -f 2 -d " " | cut -f 1 -d "-" ))
404412
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
405413
$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
406-
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
407414
GYP_GENERATORS=make \
408-
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
409-
-Ibuild/standalone.gypi --depth=. \
415+
tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \
416+
-Icommon.gypi --depth=. \
417+
-Dtarget_arch=$(V8_TARGET_ARCH) \
410418
-Dv8_target_arch=$(V8_TARGET_ARCH) \
411419
$(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
412420
-Dtarget_arch=$(V8_TARGET_ARCH),) \
413421
$(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \
414422
-S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
415423

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

422429
must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN:
423430
ifndef ANDROID_NDK_ROOT

common.gypi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
'clang%': 0,
1313
'python%': 'python',
1414

15+
'node_tag%': '',
16+
'uv_library%': 'static_library',
17+
18+
# Default to -O0 for debug builds.
19+
'v8_optimized_debug%': 0,
20+
1521
# Enable disassembler for `--print-code` v8 options
1622
'v8_enable_disassembler': 1,
1723

0 commit comments

Comments
 (0)