OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 # makefile like $(TARGET), so hardcode the target. | 880 # makefile like $(TARGET), so hardcode the target. |
881 command = command.replace('$(TARGET)', self.target) | 881 command = command.replace('$(TARGET)', self.target) |
882 cd_action = cd_action.replace('$(TARGET)', self.target) | 882 cd_action = cd_action.replace('$(TARGET)', self.target) |
883 | 883 |
884 # Set LD_LIBRARY_PATH in case the action runs an executable from this | 884 # Set LD_LIBRARY_PATH in case the action runs an executable from this |
885 # build which links to shared libs from this build. | 885 # build which links to shared libs from this build. |
886 # actions run on the host, so they should in theory only use host | 886 # actions run on the host, so they should in theory only use host |
887 # libraries, but until everything is made cross-compile safe, also use | 887 # libraries, but until everything is made cross-compile safe, also use |
888 # target libraries. | 888 # target libraries. |
889 # TODO(piman): when everything is cross-compile safe, remove lib.target | 889 # TODO(piman): when everything is cross-compile safe, remove lib.target |
890 self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:' | 890 self.WriteLn('cmd_%s = LD_LIBRARY_PATH=\"$(builddir)/lib.host:' |
891 '$(builddir)/lib.target:$$LD_LIBRARY_PATH; ' | 891 '$(builddir)/lib.target:$$LD_LIBRARY_PATH\"; ' |
892 'export LD_LIBRARY_PATH; ' | 892 'export LD_LIBRARY_PATH; ' |
893 '%s%s' | 893 '%s%s' |
894 % (name, cd_action, command)) | 894 % (name, cd_action, command)) |
895 self.WriteLn() | 895 self.WriteLn() |
896 outputs = map(self.Absolutify, outputs) | 896 outputs = map(self.Absolutify, outputs) |
897 # The makefile rules are all relative to the top dir, but the gyp actions | 897 # The makefile rules are all relative to the top dir, but the gyp actions |
898 # are defined relative to their containing dir. This replaces the obj | 898 # are defined relative to their containing dir. This replaces the obj |
899 # variable for the action rule with an absolute version so that the output | 899 # variable for the action rule with an absolute version so that the output |
900 # goes in the right place. | 900 # goes in the right place. |
901 # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); | 901 # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); |
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 root_makefile.write("endif\n") | 2172 root_makefile.write("endif\n") |
2173 root_makefile.write('\n') | 2173 root_makefile.write('\n') |
2174 | 2174 |
2175 if (not generator_flags.get('standalone') | 2175 if (not generator_flags.get('standalone') |
2176 and generator_flags.get('auto_regeneration', True)): | 2176 and generator_flags.get('auto_regeneration', True)): |
2177 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) | 2177 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) |
2178 | 2178 |
2179 root_makefile.write(SHARED_FOOTER) | 2179 root_makefile.write(SHARED_FOOTER) |
2180 | 2180 |
2181 root_makefile.close() | 2181 root_makefile.close() |
OLD | NEW |