@@ -32,6 +32,7 @@ LINK ?= "g++"
32
32
OUTDIR ?= out
33
33
TESTJOBS ?= -j16
34
34
GYPFLAGS ?=
35
+ TESTFLAGS ?=
35
36
36
37
# Special build flags. Use them like this: "make library=shared"
37
38
50
51
ifeq ($(disassembler ) , on)
51
52
GYPFLAGS += -Dv8_enable_disassembler=1
52
53
endif
54
+ # objectprint=on
55
+ ifeq ($(objectprint ) , on)
56
+ GYPFLAGS += -Dv8_object_print=1
57
+ endif
53
58
# snapshot=off
54
59
ifeq ($(snapshot ) , off)
55
60
GYPFLAGS += -Dv8_use_snapshot='false'
@@ -72,12 +77,21 @@ endif
72
77
ifdef soname_version
73
78
GYPFLAGS += -Dsoname_version=$(soname_version )
74
79
endif
80
+ # werror=no
81
+ ifeq ($(werror ) , no)
82
+ GYPFLAGS += -Dwerror=''
83
+ endif
84
+ # presubmit=no
85
+ ifeq ($(presubmit ) , no)
86
+ TESTFLAGS += --no-presubmit
87
+ endif
75
88
76
89
# ----------------- available targets: --------------------
77
90
# - "dependencies": pulls in external dependencies (currently: GYP)
78
91
# - any arch listed in ARCHES (see below)
79
92
# - any mode listed in MODES
80
93
# - every combination <arch>.<mode>, e.g. "ia32.release"
94
+ # - "native": current host's architecture, release mode
81
95
# - any of the above with .check appended, e.g. "ia32.release.check"
82
96
# - default (no target specified): build all ARCHES and MODES
83
97
# - "check": build all targets and run all tests
@@ -103,7 +117,7 @@ CHECKS = $(addsuffix .check,$(BUILDS))
103
117
# File where previously used GYPFLAGS are stored.
104
118
ENVFILE = $(OUTDIR ) /environment
105
119
106
- .PHONY : all check clean dependencies $(ENVFILE ) .new \
120
+ .PHONY : all check clean dependencies $(ENVFILE ) .new native \
107
121
$(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
108
122
$(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES))
109
123
@@ -124,21 +138,31 @@ $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@)
124
138
python -c " print raw_input().capitalize()" ) \
125
139
builddir=" $( shell pwd) /$( OUTDIR) /$@ "
126
140
141
+ native : $(OUTDIR ) /Makefile-native
142
+ @$(MAKE ) -C " $( OUTDIR) " -f Makefile-native \
143
+ CXX=" $( CXX) " LINK=" $( LINK) " BUILDTYPE=Release \
144
+ builddir=" $( shell pwd) /$( OUTDIR) /$@ "
145
+
127
146
# Test targets.
128
147
check : all
129
- @tools/test-wrapper-gypbuild.py $(TESTJOBS ) --outdir=$(OUTDIR )
148
+ @tools/test-wrapper-gypbuild.py $(TESTJOBS ) --outdir=$(OUTDIR ) \
149
+ $(TESTFLAGS )
130
150
131
151
$(addsuffix .check,$(MODES ) ) : $$(basename $$@ )
132
152
@tools/test-wrapper-gypbuild.py $(TESTJOBS ) --outdir=$(OUTDIR ) \
133
- --mode=$(basename $@ )
153
+ --mode=$(basename $@ ) $( TESTFLAGS )
134
154
135
155
$(addsuffix .check,$(ARCHES ) ) : $$(basename $$@ )
136
156
@tools/test-wrapper-gypbuild.py $(TESTJOBS ) --outdir=$(OUTDIR ) \
137
- --arch=$(basename $@ )
157
+ --arch=$(basename $@ ) $( TESTFLAGS )
138
158
139
159
$(CHECKS ) : $$(basename $$@ )
140
160
@tools/test-wrapper-gypbuild.py $(TESTJOBS ) --outdir=$(OUTDIR ) \
141
- --arch-and-mode=$(basename $@ )
161
+ --arch-and-mode=$(basename $@ ) $(TESTFLAGS )
162
+
163
+ native.check : native
164
+ @tools/test-wrapper-gypbuild.py $(TESTJOBS ) --outdir=$(OUTDIR ) /native \
165
+ --arch-and-mode=. $(TESTFLAGS )
142
166
143
167
# Clean targets. You can clean each architecture individually, or everything.
144
168
$(addsuffix .clean,$(ARCHES ) ) :
@@ -147,7 +171,12 @@ $(addsuffix .clean,$(ARCHES)):
147
171
rm -rf $(OUTDIR ) /$(basename $@ ) .debug
148
172
find $(OUTDIR ) -regex ' .*\(host\|target\)-$(basename $@)\.mk' -delete
149
173
150
- clean : $(addsuffix .clean,$(ARCHES ) )
174
+ native.clean :
175
+ rm -f $(OUTDIR ) /Makefile-native
176
+ rm -rf $(OUTDIR ) /native
177
+ find $(OUTDIR ) -regex ' .*\(host\|target\)-native\.mk' -delete
178
+
179
+ clean : $(addsuffix .clean,$(ARCHES ) ) native.clean
151
180
152
181
# GYP file generation targets.
153
182
$(OUTDIR ) /Makefile-ia32 : $(GYPFILES ) $(ENVFILE )
@@ -165,6 +194,10 @@ $(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE)
165
194
-Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \
166
195
-S-arm $(GYPFLAGS )
167
196
197
+ $(OUTDIR ) /Makefile-native : $(GYPFILES ) $(ENVFILE )
198
+ build/gyp/gyp --generator-output=" $( OUTDIR) " build/all.gyp \
199
+ -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS )
200
+
168
201
# Replaces the old with the new environment file if they're different, which
169
202
# will trigger GYP to regenerate Makefiles.
170
203
$(ENVFILE ) : $(ENVFILE ) .new
0 commit comments