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

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

Issue 11109016: Explicit 'all' target overrides implicit 'all' target. Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 2 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 | « no previous file | 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 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 '\n') 2049 '\n')
2050 for toolset in toolsets: 2050 for toolset in toolsets:
2051 root_makefile.write('TOOLSET := %s\n' % toolset) 2051 root_makefile.write('TOOLSET := %s\n' % toolset)
2052 WriteRootHeaderSuffixRules(root_makefile) 2052 WriteRootHeaderSuffixRules(root_makefile)
2053 2053
2054 # Put build-time support tools next to the root Makefile. 2054 # Put build-time support tools next to the root Makefile.
2055 dest_path = os.path.dirname(makefile_path) 2055 dest_path = os.path.dirname(makefile_path)
2056 gyp.common.CopyTool(flavor, dest_path) 2056 gyp.common.CopyTool(flavor, dest_path)
2057 2057
2058 # Find the list of targets that derive from the gyp file(s) being built. 2058 # Find the list of targets that derive from the gyp file(s) being built.
2059 user_all_target = False
2059 needed_targets = set() 2060 needed_targets = set()
2060 for build_file in params['build_files']: 2061 for build_file in params['build_files']:
2061 for target in gyp.common.AllTargets(target_list, target_dicts, build_file): 2062 for target in gyp.common.AllTargets(target_list, target_dicts, build_file):
2062 needed_targets.add(target) 2063 needed_targets.add(target)
2064 user_all_target |= gyp.common.ParseQualifiedTarget(target)[1] == 'all'
2063 2065
2064 build_files = set() 2066 build_files = set()
2065 include_list = set() 2067 include_list = set()
2066 for qualified_target in target_list: 2068 for qualified_target in target_list:
2067 build_file, target, toolset = gyp.common.ParseQualifiedTarget( 2069 build_file, target, toolset = gyp.common.ParseQualifiedTarget(
2068 qualified_target) 2070 qualified_target)
2069 2071
2070 this_make_global_settings = data[build_file].get('make_global_settings', []) 2072 this_make_global_settings = data[build_file].get('make_global_settings', [])
2071 assert make_global_settings_array == this_make_global_settings, ( 2073 assert make_global_settings_array == this_make_global_settings, (
2072 "make_global_settings needs to be the same for all targets.") 2074 "make_global_settings needs to be the same for all targets.")
(...skipping 20 matching lines...) Expand all
2093 target + '.' + toolset + options.suffix + '.mk') 2095 target + '.' + toolset + options.suffix + '.mk')
2094 2096
2095 spec = target_dicts[qualified_target] 2097 spec = target_dicts[qualified_target]
2096 configs = spec['configurations'] 2098 configs = spec['configurations']
2097 2099
2098 if flavor == 'mac': 2100 if flavor == 'mac':
2099 gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) 2101 gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec)
2100 2102
2101 writer = MakefileWriter(generator_flags, flavor) 2103 writer = MakefileWriter(generator_flags, flavor)
2102 writer.Write(qualified_target, base_path, output_file, spec, configs, 2104 writer.Write(qualified_target, base_path, output_file, spec, configs,
2103 part_of_all=qualified_target in needed_targets) 2105 part_of_all=qualified_target in needed_targets and
2106 not user_all_target)
2104 2107
2105 # Our root_makefile lives at the source root. Compute the relative path 2108 # Our root_makefile lives at the source root. Compute the relative path
2106 # from there to the output_file for including. 2109 # from there to the output_file for including.
2107 mkfile_rel_path = gyp.common.RelativePath(output_file, 2110 mkfile_rel_path = gyp.common.RelativePath(output_file,
2108 os.path.dirname(makefile_path)) 2111 os.path.dirname(makefile_path))
2109 include_list.add(mkfile_rel_path) 2112 include_list.add(mkfile_rel_path)
2110 2113
2111 # Write out per-gyp (sub-project) Makefiles. 2114 # Write out per-gyp (sub-project) Makefiles.
2112 depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) 2115 depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd())
2113 for build_file in build_files: 2116 for build_file in build_files:
(...skipping 30 matching lines...) Expand all
2144 root_makefile.write("endif\n") 2147 root_makefile.write("endif\n")
2145 root_makefile.write('\n') 2148 root_makefile.write('\n')
2146 2149
2147 if (not generator_flags.get('standalone') 2150 if (not generator_flags.get('standalone')
2148 and generator_flags.get('auto_regeneration', True)): 2151 and generator_flags.get('auto_regeneration', True)):
2149 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) 2152 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files)
2150 2153
2151 root_makefile.write(SHARED_FOOTER) 2154 root_makefile.write(SHARED_FOOTER)
2152 2155
2153 root_makefile.close() 2156 root_makefile.close()
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/generator/ninja.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698