@@ -36,6 +36,7 @@ TESTFLAGS ?=
36
36
ANDROID_NDK_ROOT ?=
37
37
ANDROID_TOOLCHAIN ?=
38
38
ANDROID_V8 ?= /data/local/v8
39
+ NACL_SDK_ROOT ?=
39
40
40
41
# Special build flags. Use them like this: "make library=shared"
41
42
@@ -83,22 +84,18 @@ endif
83
84
ifeq ($(gdbjit ) , on)
84
85
GYPFLAGS += -Dv8_enable_gdbjit=1
85
86
endif
86
- # vfp2=off
87
- ifeq ($(vfp2 ) , off)
88
- GYPFLAGS += -Dv8_can_use_vfp2_instructions=false
89
- else
90
- GYPFLAGS += -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2
91
- endif
92
- # vfp3=off
93
- ifeq ($(vfp3 ) , off)
94
- GYPFLAGS += -Dv8_can_use_vfp3_instructions=false
95
- else
96
- GYPFLAGS += -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
87
+ # vtunejit=on
88
+ ifeq ($(vtunejit ) , on)
89
+ GYPFLAGS += -Dv8_enable_vtunejit=1
97
90
endif
98
91
# debuggersupport=off
99
92
ifeq ($(debuggersupport ) , off)
100
93
GYPFLAGS += -Dv8_enable_debugger_support=0
101
94
endif
95
+ # unalignedaccess=on
96
+ ifeq ($(unalignedaccess ) , on)
97
+ GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
98
+ endif
102
99
# soname_version=1.2.3
103
100
ifdef soname_version
104
101
GYPFLAGS += -Dsoname_version=$(soname_version )
@@ -119,13 +116,66 @@ endif
119
116
ifeq ($(regexp ) , interpreted)
120
117
GYPFLAGS += -Dv8_interpreted_regexp=1
121
118
endif
122
- # hardfp=on
123
- ifeq ($(hardfp ) , on)
124
- GYPFLAGS += -Dv8_use_arm_eabi_hardfloat=true
125
- endif
126
- # armv7=false
119
+ # arm specific flags.
120
+ # armv7=false/true
127
121
ifeq ($(armv7 ) , false)
128
122
GYPFLAGS += -Darmv7=0
123
+ else
124
+ ifeq ($(armv7 ) , true)
125
+ GYPFLAGS += -Darmv7=1
126
+ endif
127
+ endif
128
+ # vfp2=off. Deprecated, use armfpu=
129
+ # vfp3=off. Deprecated, use armfpu=
130
+ ifeq ($(vfp3 ) , off)
131
+ GYPFLAGS += -Darm_fpu=vfp
132
+ endif
133
+ # hardfp=on/off. Deprecated, use armfloatabi
134
+ ifeq ($(hardfp ) ,on)
135
+ GYPFLAGS += -Darm_float_abi=hard
136
+ else
137
+ ifeq ($(hardfp ) ,off)
138
+ GYPFLAGS += -Darm_float_abi=softfp
139
+ endif
140
+ endif
141
+ # armneon=on/off
142
+ ifeq ($(armneon ) , on)
143
+ GYPFLAGS += -Darm_neon=1
144
+ endif
145
+ # fpu: armfpu=xxx
146
+ # xxx: vfp, vfpv3-d16, vfpv3, neon.
147
+ ifeq ($(armfpu ) ,)
148
+ ifneq ($(vfp3 ) , off)
149
+ GYPFLAGS += -Darm_fpu=default
150
+ endif
151
+ else
152
+ GYPFLAGS += -Darm_fpu=$(armfpu )
153
+ endif
154
+ # float abi: armfloatabi=softfp/hard
155
+ ifeq ($(armfloatabi ) ,)
156
+ ifeq ($(hardfp ) ,)
157
+ GYPFLAGS += -Darm_float_abi=default
158
+ endif
159
+ else
160
+ GYPFLAGS += -Darm_float_abi=$(armfloatabi )
161
+ endif
162
+ # armthumb=on/off
163
+ ifeq ($(armthumb ) , off)
164
+ GYPFLAGS += -Darm_thumb=0
165
+ else
166
+ ifeq ($(armthumb ) , on)
167
+ GYPFLAGS += -Darm_thumb=1
168
+ endif
169
+ endif
170
+ # armtest=on
171
+ # With this flag set, by default v8 will only use features implied
172
+ # by the compiler (no probe). This is done by modifying the default
173
+ # values of enable_armv7, enable_vfp2, enable_vfp3 and enable_32dregs.
174
+ # Modifying these flags when launching v8 will enable the probing for
175
+ # the specified values.
176
+ # When using the simulator, this flag is implied.
177
+ ifeq ($(armtest ) , on)
178
+ GYPFLAGS += -Darm_test=on
129
179
endif
130
180
131
181
# ----------------- available targets: --------------------
@@ -136,6 +186,7 @@ endif
136
186
# - "native": current host's architecture, release mode
137
187
# - any of the above with .check appended, e.g. "ia32.release.check"
138
188
# - "android": cross-compile for Android/ARM
189
+ # - "nacl" : cross-compile for Native Client (ia32 and x64)
139
190
# - default (no target specified): build all DEFAULT_ARCHES and MODES
140
191
# - "check": build all targets and run all tests
141
192
# - "<arch>.clean" for any <arch> in ARCHES
@@ -149,27 +200,37 @@ ARCHES = ia32 x64 arm mipsel
149
200
DEFAULT_ARCHES = ia32 x64 arm
150
201
MODES = release debug
151
202
ANDROID_ARCHES = android_ia32 android_arm android_mipsel
203
+ NACL_ARCHES = nacl_ia32 nacl_x64
152
204
153
205
# List of files that trigger Makefile regeneration:
154
206
GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \
155
207
preparser/preparser.gyp samples/samples.gyp src/d8.gyp \
156
208
test/cctest/cctest.gyp tools/gyp/v8.gyp
157
209
210
+ # If vtunejit=on, the v8vtune.gyp will be appended.
211
+ ifeq ($(vtunejit ) , on)
212
+ GYPFILES += src/third_party/vtune/v8vtune.gyp
213
+ endif
158
214
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
159
215
BUILDS = $(foreach mode,$(MODES ) ,$(addsuffix .$(mode ) ,$(ARCHES ) ) )
160
216
ANDROID_BUILDS = $(foreach mode,$(MODES ) , \
161
217
$(addsuffix .$(mode ) ,$(ANDROID_ARCHES ) ) )
218
+ NACL_BUILDS = $(foreach mode,$(MODES ) , \
219
+ $(addsuffix .$(mode ) ,$(NACL_ARCHES ) ) )
162
220
# Generates corresponding test targets, e.g. "ia32.release.check".
163
221
CHECKS = $(addsuffix .check,$(BUILDS ) )
164
222
ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS ) )
223
+ NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS ) )
165
224
# File where previously used GYPFLAGS are stored.
166
225
ENVFILE = $(OUTDIR ) /environment
167
226
168
227
.PHONY : all check clean dependencies $(ENVFILE ) .new native \
169
228
$(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
170
229
$(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
171
230
$(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \
172
- must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN
231
+ must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \
232
+ $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \
233
+ must-set-NACL_SDK_ROOT
173
234
174
235
# Target definitions. "all" is the default.
175
236
all : $(MODES )
@@ -213,6 +274,16 @@ $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \
213
274
OUTDIR="$(OUTDIR)" \
214
275
GYPFLAGS="$(GYPFLAGS)"
215
276
277
+ $(NACL_ARCHES ) : $(addprefix $$@ .,$(MODES ) )
278
+
279
+ $(NACL_BUILDS ) : $(GYPFILES ) $(ENVFILE ) \
280
+ Makefile.nacl must-set-NACL_SDK_ROOT
281
+ @$(MAKE ) -f Makefile.nacl $@ \
282
+ ARCH=" $( basename $@ ) " \
283
+ MODE=" $( subst .,,$( suffix $@ ) ) " \
284
+ OUTDIR=" $( OUTDIR) " \
285
+ GYPFLAGS=" $( GYPFLAGS) "
286
+
216
287
# Test targets.
217
288
check : all
218
289
@tools/run-tests.py $(TESTJOBS ) --outdir=$(OUTDIR ) \
@@ -244,12 +315,21 @@ $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
244
315
$(addsuffix .check, $(ANDROID_ARCHES ) ) : \
245
316
$(addprefix $$(basename $$@).,$(MODES)).check
246
317
318
+ $(addsuffix .check, $(NACL_BUILDS ) ) : $$(basename $$@ )
319
+ @tools/run-tests.py $(TESTJOBS ) --outdir=$(OUTDIR ) \
320
+ --arch-and-mode=$(basename $@ ) \
321
+ --timeout=600 --nopresubmit \
322
+ --command-prefix=" tools/nacl-run.py"
323
+
324
+ $(addsuffix .check, $(NACL_ARCHES ) ) : \
325
+ $(addprefix $$(basename $$@).,$(MODES)).check
326
+
247
327
native.check : native
248
328
@tools/run-tests.py $(TESTJOBS ) --outdir=$(OUTDIR ) /native \
249
329
--arch-and-mode=. $(TESTFLAGS )
250
330
251
331
# Clean targets. You can clean each architecture individually, or everything.
252
- $(addsuffix .clean, $(ARCHES ) $(ANDROID_ARCHES ) ) :
332
+ $(addsuffix .clean, $(ARCHES ) $(ANDROID_ARCHES ) $( NACL_ARCHES ) ) :
253
333
rm -f $(OUTDIR ) /Makefile.$(basename $@ )
254
334
rm -rf $(OUTDIR ) /$(basename $@ ) .release
255
335
rm -rf $(OUTDIR ) /$(basename $@ ) .debug
@@ -260,7 +340,7 @@ native.clean:
260
340
rm -rf $(OUTDIR ) /native
261
341
find $(OUTDIR ) -regex ' .*\(host\|target\).native\.mk' -delete
262
342
263
- clean : $(addsuffix .clean, $(ARCHES ) $(ANDROID_ARCHES ) ) native.clean
343
+ clean : $(addsuffix .clean, $(ARCHES ) $(ANDROID_ARCHES ) $( NACL_ARCHES ) ) native.clean
264
344
265
345
# GYP file generation targets.
266
346
OUT_MAKEFILES = $(addprefix $(OUTDIR ) /Makefile.,$(ARCHES ) )
@@ -283,6 +363,18 @@ ifndef ANDROID_TOOLCHAIN
283
363
endif
284
364
endif
285
365
366
+ # Note that NACL_SDK_ROOT must be set to point to an appropriate
367
+ # Native Client SDK before using this makefile. You can download
368
+ # an SDK here:
369
+ # https://developers.google.com/native-client/sdk/download
370
+ # The path indicated by NACL_SDK_ROOT will typically end with
371
+ # a folder for a pepper version such as "pepper_25" that should
372
+ # have "tools" and "toolchain" subdirectories.
373
+ must-set-NACL_SDK_ROOT :
374
+ ifndef NACL_SDK_ROOT
375
+ $(error NACL_SDK_ROOT must be set)
376
+ endif
377
+
286
378
# Replaces the old with the new environment file if they're different, which
287
379
# will trigger GYP to regenerate Makefiles.
288
380
$(ENVFILE ) : $(ENVFILE ) .new
0 commit comments