Revision: 11486
Author:   [email protected]
Date:     Thu May  3 01:11:38 2012
Log:      Clean up Makefile, enable MIPS cross-compilation

Review URL: https://chromiumcodereview.appspot.com/10268010
http://code.google.com/p/v8/source/detail?r=11486

Deleted:
 /branches/bleeding_edge/build/armu.gypi
 /branches/bleeding_edge/build/mipsu.gypi
Modified:
 /branches/bleeding_edge/Makefile
 /branches/bleeding_edge/build/common.gypi
 /branches/bleeding_edge/build/gyp_v8
 /branches/bleeding_edge/build/standalone.gypi

=======================================
--- /branches/bleeding_edge/build/armu.gypi     Fri Aug  5 02:44:30 2011
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2011 the V8 project authors. All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-#       copyright notice, this list of conditions and the following
-#       disclaimer in the documentation and/or other materials provided
-#       with the distribution.
-#     * Neither the name of Google Inc. nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
-  'variables': {
-    'target_arch': 'ia32',
-    'v8_target_arch': 'arm',
-    'armv7': 1,
-    'arm_neon': 0,
-    'arm_fpu': 'vfpv3',
-  },
-}
=======================================
--- /branches/bleeding_edge/build/mipsu.gypi    Tue Mar 13 09:18:30 2012
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2012 the V8 project authors. All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-#       copyright notice, this list of conditions and the following
-#       disclaimer in the documentation and/or other materials provided
-#       with the distribution.
-#     * Neither the name of Google Inc. nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
-  'variables': {
-    'target_arch': 'ia32',
-    'v8_target_arch': 'mips',
-  },
-}
=======================================
--- /branches/bleeding_edge/Makefile    Fri Apr 13 00:59:09 2012
+++ /branches/bleeding_edge/Makefile    Thu May  3 01:11:38 2012
@@ -144,21 +144,21 @@
 $(ARCHES): $(addprefix $$@.,$(MODES))

 # Defines how to build a particular target (e.g. ia32.release).
-$(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@)
-       @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \
+$(BUILDS): $(OUTDIR)/Makefile.$$(basename $$@)
+       @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \
                 CXX="$(CXX)" LINK="$(LINK)" \
                 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
                             python -c "print raw_input().capitalize()") \
                 builddir="$(shell pwd)/$(OUTDIR)/$@"

-native: $(OUTDIR)/Makefile-native
-       @$(MAKE) -C "$(OUTDIR)" -f Makefile-native \
+native: $(OUTDIR)/Makefile.native
+       @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
                 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
                 builddir="$(shell pwd)/$(OUTDIR)/$@"

 # TODO(jkummerow): add "android.debug" when we need it.
-android android.release: $(OUTDIR)/Makefile-android
-       @$(MAKE) -C "$(OUTDIR)" -f Makefile-android \
+android android.release: $(OUTDIR)/Makefile.android
+       @$(MAKE) -C "$(OUTDIR)" -f Makefile.android \
                CXX="$(ANDROID_TOOL_PREFIX)-g++" \
                AR="$(ANDROID_TOOL_PREFIX)-ar" \
                RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \
@@ -191,61 +191,40 @@
            --arch-and-mode=. $(TESTFLAGS)

# Clean targets. You can clean each architecture individually, or everything.
-$(addsuffix .clean,$(ARCHES)):
-       rm -f $(OUTDIR)/Makefile-$(basename $@)
+$(addsuffix .clean,$(ARCHES)) android.clean:
+       rm -f $(OUTDIR)/Makefile.$(basename $@)
        rm -rf $(OUTDIR)/$(basename $@).release
        rm -rf $(OUTDIR)/$(basename $@).debug
-       find $(OUTDIR) -regex '.*\(host\|target\)-$(basename $@)\.mk' -delete
+       find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete

 native.clean:
-       rm -f $(OUTDIR)/Makefile-native
+       rm -f $(OUTDIR)/Makefile.native
        rm -rf $(OUTDIR)/native
-       find $(OUTDIR) -regex '.*\(host\|target\)-native\.mk' -delete
-
-android.clean:
-       rm -f $(OUTDIR)/Makefile-android
-       rm -rf $(OUTDIR)/android.release
-       find $(OUTDIR) -regex '.*\(host\|target\)-android\.mk' -delete
-
-clean: $(addsuffix .clean,$(ARCHES)) native.clean
+       find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete
+
+clean: $(addsuffix .clean,$(ARCHES)) native.clean android.clean

 # GYP file generation targets.
