Commit b80fcd10 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

GYP: Generate makefiles for all architectures on Linux

On Linux running gyp_v8 will generate makefiles for all architectures. On other platforms generate for ia32 only as that is what is currently supported.

The output (out) directory is still shared.

R=jkummerow@chromium.org

BUG=none
TEST=none

Review URL: http://codereview.chromium.org//7104083

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 424407c7
...@@ -13,39 +13,32 @@ Note for the command lines below that Debug is the default configuration, ...@@ -13,39 +13,32 @@ Note for the command lines below that Debug is the default configuration,
so specifying that on the command lines is not required. so specifying that on the command lines is not required.
To generate Makefiles and build 32-bit version on Linux: To generate Makefiles on Linux:
-------------------------------------------------------- -------------------------------
$ build/gyp_v8 -D target_arch=ia32 $ build/gyp_v8
$ make BUILDTYPE=Debug
$ out/Debug/shell
$ make BUILDTYPE=Release
$ out/Release/shell
To generate Makefiles and build 64-bit version on Linux: This will build makefiles for ia32, x64 and the ARM simulator with names
-------------------------------------------------------- Makefile-ia32, Makefile-x64 and Makefile-armu respectively.
$ build/gyp_v8 -D target_arch=x64
$ make BUILDTYPE=Debug
$ out/Debug/shell
$ make BUILDTYPE=Release
$ out/Release/shell
To generate Makefiles and build for the arm simulator on Linux: To build and run for ia32 in debug and release version do:
---------------------------------------------------------------
$ build/gyp_v8 -I build/armu.gypi $ make -f Makefile-ia32
$ make BUILDTYPE=Debug
$ out/Debug/shell $ out/Debug/shell
$ make BUILDTYPE=Release $ make -f Makefile-ia32 BUILDTYPE=Release
$ out/Release/shell $ out/Release/shell
Change the makefile to build and run for the other architectures.
To generate Xcode project files on Mac OS: To generate Xcode project files on Mac OS:
------------------------------------------ ------------------------------------------
$ build/gyp_v8 -D target_arch=ia32 $ build/gyp_v8
$ xcodebuild -project build/all.xcodeproj -configuration Debug
This will make an Xcode project for the ia32 architecture. To build and run do:
$ xcodebuild -project build/all.xcodeproj
$ samples/build/Debug/shell $ samples/build/Debug/shell
$ xcodebuild -project build/all.xcodeproj -configuration Release $ xcodebuild -project build/all.xcodeproj -configuration Release
$ samples/build/Release/shell $ samples/build/Release/shell
...@@ -66,8 +59,8 @@ repository. From the root of the V8 project do the following: ...@@ -66,8 +59,8 @@ repository. From the root of the V8 project do the following:
> svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26@70627 third_party/python_26 > svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26@70627 third_party/python_26
Now generate Visual Studio solution and project files: Now generate Visual Studio solution and project files for the ia32 architecture:
> third_party\python_26\python build/gyp_v8 -D target_arch=ia32 > third_party\python_26\python build/gyp_v8
Now open build\All.sln in Visual Studio. Now open build\All.sln in Visual Studio.
...@@ -38,9 +38,13 @@ import sys ...@@ -38,9 +38,13 @@ import sys
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) v8_root = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(v8_root, 'tools'))
import utils
sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib'))
import gyp import gyp
def apply_gyp_environment(file_path=None): def apply_gyp_environment(file_path=None):
""" """
Reads in a *.gyp_env file and applies the valid keys to os.environ. Reads in a *.gyp_env file and applies the valid keys to os.environ.
...@@ -68,6 +72,7 @@ def apply_gyp_environment(file_path=None): ...@@ -68,6 +72,7 @@ def apply_gyp_environment(file_path=None):
else: else:
os.environ[var] = val os.environ[var] = val
def additional_include_files(args=[]): def additional_include_files(args=[]):
""" """
Returns a list of additional (.gypi) files to include, without Returns a list of additional (.gypi) files to include, without
...@@ -97,6 +102,14 @@ def additional_include_files(args=[]): ...@@ -97,6 +102,14 @@ def additional_include_files(args=[]):
return result return result
def run_gyp(args):
rc = gyp.main(args)
if rc != 0:
print 'Error running GYP'
sys.exit(rc)
if __name__ == '__main__': if __name__ == '__main__':
args = sys.argv[1:] args = sys.argv[1:]
...@@ -141,5 +154,20 @@ if __name__ == '__main__': ...@@ -141,5 +154,20 @@ if __name__ == '__main__':
print 'Updating projects from gyp files...' print 'Updating projects from gyp files...'
sys.stdout.flush() sys.stdout.flush()
# Off we go... # Generate for the architectures supported on the given platform.
sys.exit(gyp.main(args)) gyp_args = list(args)
gyp_args.append('-Dtarget_arch=ia32')
if utils.GuessOS() == 'linux':
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')
run_gyp(gyp_args)
gyp_args = list(args)
gyp_args.append('-I' + v8_root + '/build/armu.gypi')
gyp_args.append('-S-armu')
run_gyp(gyp_args)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment