| 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 15 matching lines...) Expand all Loading... |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 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 BUILDTYPE ?= Release |
| 36 ANDROID_NDK_ROOT ?= | 37 ANDROID_NDK_ROOT ?= |
| 37 ANDROID_TOOL_PREFIX = $(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi | 38 ANDROID_TOOL_PREFIX = $(ANDROID_NDK_ROOT)/toolchain/bin/arm-linux-androideabi |
| 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 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 # Defines how to build a particular target (e.g. ia32.release). | 147 # Defines how to build a particular target (e.g. ia32.release). |
| 147 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) | 148 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) |
| 148 @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ | 149 @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ |
| 149 CXX="$(CXX)" LINK="$(LINK)" \ | 150 CXX="$(CXX)" LINK="$(LINK)" \ |
| 150 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 151 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
| 151 python -c "print raw_input().capitalize()") \ | 152 python -c "print raw_input().capitalize()") \ |
| 152 builddir="$(shell pwd)/$(OUTDIR)/$@" | 153 builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 153 | 154 |
| 154 native: $(OUTDIR)/Makefile-native | 155 native: $(OUTDIR)/Makefile-native |
| 155 @$(MAKE) -C "$(OUTDIR)" -f Makefile-native \ | 156 @$(MAKE) -C "$(OUTDIR)" -f Makefile-native \ |
| 156 » CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ | 157 » CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=$(BUILDTYPE) \ |
| 158 » builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 159 |
| 160 cross: $(OUTDIR)/Makefile-cross |
| 161 » @$(MAKE) -C "$(OUTDIR)" -f Makefile-cross BUILDTYPE=$(BUILDTYPE) \ |
| 157 builddir="$(shell pwd)/$(OUTDIR)/$@" | 162 builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 158 | 163 |
| 159 # TODO(jkummerow): add "android.debug" when we need it. | 164 # TODO(jkummerow): add "android.debug" when we need it. |
| 160 android android.release: $(OUTDIR)/Makefile-android | 165 android android.release: $(OUTDIR)/Makefile-android |
| 161 @$(MAKE) -C "$(OUTDIR)" -f Makefile-android \ | 166 @$(MAKE) -C "$(OUTDIR)" -f Makefile-android \ |
| 162 CXX="$(ANDROID_TOOL_PREFIX)-g++" \ | 167 CXX="$(ANDROID_TOOL_PREFIX)-g++" \ |
| 163 AR="$(ANDROID_TOOL_PREFIX)-ar" \ | 168 AR="$(ANDROID_TOOL_PREFIX)-ar" \ |
| 164 RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ | 169 RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ |
| 165 CC="$(ANDROID_TOOL_PREFIX)-gcc" \ | 170 CC="$(ANDROID_TOOL_PREFIX)-gcc" \ |
| 166 LD="$(ANDROID_TOOL_PREFIX)-ld" \ | 171 LD="$(ANDROID_TOOL_PREFIX)-ld" \ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 native.clean: | 205 native.clean: |
| 201 rm -f $(OUTDIR)/Makefile-native | 206 rm -f $(OUTDIR)/Makefile-native |
| 202 rm -rf $(OUTDIR)/native | 207 rm -rf $(OUTDIR)/native |
| 203 find $(OUTDIR) -regex '.*\(host\|target\)-native\.mk' -delete | 208 find $(OUTDIR) -regex '.*\(host\|target\)-native\.mk' -delete |
| 204 | 209 |
| 205 android.clean: | 210 android.clean: |
| 206 rm -f $(OUTDIR)/Makefile-android | 211 rm -f $(OUTDIR)/Makefile-android |
| 207 rm -rf $(OUTDIR)/android.release | 212 rm -rf $(OUTDIR)/android.release |
| 208 find $(OUTDIR) -regex '.*\(host\|target\)-android\.mk' -delete | 213 find $(OUTDIR) -regex '.*\(host\|target\)-android\.mk' -delete |
| 209 | 214 |
| 210 clean: $(addsuffix .clean,$(ARCHES)) native.clean | 215 cross.clean: |
| 216 » rm -f $(OUTDIR)/Makefile-cross |
| 217 » rm -rf $(OUTDIR)/cross |
| 218 » find $(OUTDIR) -regex '.*\(host\|target\)-cross\.mk' -delete |
| 219 |
| 220 clean: $(addsuffix .clean,$(ARCHES)) native.clean cross.clean |
| 211 | 221 |
| 212 # GYP file generation targets. | 222 # GYP file generation targets. |
| 213 $(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE) | 223 $(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE) |
| 214 GYP_GENERATORS=make \ | 224 GYP_GENERATORS=make \ |
| 215 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 225 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 216 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \ | 226 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \ |
| 217 -S-ia32 $(GYPFLAGS) | 227 -S-ia32 $(GYPFLAGS) |
| 218 | 228 |
| 219 $(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE) | 229 $(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE) |
| 220 GYP_GENERATORS=make \ | 230 GYP_GENERATORS=make \ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 232 GYP_GENERATORS=make \ | 242 GYP_GENERATORS=make \ |
| 233 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 243 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 234 -Ibuild/standalone.gypi --depth=. -Ibuild/mipsu.gypi \ | 244 -Ibuild/standalone.gypi --depth=. -Ibuild/mipsu.gypi \ |
| 235 -S-mips $(GYPFLAGS) | 245 -S-mips $(GYPFLAGS) |
| 236 | 246 |
| 237 $(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE) | 247 $(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE) |
| 238 GYP_GENERATORS=make \ | 248 GYP_GENERATORS=make \ |
| 239 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 249 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 240 -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS) | 250 -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS) |
| 241 | 251 |
| 252 $(OUTDIR)/Makefile-cross: $(GYPFILES) $(ENVFILE) |
| 253 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 254 -Ibuild/standalone.gypi --depth=. \ |
| 255 -Dtarget_arch=$(target) -S-cross $(GYPFLAGS) |
| 256 |
| 242 $(OUTDIR)/Makefile-android: $(GYPFILES) $(ENVFILE) build/android.gypi \ | 257 $(OUTDIR)/Makefile-android: $(GYPFILES) $(ENVFILE) build/android.gypi \ |
| 243 must-set-ANDROID_NDK_ROOT | 258 must-set-ANDROID_NDK_ROOT |
| 244 GYP_GENERATORS=make \ | 259 GYP_GENERATORS=make \ |
| 245 CC="${ANDROID_TOOL_PREFIX}-gcc" \ | 260 CC="${ANDROID_TOOL_PREFIX}-gcc" \ |
| 246 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 261 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
| 247 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ | 262 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ |
| 248 -S-android $(GYPFLAGS) | 263 -S-android $(GYPFLAGS) |
| 249 | 264 |
| 250 must-set-ANDROID_NDK_ROOT: | 265 must-set-ANDROID_NDK_ROOT: |
| 251 ifndef ANDROID_NDK_ROOT | 266 ifndef ANDROID_NDK_ROOT |
| 252 $(error ANDROID_NDK_ROOT is not set) | 267 $(error ANDROID_NDK_ROOT is not set) |
| 253 endif | 268 endif |
| 254 | 269 |
| 255 # Replaces the old with the new environment file if they're different, which | 270 # Replaces the old with the new environment file if they're different, which |
| 256 # will trigger GYP to regenerate Makefiles. | 271 # will trigger GYP to regenerate Makefiles. |
| 257 $(ENVFILE): $(ENVFILE).new | 272 $(ENVFILE): $(ENVFILE).new |
| 258 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ | 273 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
| 259 then rm $(ENVFILE).new; \ | 274 then rm $(ENVFILE).new; \ |
| 260 else mv $(ENVFILE).new $(ENVFILE); fi | 275 else mv $(ENVFILE).new $(ENVFILE); fi |
| 261 | 276 |
| 262 # Stores current GYPFLAGS in a file. | 277 # Stores current GYPFLAGS in a file. |
| 263 $(ENVFILE).new: | 278 $(ENVFILE).new: |
| 264 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ | 279 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
| 265 echo "CXX=$(CXX)" >> $(ENVFILE).new | 280 echo "CXX=$(CXX)" >> $(ENVFILE).new |
| 266 | 281 |
| 267 # Dependencies. | 282 # Dependencies. |
| 268 dependencies: | 283 dependencies: |
| 269 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | 284 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
| 270 --revision 1282 | 285 --revision 1282 |
| OLD | NEW |