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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 "%s " % precompiled_header.GetInclude('m') + | 1218 "%s " % precompiled_header.GetInclude('m') + |
1219 "$(CFLAGS_$(BUILDTYPE)) " | 1219 "$(CFLAGS_$(BUILDTYPE)) " |
1220 "$(CFLAGS_C_$(BUILDTYPE)) " | 1220 "$(CFLAGS_C_$(BUILDTYPE)) " |
1221 "$(CFLAGS_OBJC_$(BUILDTYPE))") | 1221 "$(CFLAGS_OBJC_$(BUILDTYPE))") |
1222 self.WriteLn("$(OBJS): GYP_OBJCXXFLAGS := " | 1222 self.WriteLn("$(OBJS): GYP_OBJCXXFLAGS := " |
1223 "$(DEFS_$(BUILDTYPE)) " | 1223 "$(DEFS_$(BUILDTYPE)) " |
1224 "$(INCS_$(BUILDTYPE)) " | 1224 "$(INCS_$(BUILDTYPE)) " |
1225 "%s " % precompiled_header.GetInclude('mm') + | 1225 "%s " % precompiled_header.GetInclude('mm') + |
1226 "$(CFLAGS_$(BUILDTYPE)) " | 1226 "$(CFLAGS_$(BUILDTYPE)) " |
1227 "$(CFLAGS_CC_$(BUILDTYPE)) " | 1227 "$(CFLAGS_CC_$(BUILDTYPE)) " |
| 1228 "$(CFLAGS_OBJC_$(BUILDTYPE)) " |
1228 "$(CFLAGS_OBJCC_$(BUILDTYPE))") | 1229 "$(CFLAGS_OBJCC_$(BUILDTYPE))") |
1229 | 1230 |
1230 self.WritePchTargets(precompiled_header.GetGchBuildCommands()) | 1231 self.WritePchTargets(precompiled_header.GetGchBuildCommands()) |
1231 | 1232 |
1232 # If there are any object files in our input file list, link them into our | 1233 # If there are any object files in our input file list, link them into our |
1233 # output. | 1234 # output. |
1234 extra_link_deps += filter(Linkable, sources) | 1235 extra_link_deps += filter(Linkable, sources) |
1235 | 1236 |
1236 self.WriteLn() | 1237 self.WriteLn() |
1237 | 1238 |
1238 def WritePchTargets(self, pch_commands): | 1239 def WritePchTargets(self, pch_commands): |
1239 """Writes make rules to compile prefix headers.""" | 1240 """Writes make rules to compile prefix headers.""" |
1240 if not pch_commands: | 1241 if not pch_commands: |
1241 return | 1242 return |
1242 | 1243 |
1243 for gch, lang_flag, lang, input in pch_commands: | 1244 for gch, lang_flag, lang, input in pch_commands: |
1244 extra_flags = { | 1245 extra_flags = { |
1245 'c': '$(CFLAGS_C_$(BUILDTYPE))', | 1246 'c': '$(CFLAGS_C_$(BUILDTYPE))', |
1246 'cc': '$(CFLAGS_CC_$(BUILDTYPE))', | 1247 'cc': '$(CFLAGS_CC_$(BUILDTYPE))', |
1247 'm': '$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))', | 1248 'm': '$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))', |
1248 'mm': '$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))', | 1249 'mm': '$(CFLAGS_CC_$(BUILDTYPE)) ' |
| 1250 '$(CFLAGS_OBJC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))', |
1249 }[lang] | 1251 }[lang] |
1250 var_name = { | 1252 var_name = { |
1251 'c': 'GYP_PCH_CFLAGS', | 1253 'c': 'GYP_PCH_CFLAGS', |
1252 'cc': 'GYP_PCH_CXXFLAGS', | 1254 'cc': 'GYP_PCH_CXXFLAGS', |
1253 'm': 'GYP_PCH_OBJCFLAGS', | 1255 'm': 'GYP_PCH_OBJCFLAGS', |
1254 'mm': 'GYP_PCH_OBJCXXFLAGS', | 1256 'mm': 'GYP_PCH_OBJCXXFLAGS', |
1255 }[lang] | 1257 }[lang] |
1256 self.WriteLn("%s: %s := %s " % (gch, var_name, lang_flag) + | 1258 self.WriteLn("%s: %s := %s " % (gch, var_name, lang_flag) + |
1257 "$(DEFS_$(BUILDTYPE)) " | 1259 "$(DEFS_$(BUILDTYPE)) " |
1258 "$(INCS_$(BUILDTYPE)) " | 1260 "$(INCS_$(BUILDTYPE)) " |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 root_makefile.write(" include " + include_file + "\n") | 2130 root_makefile.write(" include " + include_file + "\n") |
2129 root_makefile.write("endif\n") | 2131 root_makefile.write("endif\n") |
2130 root_makefile.write('\n') | 2132 root_makefile.write('\n') |
2131 | 2133 |
2132 if generator_flags.get('auto_regeneration', True): | 2134 if generator_flags.get('auto_regeneration', True): |
2133 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) | 2135 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) |
2134 | 2136 |
2135 root_makefile.write(SHARED_FOOTER) | 2137 root_makefile.write(SHARED_FOOTER) |
2136 | 2138 |
2137 root_makefile.close() | 2139 root_makefile.close() |
OLD | NEW |