OLD | NEW |
---|---|
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 # Placates pylint. | 55 # Placates pylint. |
56 generator_additional_non_configuration_keys = [] | 56 generator_additional_non_configuration_keys = [] |
57 generator_additional_path_sections = [] | 57 generator_additional_path_sections = [] |
58 generator_extra_sources_for_rules = [] | 58 generator_extra_sources_for_rules = [] |
59 | 59 |
60 | 60 |
61 def CalculateVariables(default_variables, params): | 61 def CalculateVariables(default_variables, params): |
62 """Calculate additional variables for use in the build (called by gyp).""" | 62 """Calculate additional variables for use in the build (called by gyp).""" |
63 cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc')) | 63 cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc')) |
64 flavor = gyp.common.GetFlavor(params) | 64 flavor = gyp.common.GetFlavor(params) |
65 default_variables.setdefault('HOST_OS', gyp.common.GetHostFlavor(params)) | |
65 if flavor == 'mac': | 66 if flavor == 'mac': |
66 default_variables.setdefault('OS', 'mac') | 67 default_variables.setdefault('OS', 'mac') |
67 default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') | 68 default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') |
68 default_variables.setdefault('SHARED_LIB_DIR', | 69 default_variables.setdefault('SHARED_LIB_DIR', |
69 generator_default_variables['PRODUCT_DIR']) | 70 generator_default_variables['PRODUCT_DIR']) |
70 default_variables.setdefault('LIB_DIR', | 71 default_variables.setdefault('LIB_DIR', |
71 generator_default_variables['PRODUCT_DIR']) | 72 generator_default_variables['PRODUCT_DIR']) |
72 | 73 |
73 # Copy additional generator configuration data from Xcode, which is shared | 74 # Copy additional generator configuration data from Xcode, which is shared |
74 # by the Mac Make generator. | 75 # by the Mac Make generator. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 # wildcard can handle spaces, the rest can't. | 116 # wildcard can handle spaces, the rest can't. |
116 # Since I could find no way to make foreach work with spaces in filenames | 117 # Since I could find no way to make foreach work with spaces in filenames |
117 # correctly, the .d files have spaces replaced with another character. The .d | 118 # correctly, the .d files have spaces replaced with another character. The .d |
118 # file for | 119 # file for |
119 # Chromium\ Framework.framework/foo | 120 # Chromium\ Framework.framework/foo |
120 # is for example | 121 # is for example |
121 # out/Release/.deps/out/Release/Chromium?Framework.framework/foo | 122 # out/Release/.deps/out/Release/Chromium?Framework.framework/foo |
122 # This is the replacement character. | 123 # This is the replacement character. |
123 SPACE_REPLACEMENT = '?' | 124 SPACE_REPLACEMENT = '?' |
124 | 125 |
125 | |
Torne
2012/08/21 09:47:17
mistaken whitespace change
| |
126 LINK_COMMANDS_LINUX = """\ | 126 LINK_COMMANDS_LINUX = """\ |
127 quiet_cmd_alink = AR($(TOOLSET)) $@ | 127 quiet_cmd_alink = AR($(TOOLSET)) $@ |
128 cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$ ^) | 128 cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$ ^) |
129 | 129 |
130 # Due to circular dependencies between libraries :(, we wrap the | 130 # Due to circular dependencies between libraries :(, we wrap the |
131 # special "figure out circular dependencies" flags around the entire | 131 # special "figure out circular dependencies" flags around the entire |
132 # input list during linking. | 132 # input list during linking. |
133 quiet_cmd_link = LINK($(TOOLSET)) $@ | 133 quiet_cmd_link = LINK($(TOOLSET)) $@ |
134 cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--s tart-group $(LD_INPUTS) -Wl,--end-group $(LIBS) | 134 cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--s tart-group $(LD_INPUTS) -Wl,--end-group $(LIBS) |
135 | 135 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 quiet_cmd_solink = SOLINK($(TOOLSET)) $@ | 168 quiet_cmd_solink = SOLINK($(TOOLSET)) $@ |
169 cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) | 169 cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) |
170 | 170 |
171 # TODO(thakis): The solink_module rule is likely wrong. Xcode seems to pass | 171 # TODO(thakis): The solink_module rule is likely wrong. Xcode seems to pass |
172 # -bundle -single_module here (for osmesa.so). | 172 # -bundle -single_module here (for osmesa.so). |
173 quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ | 173 quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ |
174 cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE T)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) | 174 cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE T)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) |
175 """ | 175 """ |
176 | 176 |
177 LINK_COMMANDS_ANDROID = """\ | 177 LINK_COMMANDS_ANDROID = """\ |
178 quiet_cmd_alink = AR($(TOOLSET)) $@ | 178 quiet_cmd_alink_target = AR($(TOOLSET)) $@ |
179 cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$ ^) | 179 cmd_alink_target = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filte r %.o,$^) |
180 | 180 |
181 # Due to circular dependencies between libraries :(, we wrap the | 181 # Due to circular dependencies between libraries :(, we wrap the |
182 # special "figure out circular dependencies" flags around the entire | 182 # special "figure out circular dependencies" flags around the entire |
183 # input list during linking. | 183 # input list during linking. |
184 quiet_cmd_link = LINK($(TOOLSET)) $@ | 184 quiet_cmd_link_target = LINK($(TOOLSET)) $@ |
185 quiet_cmd_link_host = LINK($(TOOLSET)) $@ | 185 cmd_link_target = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) |
186 cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--s tart-group $(LD_INPUTS) -Wl,--end-group $(LIBS) | |
187 cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $( LD_INPUTS) $(LIBS) | |
188 | 186 |
189 # Other shared-object link notes: | 187 # Other shared-object link notes: |
190 # - Set SONAME to the library filename so our binaries don't reference | 188 # - Set SONAME to the library filename so our binaries don't reference |
191 # the local, absolute paths used on the link command-line. | 189 # the local, absolute paths used on the link command-line. |
192 quiet_cmd_solink = SOLINK($(TOOLSET)) $@ | 190 quiet_cmd_solink_target = SOLINK($(TOOLSET)) $@ |
193 cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl ,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(L IBS) | 191 cmd_solink_target = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE T)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-arch ive $(LIBS) |
194 | 192 |
195 quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ | 193 quiet_cmd_solink_module_target = SOLINK_MODULE($(TOOLSET)) $@ |
196 cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE T)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl ,--end-group $(LIBS) | 194 cmd_solink_module_target = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$ (TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) |
197 quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@ | |
198 cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(T OOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) | |
199 """ | 195 """ |
200 | 196 |
201 | |
Torne
2012/08/21 09:47:17
mistaken whitespace change
| |
202 # Header of toplevel Makefile. | 197 # Header of toplevel Makefile. |
203 # This should go into the build tree, but it's easier to keep it here for now. | 198 # This should go into the build tree, but it's easier to keep it here for now. |
204 SHARED_HEADER = ("""\ | 199 SHARED_HEADER = ("""\ |
205 # We borrow heavily from the kernel build setup, though we are simpler since | 200 # We borrow heavily from the kernel build setup, though we are simpler since |
206 # we don't have Kconfig tweaking settings on us. | 201 # we don't have Kconfig tweaking settings on us. |
207 | 202 |
208 # The implicit make rules have it looking for RCS files, among other things. | 203 # The implicit make rules have it looking for RCS files, among other things. |
209 # We instead explicitly write all the rules we care about. | 204 # We instead explicitly write all the rules we care about. |
210 # It's even quicker (saves ~200ms) to pass -r on the command line. | 205 # It's even quicker (saves ~200ms) to pass -r on the command line. |
211 MAKEFLAGS=-r | 206 MAKEFLAGS=-r |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1499 if postbuilds: | 1494 if postbuilds: |
1500 assert not self.is_mac_bundle, ('Postbuilds for bundles should be done ' | 1495 assert not self.is_mac_bundle, ('Postbuilds for bundles should be done ' |
1501 'on the bundle, not the binary (target \'%s\')' % self.target) | 1496 'on the bundle, not the binary (target \'%s\')' % self.target) |
1502 assert 'product_dir' not in spec, ('Postbuilds do not work with ' | 1497 assert 'product_dir' not in spec, ('Postbuilds do not work with ' |
1503 'custom product_dir') | 1498 'custom product_dir') |
1504 | 1499 |
1505 if self.type == 'executable': | 1500 if self.type == 'executable': |
1506 self.WriteLn('%s: LD_INPUTS := %s' % ( | 1501 self.WriteLn('%s: LD_INPUTS := %s' % ( |
1507 QuoteSpaces(self.output_binary), | 1502 QuoteSpaces(self.output_binary), |
1508 ' '.join(map(QuoteSpaces, link_deps)))) | 1503 ' '.join(map(QuoteSpaces, link_deps)))) |
1509 if self.toolset == 'host' and self.flavor == 'android': | 1504 if self.toolset == 'target' and self.flavor == 'android': |
1510 self.WriteDoCmd([self.output_binary], link_deps, 'link_host', | 1505 self.WriteDoCmd([self.output_binary], link_deps, 'link_target', |
1511 part_of_all, postbuilds=postbuilds) | 1506 part_of_all, postbuilds=postbuilds) |
1512 else: | 1507 else: |
1513 self.WriteDoCmd([self.output_binary], link_deps, 'link', part_of_all, | 1508 self.WriteDoCmd([self.output_binary], link_deps, 'link', part_of_all, |
1514 postbuilds=postbuilds) | 1509 postbuilds=postbuilds) |
1515 | 1510 |
1516 elif self.type == 'static_library': | 1511 elif self.type == 'static_library': |
1517 for link_dep in link_deps: | 1512 for link_dep in link_deps: |
1518 assert ' ' not in link_dep, ( | 1513 assert ' ' not in link_dep, ( |
1519 "Spaces in alink input filenames not supported (%s)" % link_dep) | 1514 "Spaces in alink input filenames not supported (%s)" % link_dep) |
1520 self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, | 1515 if self.toolset == 'target' and self.flavor == 'android': |
1521 postbuilds=postbuilds) | 1516 self.WriteDoCmd([self.output_binary], link_deps, 'alink_target', |
1517 part_of_all, postbuilds=postbuilds) | |
1518 else: | |
1519 self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, | |
1520 postbuilds=postbuilds) | |
1521 | |
1522 elif self.type == 'shared_library': | 1522 elif self.type == 'shared_library': |
1523 self.WriteLn('%s: LD_INPUTS := %s' % ( | 1523 self.WriteLn('%s: LD_INPUTS := %s' % ( |
1524 QuoteSpaces(self.output_binary), | 1524 QuoteSpaces(self.output_binary), |
1525 ' '.join(map(QuoteSpaces, link_deps)))) | 1525 ' '.join(map(QuoteSpaces, link_deps)))) |
1526 self.WriteDoCmd([self.output_binary], link_deps, 'solink', part_of_all, | 1526 if self.toolset == 'target' and self.flavor == 'android': |
1527 postbuilds=postbuilds) | 1527 self.WriteDoCmd([self.output_binary], link_deps, 'solink_target', |
1528 part_of_all, postbuilds=postbuilds) | |
1529 else: | |
1530 self.WriteDoCmd([self.output_binary], link_deps, 'solink', part_of_all, | |
1531 postbuilds=postbuilds) | |
1528 elif self.type == 'loadable_module': | 1532 elif self.type == 'loadable_module': |
1529 for link_dep in link_deps: | 1533 for link_dep in link_deps: |
1530 assert ' ' not in link_dep, ( | 1534 assert ' ' not in link_dep, ( |
1531 "Spaces in module input filenames not supported (%s)" % link_dep) | 1535 "Spaces in module input filenames not supported (%s)" % link_dep) |
1532 if self.toolset == 'host' and self.flavor == 'android': | 1536 if self.toolset == 'target' and self.flavor == 'android': |
1533 self.WriteDoCmd([self.output_binary], link_deps, 'solink_module_host', | 1537 self.WriteDoCmd([self.output_binary], link_deps, 'solink_module_target', |
1534 part_of_all, postbuilds=postbuilds) | 1538 part_of_all, postbuilds=postbuilds) |
1535 else: | 1539 else: |
1536 self.WriteDoCmd( | 1540 self.WriteDoCmd( |
1537 [self.output_binary], link_deps, 'solink_module', part_of_all, | 1541 [self.output_binary], link_deps, 'solink_module', part_of_all, |
1538 postbuilds=postbuilds) | 1542 postbuilds=postbuilds) |
1539 elif self.type == 'none': | 1543 elif self.type == 'none': |
1540 # Write a stamp line. | 1544 # Write a stamp line. |
1541 self.WriteDoCmd([self.output_binary], deps, 'touch', part_of_all, | 1545 self.WriteDoCmd([self.output_binary], deps, 'touch', part_of_all, |
1542 postbuilds=postbuilds) | 1546 postbuilds=postbuilds) |
1543 else: | 1547 else: |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1912 cc_command=cc_host): | 1916 cc_command=cc_host): |
1913 arflags_host = 'crsT' | 1917 arflags_host = 'crsT' |
1914 | 1918 |
1915 return { 'ARFLAGS.target': arflags_target, | 1919 return { 'ARFLAGS.target': arflags_target, |
1916 'ARFLAGS.host': arflags_host } | 1920 'ARFLAGS.host': arflags_host } |
1917 | 1921 |
1918 | 1922 |
1919 def GenerateOutput(target_list, target_dicts, data, params): | 1923 def GenerateOutput(target_list, target_dicts, data, params): |
1920 options = params['options'] | 1924 options = params['options'] |
1921 flavor = gyp.common.GetFlavor(params) | 1925 flavor = gyp.common.GetFlavor(params) |
1926 host_flavor = gyp.common.GetHostFlavor(params) | |
1922 generator_flags = params.get('generator_flags', {}) | 1927 generator_flags = params.get('generator_flags', {}) |
1923 builddir_name = generator_flags.get('output_dir', 'out') | 1928 builddir_name = generator_flags.get('output_dir', 'out') |
1924 android_ndk_version = generator_flags.get('android_ndk_version', None) | 1929 android_ndk_version = generator_flags.get('android_ndk_version', None) |
1925 default_target = generator_flags.get('default_target', 'all') | 1930 default_target = generator_flags.get('default_target', 'all') |
1926 | 1931 |
1927 def CalculateMakefilePath(build_file, base_name): | 1932 def CalculateMakefilePath(build_file, base_name): |
1928 """Determine where to write a Makefile for a given gyp file.""" | 1933 """Determine where to write a Makefile for a given gyp file.""" |
1929 # Paths in gyp files are relative to the .gyp file, but we want | 1934 # Paths in gyp files are relative to the .gyp file, but we want |
1930 # paths relative to the source root for the master makefile. Grab | 1935 # paths relative to the source root for the master makefile. Grab |
1931 # the path of the .gyp file as the base to relativize against. | 1936 # the path of the .gyp file as the base to relativize against. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1966 header_params = { | 1971 header_params = { |
1967 'default_target': default_target, | 1972 'default_target': default_target, |
1968 'builddir': builddir_name, | 1973 'builddir': builddir_name, |
1969 'default_configuration': default_configuration, | 1974 'default_configuration': default_configuration, |
1970 'flock': flock_command, | 1975 'flock': flock_command, |
1971 'flock_index': 1, | 1976 'flock_index': 1, |
1972 'link_commands': LINK_COMMANDS_LINUX, | 1977 'link_commands': LINK_COMMANDS_LINUX, |
1973 'extra_commands': '', | 1978 'extra_commands': '', |
1974 'srcdir': srcdir, | 1979 'srcdir': srcdir, |
1975 } | 1980 } |
1976 if flavor == 'mac': | 1981 if host_flavor == 'mac': |
1977 flock_command = './gyp-mac-tool flock' | 1982 flock_command = './gyp-mac-tool flock' |
1978 header_params.update({ | 1983 header_params.update({ |
1979 'flock': flock_command, | 1984 'flock': flock_command, |
1980 'flock_index': 2, | 1985 'flock_index': 2, |
1981 'link_commands': LINK_COMMANDS_MAC, | 1986 'link_commands': LINK_COMMANDS_MAC, |
1987 }) | |
1988 elif host_flavor == 'solaris': | |
1989 flock_command = './gyp-sun-tool flock', | |
1990 header_params.update({ | |
1991 'flock': flock_command, | |
1992 'flock_index': 2, | |
1993 }) | |
1994 elif host_flavor == 'freebsd': | |
1995 flock_command = 'lockf', | |
1996 header_params.update({ | |
1997 'flock': flock_command, | |
1998 }) | |
1999 | |
2000 if flavor == 'mac': | |
2001 header_params.update({ | |
1982 'extra_commands': SHARED_HEADER_MAC_COMMANDS, | 2002 'extra_commands': SHARED_HEADER_MAC_COMMANDS, |
1983 }) | 2003 }) |
2004 elif flavor == 'solaris': | |
2005 header_params.update({ | |
2006 'extra_commands': SHARED_HEADER_SUN_COMMANDS, | |
2007 }) | |
1984 elif flavor == 'android': | 2008 elif flavor == 'android': |
1985 header_params.update({ | 2009 header_params.update({ |
1986 'link_commands': LINK_COMMANDS_ANDROID, | 2010 'extra_commands': LINK_COMMANDS_ANDROID, |
1987 }) | 2011 }) |
1988 elif flavor == 'solaris': | 2012 |
1989 header_params.update({ | |
1990 'flock': './gyp-sun-tool flock', | |
1991 'flock_index': 2, | |
1992 'extra_commands': SHARED_HEADER_SUN_COMMANDS, | |
1993 }) | |
1994 elif flavor == 'freebsd': | |
1995 header_params.update({ | |
1996 'flock': 'lockf', | |
1997 }) | |
1998 header_params.update(RunSystemTests(flavor)) | 2013 header_params.update(RunSystemTests(flavor)) |
1999 | 2014 |
2000 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) | 2015 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) |
2001 make_global_settings_dict = data[build_file].get('make_global_settings', {}) | 2016 make_global_settings_dict = data[build_file].get('make_global_settings', {}) |
2002 make_global_settings = '' | 2017 make_global_settings = '' |
2003 for key, value in make_global_settings_dict: | 2018 for key, value in make_global_settings_dict: |
2004 if value[0] != '$': | 2019 if value[0] != '$': |
2005 value = '$(abspath %s)' % value | 2020 value = '$(abspath %s)' % value |
2006 if key == 'LINK': | 2021 if key == 'LINK': |
2007 make_global_settings += ('%s ?= %s $(builddir)/linker.lock %s\n' % | 2022 make_global_settings += ('%s ?= %s $(builddir)/linker.lock %s\n' % |
2008 (key, flock_command, value)) | 2023 (key, flock_command, value)) |
2009 elif key in ['CC', 'CXX']: | 2024 elif key in ['CC', 'CXX', 'AR']: |
2010 make_global_settings += ( | 2025 make_global_settings += ( |
2011 'ifneq (,$(filter $(origin %s), undefined default))\n' % key) | 2026 'ifneq (,$(filter $(origin %s), undefined default))\n' % key) |
2012 # Let gyp-time envvars win over global settings. | 2027 # Let gyp-time envvars win over global settings. |
2013 if key in os.environ: | 2028 if key in os.environ: |
2014 value = os.environ[key] | 2029 value = os.environ[key] |
2015 make_global_settings += ' %s = %s\n' % (key, value) | 2030 make_global_settings += ' %s = %s\n' % (key, value) |
2016 make_global_settings += 'endif\n' | 2031 make_global_settings += 'endif\n' |
2017 else: | 2032 else: |
2018 make_global_settings += '%s ?= %s\n' % (key, value) | 2033 make_global_settings += '%s ?= %s\n' % (key, value) |
2019 header_params['make_global_settings'] = make_global_settings | 2034 header_params['make_global_settings'] = make_global_settings |
2020 | 2035 |
2021 ensure_directory_exists(makefile_path) | 2036 ensure_directory_exists(makefile_path) |
2022 root_makefile = open(makefile_path, 'w') | 2037 root_makefile = open(makefile_path, 'w') |
2023 root_makefile.write(SHARED_HEADER % header_params) | 2038 root_makefile.write(SHARED_HEADER % header_params) |
2024 # Currently any versions have the same effect, but in future the behavior | 2039 # Currently any versions have the same effect, but in future the behavior |
2025 # could be different. | 2040 # could be different. |
2026 if android_ndk_version: | 2041 if android_ndk_version: |
2027 root_makefile.write( | 2042 root_makefile.write( |
2028 '# Define LOCAL_PATH for build of Android applications.\n' | 2043 '# Define LOCAL_PATH for build of Android applications.\n' |
2029 'LOCAL_PATH := $(call my-dir)\n' | 2044 'LOCAL_PATH := $(call my-dir)\n' |
2030 '\n') | 2045 '\n') |
2031 for toolset in toolsets: | 2046 for toolset in toolsets: |
2032 root_makefile.write('TOOLSET := %s\n' % toolset) | 2047 root_makefile.write('TOOLSET := %s\n' % toolset) |
2033 WriteRootHeaderSuffixRules(root_makefile) | 2048 WriteRootHeaderSuffixRules(root_makefile) |
2034 | 2049 |
2035 # Put build-time support tools next to the root Makefile. | 2050 # Put build-time support tools next to the root Makefile. |
2036 dest_path = os.path.dirname(makefile_path) | 2051 dest_path = os.path.dirname(makefile_path) |
2037 gyp.common.CopyTool(flavor, dest_path) | 2052 gyp.common.CopyTool(host_flavor, dest_path) |
2038 | 2053 |
2039 # Find the list of targets that derive from the gyp file(s) being built. | 2054 # Find the list of targets that derive from the gyp file(s) being built. |
2040 needed_targets = set() | 2055 needed_targets = set() |
2041 for build_file in params['build_files']: | 2056 for build_file in params['build_files']: |
2042 for target in gyp.common.AllTargets(target_list, target_dicts, build_file): | 2057 for target in gyp.common.AllTargets(target_list, target_dicts, build_file): |
2043 needed_targets.add(target) | 2058 needed_targets.add(target) |
2044 | 2059 |
2045 build_files = set() | 2060 build_files = set() |
2046 include_list = set() | 2061 include_list = set() |
2047 for qualified_target in target_list: | 2062 for qualified_target in target_list: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2124 root_makefile.write(" include " + include_file + "\n") | 2139 root_makefile.write(" include " + include_file + "\n") |
2125 root_makefile.write("endif\n") | 2140 root_makefile.write("endif\n") |
2126 root_makefile.write('\n') | 2141 root_makefile.write('\n') |
2127 | 2142 |
2128 if generator_flags.get('auto_regeneration', True): | 2143 if generator_flags.get('auto_regeneration', True): |
2129 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) | 2144 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) |
2130 | 2145 |
2131 root_makefile.write(SHARED_FOOTER) | 2146 root_makefile.write(SHARED_FOOTER) |
2132 | 2147 |
2133 root_makefile.close() | 2148 root_makefile.close() |
OLD | NEW |