Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 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 ANDROID_V8 ?= /data/local/v8 | 37 ANDROID_V8 ?= /data/local/v8 |
| 39 | 38 |
| 40 # Special build flags. Use them like this: "make library=shared" | 39 # Special build flags. Use them like this: "make library=shared" |
| 41 | 40 |
| 42 # library=shared || component=shared_library | 41 # library=shared || component=shared_library |
| 43 ifeq ($(library), shared) | 42 ifeq ($(library), shared) |
| 44 GYPFLAGS += -Dcomponent=shared_library | 43 GYPFLAGS += -Dcomponent=shared_library |
| 45 endif | 44 endif |
| 46 ifdef component | 45 ifdef component |
| 47 GYPFLAGS += -Dcomponent=$(component) | 46 GYPFLAGS += -Dcomponent=$(component) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 # - "<arch>.clean" for any <arch> in ARCHES | 113 # - "<arch>.clean" for any <arch> in ARCHES |
| 115 # - "clean": clean all ARCHES | 114 # - "clean": clean all ARCHES |
| 116 | 115 |
| 117 # ----------------- internal stuff ------------------------ | 116 # ----------------- internal stuff ------------------------ |
| 118 | 117 |
| 119 # Architectures and modes to be compiled. Consider these to be internal | 118 # Architectures and modes to be compiled. Consider these to be internal |
| 120 # variables, don't override them (use the targets instead). | 119 # variables, don't override them (use the targets instead). |
| 121 ARCHES = ia32 x64 arm mipsel | 120 ARCHES = ia32 x64 arm mipsel |
| 122 DEFAULT_ARCHES = ia32 x64 arm | 121 DEFAULT_ARCHES = ia32 x64 arm |
| 123 MODES = release debug | 122 MODES = release debug |
| 124 ANDROID_MODES = android.release android.debug | 123 ANDROID_ARCHES = android_ia32 android_arm |
| 125 | 124 |
| 126 # List of files that trigger Makefile regeneration: | 125 # List of files that trigger Makefile regeneration: |
| 127 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ | 126 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
| 128 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ | 127 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
| 129 test/cctest/cctest.gyp tools/gyp/v8.gyp | 128 test/cctest/cctest.gyp tools/gyp/v8.gyp |
| 130 | 129 |
| 131 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". | 130 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
| 132 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) | 131 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
| 132 ANDROID_BUILDS = $(foreach mode,$(MODES), \ | |
| 133 $(addsuffix .$(mode),$(ANDROID_ARCHES))) | |
| 133 # Generates corresponding test targets, e.g. "ia32.release.check". | 134 # Generates corresponding test targets, e.g. "ia32.release.check". |
| 134 CHECKS = $(addsuffix .check,$(BUILDS)) | 135 CHECKS = $(addsuffix .check,$(BUILDS)) |
| 136 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) | |
| 135 # File where previously used GYPFLAGS are stored. | 137 # File where previously used GYPFLAGS are stored. |
| 136 ENVFILE = $(OUTDIR)/environment | 138 ENVFILE = $(OUTDIR)/environment |
| 137 | 139 |
| 138 .PHONY: all check clean dependencies $(ENVFILE).new native \ | 140 .PHONY: all check clean dependencies $(ENVFILE).new native \ |
| 139 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ | 141 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
| 140 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ | 142 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ |
| 143 $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ | |
| 141 must-set-ANDROID_NDK_ROOT | 144 must-set-ANDROID_NDK_ROOT |
| 142 | 145 |
| 143 # Target definitions. "all" is the default. | 146 # Target definitions. "all" is the default. |
| 144 all: $(MODES) | 147 all: $(MODES) |
| 145 | 148 |
| 146 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile | 149 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile |
| 147 # having been created before. | 150 # having been created before. |
| 148 buildbot: | 151 buildbot: |
| 149 $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ | 152 $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ |
| 150 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" | 153 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 165 CXX="$(CXX)" LINK="$(LINK)" \ | 168 CXX="$(CXX)" LINK="$(LINK)" \ |
| 166 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 169 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
| 167 python -c "print raw_input().capitalize()") \ | 170 python -c "print raw_input().capitalize()") \ |
| 168 builddir="$(shell pwd)/$(OUTDIR)/$@" | 171 builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 169 | 172 |
| 170 native: $(OUTDIR)/Makefile.native | 173 native: $(OUTDIR)/Makefile.native |
| 171 @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ | 174 @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ |
| 172 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ | 175 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ |
| 173 builddir="$(shell pwd)/$(OUTDIR)/$@" | 176 builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 174 | 177 |
| 175 android: $(ANDROID_MODES) | 178 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODE)) |
| 176 | 179 |
| 177 $(ANDROID_MODES): $(OUTDIR)/Makefile.android | 180 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ |
| 178 » @$(MAKE) -C "$(OUTDIR)" -f Makefile.android \ | 181 must-set-ANDROID_NDK_ROOT |
| 179 » CXX="$(ANDROID_TOOL_PREFIX)-g++" \ | 182 » @tools/android-build.sh $(basename $@) $(subst .,,$(suffix $@)) \ |
| 180 » AR="$(ANDROID_TOOL_PREFIX)-ar" \ | 183 » $(OUTDIR) $(GYPFLAGS) |
| 181 » RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ | |
| 182 » CC="$(ANDROID_TOOL_PREFIX)-gcc" \ | |
| 183 » LD="$(ANDROID_TOOL_PREFIX)-ld" \ | |
| 184 » LINK="$(ANDROID_TOOL_PREFIX)-g++" \ | |
| 185 » BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | |
| 186 » python -c "print raw_input().capitalize()") \ | |
| 187 » builddir="$(shell pwd)/$(OUTDIR)/$@" | |
| 188 | 184 |
| 189 # Test targets. | 185 # Test targets. |
| 190 check: all | 186 check: all |
| 191 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 187 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 192 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ | 188 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
| 193 $(TESTFLAGS) | 189 $(TESTFLAGS) |
| 194 | 190 |
| 195 $(addsuffix .check,$(MODES)): $$(basename $$@) | 191 $(addsuffix .check,$(MODES)): $$(basename $$@) |
| 196 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 192 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 197 --mode=$(basename $@) $(TESTFLAGS) | 193 --mode=$(basename $@) $(TESTFLAGS) |
| 198 | 194 |
| 199 $(addsuffix .check,$(ARCHES)): $$(basename $$@) | 195 $(addsuffix .check,$(ARCHES)): $$(basename $$@) |
| 200 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 196 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 201 --arch=$(basename $@) $(TESTFLAGS) | 197 --arch=$(basename $@) $(TESTFLAGS) |
| 202 | 198 |
| 203 $(CHECKS): $$(basename $$@) | 199 $(CHECKS): $$(basename $$@) |
| 204 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 200 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 205 --arch-and-mode=$(basename $@) $(TESTFLAGS) | 201 --arch-and-mode=$(basename $@) $(TESTFLAGS) |
| 206 | 202 |
| 207 $(addsuffix .sync, $(ANDROID_MODES)): $$(basename $$@) | 203 $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) |
| 208 @tools/android-sync.sh $(basename $@) $(OUTDIR) \ | 204 @tools/android-sync.sh $(basename $@) $(OUTDIR) \ |
| 209 $(shell pwd) $(ANDROID_V8) | 205 $(shell pwd) $(ANDROID_V8) |
| 210 | 206 |
| 211 $(addsuffix .check, $(ANDROID_MODES)): $$(basename $$@).sync | 207 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync |
| 212 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 208 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 213 --arch-and-mode=$(basename $@) \ | 209 --arch-and-mode=$(basename $@) \ |
| 214 --special-command="tools/android-run.py @" | 210 --special-command="tools/android-run.py @" |
| 215 | 211 |
| 216 android.check: android.release.check android.debug.check | 212 $(addsuffix .check, $(ANDROID_ARCHES)): \ |
| 213 $(addprefix $$(basename $$@).,$(MODES)).check | |
| 217 | 214 |
| 218 native.check: native | 215 native.check: native |
| 219 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ | 216 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
| 220 --arch-and-mode=. $(TESTFLAGS) | 217 --arch-and-mode=. $(TESTFLAGS) |
| 221 | 218 |
| 222 # Clean targets. You can clean each architecture individually, or everything. | 219 # Clean targets. You can clean each architecture individually, or everything. |
| 223 $(addsuffix .clean,$(ARCHES)) android.clean: | 220 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)): |
| 224 rm -f $(OUTDIR)/Makefile.$(basename $@) | 221 rm -f $(OUTDIR)/Makefile.$(basename $@) |
| 222 rm -f $(OUTDIR)/Makefile.$(basename $@).release | |
|
Jakob Kummerow
2012/07/18 11:28:20
We don't actually need to generate these, so we do
| |
| 223 rm -f $(OUTDIR)/Makefile.$(basename $@).debug | |
| 225 rm -rf $(OUTDIR)/$(basename $@).release | 224 rm -rf $(OUTDIR)/$(basename $@).release |
| 226 rm -rf $(OUTDIR)/$(basename $@).debug | 225 rm -rf $(OUTDIR)/$(basename $@).debug |
| 227 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete | 226 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete |
| 228 | 227 |
| 229 native.clean: | 228 native.clean: |
| 230 rm -f $(OUTDIR)/Makefile.native | 229 rm -f $(OUTDIR)/Makefile.native |
| 231 rm -rf $(OUTDIR)/native | 230 rm -rf $(OUTDIR)/native |
| 232 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete | 231 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete |
| 233 | 232 |
| 234 clean: $(addsuffix .clean,$(ARCHES)) native.clean android.clean | 233 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean |
| 235 | 234 |
| 236 # GYP file generation targets. | 235 # GYP file generation targets. |
| 237 MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) | 236 MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) |
| 238 $(MAKEFILES): $(GYPFILES) $(ENVFILE) | 237 $(MAKEFILES): $(GYPFILES) $(ENVFILE) |
| 239 GYP_GENERATORS=make \ | 238 GYP_GENERATORS=make \ |
| 240 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 239 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 241 -Ibuild/standalone.gypi --depth=. \ | 240 -Ibuild/standalone.gypi --depth=. \ |
| 242 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ | 241 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ |
| 243 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) | 242 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) |
| 244 | 243 |
| 245 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) | 244 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) |
| 246 GYP_GENERATORS=make \ | 245 GYP_GENERATORS=make \ |
| 247 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 246 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 248 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) | 247 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) |
| 249 | 248 |
| 250 $(OUTDIR)/Makefile.android: $(GYPFILES) $(ENVFILE) build/android.gypi \ | |
| 251 must-set-ANDROID_NDK_ROOT | |
| 252 GYP_GENERATORS=make \ | |
| 253 CC="${ANDROID_TOOL_PREFIX}-gcc" \ | |
| 254 CXX="${ANDROID_TOOL_PREFIX}-g++" \ | |
| 255 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | |
| 256 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ | |
| 257 -S.android $(GYPFLAGS) | |
| 258 | |
| 259 must-set-ANDROID_NDK_ROOT: | 249 must-set-ANDROID_NDK_ROOT: |
| 260 ifndef ANDROID_NDK_ROOT | 250 ifndef ANDROID_NDK_ROOT |
| 261 $(error ANDROID_NDK_ROOT is not set) | 251 $(error ANDROID_NDK_ROOT is not set) |
| 262 endif | 252 endif |
| 263 | 253 |
| 264 # Replaces the old with the new environment file if they're different, which | 254 # Replaces the old with the new environment file if they're different, which |
| 265 # will trigger GYP to regenerate Makefiles. | 255 # will trigger GYP to regenerate Makefiles. |
| 266 $(ENVFILE): $(ENVFILE).new | 256 $(ENVFILE): $(ENVFILE).new |
| 267 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ | 257 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
| 268 then rm $(ENVFILE).new; \ | 258 then rm $(ENVFILE).new; \ |
| 269 else mv $(ENVFILE).new $(ENVFILE); fi | 259 else mv $(ENVFILE).new $(ENVFILE); fi |
| 270 | 260 |
| 271 # Stores current GYPFLAGS in a file. | 261 # Stores current GYPFLAGS in a file. |
| 272 $(ENVFILE).new: | 262 $(ENVFILE).new: |
| 273 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ | 263 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
| 274 echo "CXX=$(CXX)" >> $(ENVFILE).new | 264 echo "CXX=$(CXX)" >> $(ENVFILE).new |
| 275 | 265 |
| 276 # Dependencies. | 266 # Dependencies. |
| 277 dependencies: | 267 dependencies: |
| 278 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | 268 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
| 279 --revision 1282 | 269 --revision 1282 |
| OLD | NEW |