OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 # Variable default definitions. Override them by exporting them in your shell. | 29 # Variable default definitions. Override them by exporting them in your shell. |
30 CXX ?= g++ | 30 CXX ?= g++ |
31 LINK ?= g++ | 31 LINK ?= g++ |
32 OUTDIR ?= out | 32 OUTDIR ?= out |
33 TESTJOBS ?= -j16 | 33 TESTJOBS ?= -j16 |
34 GYPFLAGS ?= | 34 GYPFLAGS ?= |
35 TESTFLAGS ?= | 35 TESTFLAGS ?= |
36 ANDROID_NDK_ROOT ?= | 36 ANDROID_NDK_ROOT ?= |
37 ANDROID_TOOL_PREFIX = $(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi | 37 ANDROID_TOOL_PREFIX = $(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi |
| 38 ANDROID_V8 ?= /data/local/v8 |
38 | 39 |
39 # Special build flags. Use them like this: "make library=shared" | 40 # Special build flags. Use them like this: "make library=shared" |
40 | 41 |
41 # library=shared || component=shared_library | 42 # library=shared || component=shared_library |
42 ifeq ($(library), shared) | 43 ifeq ($(library), shared) |
43 GYPFLAGS += -Dcomponent=shared_library | 44 GYPFLAGS += -Dcomponent=shared_library |
44 endif | 45 endif |
45 ifdef component | 46 ifdef component |
46 GYPFLAGS += -Dcomponent=$(component) | 47 GYPFLAGS += -Dcomponent=$(component) |
47 endif | 48 endif |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 GYPFLAGS += -Dv8_interpreted_regexp=1 | 101 GYPFLAGS += -Dv8_interpreted_regexp=1 |
101 endif | 102 endif |
102 | 103 |
103 # ----------------- available targets: -------------------- | 104 # ----------------- available targets: -------------------- |
104 # - "dependencies": pulls in external dependencies (currently: GYP) | 105 # - "dependencies": pulls in external dependencies (currently: GYP) |
105 # - any arch listed in ARCHES (see below) | 106 # - any arch listed in ARCHES (see below) |
106 # - any mode listed in MODES | 107 # - any mode listed in MODES |
107 # - every combination <arch>.<mode>, e.g. "ia32.release" | 108 # - every combination <arch>.<mode>, e.g. "ia32.release" |
108 # - "native": current host's architecture, release mode | 109 # - "native": current host's architecture, release mode |
109 # - any of the above with .check appended, e.g. "ia32.release.check" | 110 # - any of the above with .check appended, e.g. "ia32.release.check" |
110 # - "android": cross-compile for Android/ARM (release mode) | 111 # - "android": cross-compile for Android/ARM |
111 # - default (no target specified): build all DEFAULT_ARCHES and MODES | 112 # - default (no target specified): build all DEFAULT_ARCHES and MODES |
112 # - "check": build all targets and run all tests | 113 # - "check": build all targets and run all tests |
113 # - "<arch>.clean" for any <arch> in ARCHES | 114 # - "<arch>.clean" for any <arch> in ARCHES |
114 # - "clean": clean all ARCHES | 115 # - "clean": clean all ARCHES |
115 | 116 |
116 # ----------------- internal stuff ------------------------ | 117 # ----------------- internal stuff ------------------------ |
117 | 118 |
118 # Architectures and modes to be compiled. Consider these to be internal | 119 # Architectures and modes to be compiled. Consider these to be internal |
119 # variables, don't override them (use the targets instead). | 120 # variables, don't override them (use the targets instead). |
120 ARCHES = ia32 x64 arm mips | 121 ARCHES = ia32 x64 arm mips |
121 DEFAULT_ARCHES = ia32 x64 arm | 122 DEFAULT_ARCHES = ia32 x64 arm |
122 MODES = release debug | 123 MODES = release debug |
| 124 ANDROID_MODES = android.release android.debug |
123 | 125 |
124 # List of files that trigger Makefile regeneration: | 126 # List of files that trigger Makefile regeneration: |
125 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ | 127 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
126 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ | 128 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
127 test/cctest/cctest.gyp tools/gyp/v8.gyp | 129 test/cctest/cctest.gyp tools/gyp/v8.gyp |
128 | 130 |
129 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". | 131 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
130 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) | 132 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
131 # Generates corresponding test targets, e.g. "ia32.release.check". | 133 # Generates corresponding test targets, e.g. "ia32.release.check". |
132 CHECKS = $(addsuffix .check,$(BUILDS)) | 134 CHECKS = $(addsuffix .check,$(BUILDS)) |
(...skipping 26 matching lines...) Expand all Loading... |
159 CXX="$(CXX)" LINK="$(LINK)" \ | 161 CXX="$(CXX)" LINK="$(LINK)" \ |
160 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 162 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
161 python -c "print raw_input().capitalize()") \ | 163 python -c "print raw_input().capitalize()") \ |
162 builddir="$(shell pwd)/$(OUTDIR)/$@" | 164 builddir="$(shell pwd)/$(OUTDIR)/$@" |
163 | 165 |
164 native: $(OUTDIR)/Makefile.native | 166 native: $(OUTDIR)/Makefile.native |
165 @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ | 167 @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ |
166 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ | 168 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ |
167 builddir="$(shell pwd)/$(OUTDIR)/$@" | 169 builddir="$(shell pwd)/$(OUTDIR)/$@" |
168 | 170 |
169 # TODO(jkummerow): add "android.debug" when we need it. | 171 android: $(ANDROID_MODES) |
170 android android.release: $(OUTDIR)/Makefile.android | 172 |
| 173 $(ANDROID_MODES): $(OUTDIR)/Makefile.android |
171 @$(MAKE) -C "$(OUTDIR)" -f Makefile.android \ | 174 @$(MAKE) -C "$(OUTDIR)" -f Makefile.android \ |
172 CXX="$(ANDROID_TOOL_PREFIX)-g++" \ | 175 CXX="$(ANDROID_TOOL_PREFIX)-g++" \ |
173 AR="$(ANDROID_TOOL_PREFIX)-ar" \ | 176 AR="$(ANDROID_TOOL_PREFIX)-ar" \ |
174 RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ | 177 RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ |
175 CC="$(ANDROID_TOOL_PREFIX)-gcc" \ | 178 CC="$(ANDROID_TOOL_PREFIX)-gcc" \ |
176 LD="$(ANDROID_TOOL_PREFIX)-ld" \ | 179 LD="$(ANDROID_TOOL_PREFIX)-ld" \ |
177 LINK="$(ANDROID_TOOL_PREFIX)-g++" \ | 180 LINK="$(ANDROID_TOOL_PREFIX)-g++" \ |
178 » BUILDTYPE=Release \ | 181 » BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
179 » builddir="$(shell pwd)/$(OUTDIR)/android.release" | 182 » python -c "print raw_input().capitalize()") \ |
| 183 » builddir="$(shell pwd)/$(OUTDIR)/$@" |
180 | 184 |
181 # Test targets. | 185 # Test targets. |
182 check: all | 186 check: all |
183 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 187 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
184 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ | 188 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
185 $(TESTFLAGS) | 189 $(TESTFLAGS) |
186 | 190 |
187 $(addsuffix .check,$(MODES)): $$(basename $$@) | 191 $(addsuffix .check,$(MODES)): $$(basename $$@) |
188 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 192 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
189 --mode=$(basename $@) $(TESTFLAGS) | 193 --mode=$(basename $@) $(TESTFLAGS) |
190 | 194 |
191 $(addsuffix .check,$(ARCHES)): $$(basename $$@) | 195 $(addsuffix .check,$(ARCHES)): $$(basename $$@) |
192 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 196 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
193 --arch=$(basename $@) $(TESTFLAGS) | 197 --arch=$(basename $@) $(TESTFLAGS) |
194 | 198 |
195 $(CHECKS): $$(basename $$@) | 199 $(CHECKS): $$(basename $$@) |
196 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 200 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
197 --arch-and-mode=$(basename $@) $(TESTFLAGS) | 201 --arch-and-mode=$(basename $@) $(TESTFLAGS) |
198 | 202 |
| 203 $(addsuffix .sync, $(ANDROID_MODES)): $$(basename $$@) |
| 204 @tools/android-sync.sh $(basename $@) $(OUTDIR) \ |
| 205 $(shell pwd) $(ANDROID_V8) |
| 206 |
| 207 $(addsuffix .check, $(ANDROID_MODES)): $$(basename $$@).sync |
| 208 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 209 --arch-and-mode=$(basename $@) \ |
| 210 --special-command="tools/android-run.py @" |
| 211 |
| 212 android.check: android.release.check android.debug.check |
| 213 |
199 native.check: native | 214 native.check: native |
200 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ | 215 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
201 --arch-and-mode=. $(TESTFLAGS) | 216 --arch-and-mode=. $(TESTFLAGS) |
202 | 217 |
203 # Clean targets. You can clean each architecture individually, or everything. | 218 # Clean targets. You can clean each architecture individually, or everything. |
204 $(addsuffix .clean,$(ARCHES)) android.clean: | 219 $(addsuffix .clean,$(ARCHES)) android.clean: |
205 rm -f $(OUTDIR)/Makefile.$(basename $@) | 220 rm -f $(OUTDIR)/Makefile.$(basename $@) |
206 rm -rf $(OUTDIR)/$(basename $@).release | 221 rm -rf $(OUTDIR)/$(basename $@).release |
207 rm -rf $(OUTDIR)/$(basename $@).debug | 222 rm -rf $(OUTDIR)/$(basename $@).debug |
208 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete | 223 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 266 |
252 # Stores current GYPFLAGS in a file. | 267 # Stores current GYPFLAGS in a file. |
253 $(ENVFILE).new: | 268 $(ENVFILE).new: |
254 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ | 269 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
255 echo "CXX=$(CXX)" >> $(ENVFILE).new | 270 echo "CXX=$(CXX)" >> $(ENVFILE).new |
256 | 271 |
257 # Dependencies. | 272 # Dependencies. |
258 dependencies: | 273 dependencies: |
259 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | 274 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
260 --revision 1282 | 275 --revision 1282 |
OLD | NEW |