Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: Makefile

Issue 10382121: Add Android cross-compilation support for x86 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android-arm.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 27
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
38 37
39 # Special build flags. Use them like this: "make library=shared" 38 # Special build flags. Use them like this: "make library=shared"
40 39
41 # library=shared || component=shared_library 40 # library=shared || component=shared_library
42 ifeq ($(library), shared) 41 ifeq ($(library), shared)
43 GYPFLAGS += -Dcomponent=shared_library 42 GYPFLAGS += -Dcomponent=shared_library
44 endif 43 endif
45 ifdef component 44 ifdef component
46 GYPFLAGS += -Dcomponent=$(component) 45 GYPFLAGS += -Dcomponent=$(component)
47 endif 46 endif
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 GYPFLAGS += -Dv8_no_strict_aliasing=1 95 GYPFLAGS += -Dv8_no_strict_aliasing=1
97 endif 96 endif
98 97
99 # ----------------- available targets: -------------------- 98 # ----------------- available targets: --------------------
100 # - "dependencies": pulls in external dependencies (currently: GYP) 99 # - "dependencies": pulls in external dependencies (currently: GYP)
101 # - any arch listed in ARCHES (see below) 100 # - any arch listed in ARCHES (see below)
102 # - any mode listed in MODES 101 # - any mode listed in MODES
103 # - every combination <arch>.<mode>, e.g. "ia32.release" 102 # - every combination <arch>.<mode>, e.g. "ia32.release"
104 # - "native": current host's architecture, release mode 103 # - "native": current host's architecture, release mode
105 # - any of the above with .check appended, e.g. "ia32.release.check" 104 # - any of the above with .check appended, e.g. "ia32.release.check"
106 # - "android": cross-compile for Android/ARM (release mode) 105 # - "android-arm": cross-compile for Android/ARM (release mode)
106 # - "android-ia32": cross-compile for Android/IA32 (release mode)
107 # - default (no target specified): build all DEFAULT_ARCHES and MODES 107 # - default (no target specified): build all DEFAULT_ARCHES and MODES
108 # - "check": build all targets and run all tests 108 # - "check": build all targets and run all tests
109 # - "<arch>.clean" for any <arch> in ARCHES 109 # - "<arch>.clean" for any <arch> in ARCHES
110 # - "clean": clean all ARCHES 110 # - "clean": clean all ARCHES
111 111
112 # ----------------- internal stuff ------------------------ 112 # ----------------- internal stuff ------------------------
113 113
114 # Architectures and modes to be compiled. Consider these to be internal 114 # Architectures and modes to be compiled. Consider these to be internal
115 # variables, don't override them (use the targets instead). 115 # variables, don't override them (use the targets instead).
116 ARCHES = ia32 x64 arm mips 116 ARCHES = ia32 x64 arm mips
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ 150 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
151 python -c "print raw_input().capitalize()") \ 151 python -c "print raw_input().capitalize()") \
152 builddir="$(shell pwd)/$(OUTDIR)/$@" 152 builddir="$(shell pwd)/$(OUTDIR)/$@"
153 153
154 native: $(OUTDIR)/Makefile.native 154 native: $(OUTDIR)/Makefile.native
155 @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ 155 @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
156 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ 156 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
157 builddir="$(shell pwd)/$(OUTDIR)/$@" 157 builddir="$(shell pwd)/$(OUTDIR)/$@"
158 158
159 # TODO(jkummerow): add "android.debug" when we need it. 159 # TODO(jkummerow): add "android.debug" when we need it.
160 android android.release: $(OUTDIR)/Makefile.android 160 android-arm.release: $(OUTDIR)/Makefile-android-arm
161 » @$(MAKE) -C "$(OUTDIR)" -f Makefile.android \ 161 » @$(MAKE) -C "$(OUTDIR)" -f Makefile-android-arm \
162 » CXX="$(ANDROID_TOOL_PREFIX)-g++" \ 162 » » CXX="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi-g++ " \
163 » AR="$(ANDROID_TOOL_PREFIX)-ar" \ 163 » » AR="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi-ar" \
164 » RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ 164 » » RANLIB="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi- ranlib" \
165 » CC="$(ANDROID_TOOL_PREFIX)-gcc" \ 165 » » CC="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi-gcc" \
166 » LD="$(ANDROID_TOOL_PREFIX)-ld" \ 166 » » LD="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi-ld" \
167 » LINK="$(ANDROID_TOOL_PREFIX)-g++" \ 167 » » LINK="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi-g+ +" \
168 » BUILDTYPE=Release \ 168 » » BUILDTYPE=Release \
169 » builddir="$(shell pwd)/$(OUTDIR)/android.release" 169 » » builddir="$(shell pwd)/$(OUTDIR)/android-arm.release"
170
171 android-ia32.release: $(OUTDIR)/Makefile-android-ia32
172 » @$(MAKE) -C "$(OUTDIR)" -f Makefile-android-ia32 \
173 » » CXX="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-g++" \
174 » » AR="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-ar" \
175 » » RANLIB="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-ran lib" \
176 » » CC="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-gcc" \
177 » » LD="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-ld" \
178 » » LINK="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-g++" \
179 » » BUILDTYPE=Release \
180 » » builddir="$(shell pwd)/$(OUTDIR)/android-ia32.release"
170 181
171 # Test targets. 182 # Test targets.
172 check: all 183 check: all
173 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ 184 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
174 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ 185 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
175 $(TESTFLAGS) 186 $(TESTFLAGS)
176 187
177 $(addsuffix .check,$(MODES)): $$(basename $$@) 188 $(addsuffix .check,$(MODES)): $$(basename $$@)
178 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ 189 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
179 --mode=$(basename $@) $(TESTFLAGS) 190 --mode=$(basename $@) $(TESTFLAGS)
180 191
181 $(addsuffix .check,$(ARCHES)): $$(basename $$@) 192 $(addsuffix .check,$(ARCHES)): $$(basename $$@)
182 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ 193 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
183 --arch=$(basename $@) $(TESTFLAGS) 194 --arch=$(basename $@) $(TESTFLAGS)
184 195
185 $(CHECKS): $$(basename $$@) 196 $(CHECKS): $$(basename $$@)
186 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ 197 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
187 --arch-and-mode=$(basename $@) $(TESTFLAGS) 198 --arch-and-mode=$(basename $@) $(TESTFLAGS)
188 199
189 native.check: native 200 native.check: native
190 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ 201 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
191 --arch-and-mode=. $(TESTFLAGS) 202 --arch-and-mode=. $(TESTFLAGS)
192 203
193 # Clean targets. You can clean each architecture individually, or everything. 204 # Clean targets. You can clean each architecture individually, or everything.
194 $(addsuffix .clean,$(ARCHES)) android.clean: 205 $(addsuffix .clean,$(ARCHES)):
195 rm -f $(OUTDIR)/Makefile.$(basename $@) 206 rm -f $(OUTDIR)/Makefile.$(basename $@)
196 rm -rf $(OUTDIR)/$(basename $@).release 207 rm -rf $(OUTDIR)/$(basename $@).release
197 rm -rf $(OUTDIR)/$(basename $@).debug 208 rm -rf $(OUTDIR)/$(basename $@).debug
198 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete 209 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete
199 210
200 native.clean: 211 native.clean:
201 rm -f $(OUTDIR)/Makefile.native 212 rm -f $(OUTDIR)/Makefile.native
202 rm -rf $(OUTDIR)/native 213 rm -rf $(OUTDIR)/native
203 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete 214 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete
204 215
205 clean: $(addsuffix .clean,$(ARCHES)) native.clean android.clean 216 android-arm.clean:
217 » rm -f $(OUTDIR)/Makefile-android-arm
218 » rm -rf $(OUTDIR)/android-arm.release
219 » find $(OUTDIR) -regex '.*\(host\|target\)-android-arm\.mk' -delete
220
221 android-ia32.clean:
222 » rm -f $(OUTDIR)/Makefile-android-ia32
223 » rm -rf $(OUTDIR)/android-ia32.release
224 » find $(OUTDIR) -regex '.*\(host\|target\)-android-ia32\.mk' -delete
225
226 clean: $(addsuffix .clean,$(ARCHES)) native.clean android-arm.clean android-ia32 .clean
206 227
207 # GYP file generation targets. 228 # GYP file generation targets.
208 MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) 229 MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES))
209 $(MAKEFILES): $(GYPFILES) $(ENVFILE) 230 $(MAKEFILES): $(GYPFILES) $(ENVFILE)
210 GYP_GENERATORS=make \ 231 GYP_GENERATORS=make \
211 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ 232 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
212 -Ibuild/standalone.gypi --depth=. \ 233 -Ibuild/standalone.gypi --depth=. \
213 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ 234 -Dv8_target_arch=$(subst .,,$(suffix $@)) \
214 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) 235 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS)
215 236
216 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) 237 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
217 GYP_GENERATORS=make \ 238 GYP_GENERATORS=make \
218 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ 239 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
219 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) 240 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
220 241
221 $(OUTDIR)/Makefile.android: $(GYPFILES) $(ENVFILE) build/android.gypi \ 242 $(OUTDIR)/Makefile-android-arm: $(GYPFILES) $(ENVFILE) build/android-arm.gypi \
222 must-set-ANDROID_NDK_ROOT 243 must-set-ANDROID_NDK_ROOT
223 GYP_GENERATORS=make \ 244 GYP_GENERATORS=make \
224 » CC="${ANDROID_TOOL_PREFIX}-gcc" \ 245 » CC="$(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi-gcc" \
225 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ 246 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
226 » -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ 247 » » -Ibuild/standalone.gypi --depth=. -Ibuild/android-arm.gypi \
227 » -S.android $(GYPFLAGS) 248 » » -S-android-arm $(GYPFLAGS)
249
250 $(OUTDIR)/Makefile-android-ia32: $(GYPFILES) $(ENVFILE) build/android-ia32.gypi \
251 must-set-ANDROID_NDK_ROOT
252 » GYP_GENERATORS=make \
253 » CC="$(ANDROID_NDK_ROOT)/toolchain/bin/i686-android-linux-gcc" \
254 » build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
255 » » -Ibuild/standalone.gypi --depth=. -Ibuild/android-ia32.gypi \
256 » » -S-android-ia32 $(GYPFLAGS)
228 257
229 must-set-ANDROID_NDK_ROOT: 258 must-set-ANDROID_NDK_ROOT:
230 ifndef ANDROID_NDK_ROOT 259 ifndef ANDROID_NDK_ROOT
231 $(error ANDROID_NDK_ROOT is not set) 260 $(error ANDROID_NDK_ROOT is not set)
232 endif 261 endif
233 262
234 # Replaces the old with the new environment file if they're different, which 263 # Replaces the old with the new environment file if they're different, which
235 # will trigger GYP to regenerate Makefiles. 264 # will trigger GYP to regenerate Makefiles.
236 $(ENVFILE): $(ENVFILE).new 265 $(ENVFILE): $(ENVFILE).new
237 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ 266 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \
238 then rm $(ENVFILE).new; \ 267 then rm $(ENVFILE).new; \
239 else mv $(ENVFILE).new $(ENVFILE); fi 268 else mv $(ENVFILE).new $(ENVFILE); fi
240 269
241 # Stores current GYPFLAGS in a file. 270 # Stores current GYPFLAGS in a file.
242 $(ENVFILE).new: 271 $(ENVFILE).new:
243 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ 272 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \
244 echo "CXX=$(CXX)" >> $(ENVFILE).new 273 echo "CXX=$(CXX)" >> $(ENVFILE).new
245 274
246 # Dependencies. 275 # Dependencies.
247 dependencies: 276 dependencies:
248 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ 277 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
249 --revision 1282 278 --revision 1282
OLDNEW
« no previous file with comments | « no previous file | build/android-arm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698