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

Side by Side Diff: pylib/gyp/generator/make.py

Issue 10449026: Fixing leftover from prior reveiew, plus more lint. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
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 | « pylib/gyp/common.py ('k') | pylib/gyp/generator/ninja.py » ('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 (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Notes: 5 # Notes:
6 # 6 #
7 # This is all roughly based on the Makefile system used by the Linux 7 # This is all roughly based on the Makefile system used by the Linux
8 # kernel, but is a non-recursive make -- we put the entire dependency 8 # kernel, but is a non-recursive make -- we put the entire dependency
9 # graph in front of make and let it figure it out. 9 # graph in front of make and let it figure it out.
10 # 10 #
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 # This appears unused --- ? 47 # This appears unused --- ?
48 'CONFIGURATION_NAME': '$(BUILDTYPE)', 48 'CONFIGURATION_NAME': '$(BUILDTYPE)',
49 } 49 }
50 50
51 # Make supports multiple toolsets 51 # Make supports multiple toolsets
52 generator_supports_multiple_toolsets = True 52 generator_supports_multiple_toolsets = True
53 53
54 # Request sorted dependencies in the order from dependents to dependencies. 54 # Request sorted dependencies in the order from dependents to dependencies.
55 generator_wants_sorted_dependencies = False 55 generator_wants_sorted_dependencies = False
56 56
57 # Placates pylint.
58 generator_additional_non_configuration_keys = []
59 generator_additional_path_sections = []
60 generator_extra_sources_for_rules = []
61
57 62
58 def CalculateVariables(default_variables, params): 63 def CalculateVariables(default_variables, params):
59 """Calculate additional variables for use in the build (called by gyp).""" 64 """Calculate additional variables for use in the build (called by gyp)."""
60 cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc')) 65 cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc'))
61 flavor = gyp.common.GetFlavor(params) 66 flavor = gyp.common.GetFlavor(params)
62 if flavor == 'mac': 67 if flavor == 'mac':
63 default_variables.setdefault('OS', 'mac') 68 default_variables.setdefault('OS', 'mac')
64 default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') 69 default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')
65 default_variables.setdefault('SHARED_LIB_DIR', 70 default_variables.setdefault('SHARED_LIB_DIR',
66 generator_default_variables['PRODUCT_DIR']) 71 generator_default_variables['PRODUCT_DIR'])
67 default_variables.setdefault('LIB_DIR', 72 default_variables.setdefault('LIB_DIR',
68 generator_default_variables['PRODUCT_DIR']) 73 generator_default_variables['PRODUCT_DIR'])
69 74
70 # Copy additional generator configuration data from Xcode, which is shared 75 # Copy additional generator configuration data from Xcode, which is shared
71 # by the Mac Make generator. 76 # by the Mac Make generator.
72 import gyp.generator.xcode as xcode_generator 77 import gyp.generator.xcode as xcode_generator
73 global generator_additional_non_configuration_keys 78 global generator_additional_non_configuration_keys
74 generator_additional_non_configuration_keys = getattr(xcode_generator, 79 generator_additional_non_configuration_keys = getattr(xcode_generator,
75 'generator_additional_non_configuration_keys', []) 80 'generator_additional_non_configuration_keys', [])
76 global generator_additional_path_sections 81 global generator_additional_path_sections
77 generator_additional_path_sections = getattr(xcode_generator, 82 generator_additional_path_sections = getattr(xcode_generator,
78 'generator_additional_path_sections', []) 83 'generator_additional_path_sections', [])
79 global generator_extra_sources_for_rules 84 global generator_extra_sources_for_rules
80 generator_extra_sources_for_rules = getattr(xcode_generator, 85 generator_extra_sources_for_rules = getattr(xcode_generator,
81 'generator_extra_sources_for_rules', []) 86 'generator_extra_sources_for_rules', [])
82 global COMPILABLE_EXTENSIONS
83 COMPILABLE_EXTENSIONS.update({'.m': 'objc', '.mm' : 'objcxx'}) 87 COMPILABLE_EXTENSIONS.update({'.m': 'objc', '.mm' : 'objcxx'})
84 else: 88 else:
85 operating_system = flavor 89 operating_system = flavor
86 if flavor == 'android': 90 if flavor == 'android':
87 operating_system = 'linux' # Keep this legacy behavior for now. 91 operating_system = 'linux' # Keep this legacy behavior for now.
88 default_variables.setdefault('OS', operating_system) 92 default_variables.setdefault('OS', operating_system)
89 default_variables.setdefault('SHARED_LIB_SUFFIX', '.so') 93 default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
90 default_variables.setdefault('SHARED_LIB_DIR','$(builddir)/lib.$(TOOLSET)') 94 default_variables.setdefault('SHARED_LIB_DIR','$(builddir)/lib.$(TOOLSET)')
91 default_variables.setdefault('LIB_DIR', '$(obj).$(TOOLSET)') 95 default_variables.setdefault('LIB_DIR', '$(obj).$(TOOLSET)')
92 96
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 root_makefile.write(" include " + include_file + "\n") 2134 root_makefile.write(" include " + include_file + "\n")
2131 root_makefile.write("endif\n") 2135 root_makefile.write("endif\n")
2132 root_makefile.write('\n') 2136 root_makefile.write('\n')
2133 2137
2134 if generator_flags.get('auto_regeneration', True): 2138 if generator_flags.get('auto_regeneration', True):
2135 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) 2139 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files)
2136 2140
2137 root_makefile.write(SHARED_FOOTER) 2141 root_makefile.write(SHARED_FOOTER)
2138 2142
2139 root_makefile.close() 2143 root_makefile.close()
OLDNEW
« no previous file with comments | « pylib/gyp/common.py ('k') | pylib/gyp/generator/ninja.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698