-$(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE)
+MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES))
+$(MAKEFILES): $(GYPFILES) $(ENVFILE)
        GYP_GENERATORS=make \
        build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-                     -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \
-                     -S-ia32 $(GYPFLAGS)
-
-$(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE)
+                     -Ibuild/standalone.gypi --depth=. \
+                     -Dv8_target_arch=$(subst .,,$(suffix $@)) \
+                     -S.$(subst .,,$(suffix $@)) $(GYPFLAGS)
+
+$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
        GYP_GENERATORS=make \
        build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-                     -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 \
-                     -S-x64 $(GYPFLAGS)
-
-$(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE) build/armu.gypi
-       GYP_GENERATORS=make \
-       build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-                     -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \
-                     -S-arm $(GYPFLAGS)
-
-$(OUTDIR)/Makefile-mips: $(GYPFILES) $(ENVFILE) build/mipsu.gypi
-       GYP_GENERATORS=make \
-       build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-                     -Ibuild/standalone.gypi --depth=. -Ibuild/mipsu.gypi \
-                     -S-mips $(GYPFLAGS)
-
-$(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE)
-       GYP_GENERATORS=make \
-       build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-                     -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS)
-
-$(OUTDIR)/Makefile-android: $(GYPFILES) $(ENVFILE) build/android.gypi \
+                     -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
+
+$(OUTDIR)/Makefile.android: $(GYPFILES) $(ENVFILE) build/android.gypi \
                             must-set-ANDROID_NDK_ROOT
        GYP_GENERATORS=make \
        CC="${ANDROID_TOOL_PREFIX}-gcc" \
        build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
                      -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \
-                     -S-android $(GYPFLAGS)
+                     -S.android $(GYPFLAGS)

 must-set-ANDROID_NDK_ROOT:
 ifndef ANDROID_NDK_ROOT
=======================================
--- /branches/bleeding_edge/build/common.gypi   Fri Apr 13 01:47:45 2012
+++ /branches/bleeding_edge/build/common.gypi   Thu May  3 01:11:38 2012
@@ -173,8 +173,11 @@
             'defines': [
               'V8_TARGET_ARCH_MIPS',
             ],
+            'variables': {
+ 'mipscompiler': '<!($(echo ${CXX:-$(which g++)}) -v 2>&1 | grep -q "^Target: mips-" && echo "yes" || echo "no")',
+            },
             'conditions': [
-              [ 'target_arch=="mips"', {
+              ['mipscompiler=="yes"', {
                 'target_conditions': [
                   ['_toolset=="target"', {
                     'cflags': ['-EL'],
=======================================
--- /branches/bleeding_edge/build/gyp_v8        Fri Mar 30 08:01:11 2012
+++ /branches/bleeding_edge/build/gyp_v8        Thu May  3 01:11:38 2012
@@ -163,21 +163,21 @@
   if target_arch is None:
     gyp_args.append('-Dtarget_arch=ia32')
   if utils.GuessOS() == 'linux':
-    gyp_args.append('-S-ia32')
+    gyp_args.append('-S.ia32')
   run_gyp(gyp_args)

   if utils.GuessOS() == 'linux':
     gyp_args = list(args)
     gyp_args.append('-Dtarget_arch=x64')
-    gyp_args.append('-S-x64')
+    gyp_args.append('-S.x64')
     run_gyp(gyp_args)

     gyp_args = list(args)
-    gyp_args.append('-I' + v8_root + '/build/armu.gypi')
-    gyp_args.append('-S-armu')
+    gyp_args.append('-Dv8_target_arch=arm')
+    gyp_args.append('-S.arm')
     run_gyp(gyp_args)

     gyp_args = list(args)
-    gyp_args.append('-I' + v8_root + '/build/mipsu.gypi')
-    gyp_args.append('-S-mipsu')
+    gyp_args.append('-Dv8_target_arch=mips')
+    gyp_args.append('-S.mips')
     run_gyp(gyp_args)
=======================================
--- /branches/bleeding_edge/build/standalone.gypi       Tue Jan 17 06:35:38 2012
+++ /branches/bleeding_edge/build/standalone.gypi       Thu May  3 01:11:38 2012
@@ -71,6 +71,10 @@
         'want_separate_host_toolset': 0,
       }],
     ],
+    # Default ARM variable settings.
+    'armv7%': 1,
+    'arm_neon%': 0,
+    'arm_fpu%': 'vfpv3',
   },
   'target_defaults': {
     'default_configuration': 'Debug',

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to