OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Notes: | 3 # Notes: |
4 # | 4 # |
5 # This is all roughly based on the Makefile system used by the Linux | 5 # This is all roughly based on the Makefile system used by the Linux |
6 # kernel, but is a non-recursive make -- we put the entire dependency | 6 # kernel, but is a non-recursive make -- we put the entire dependency |
7 # graph in front of make and let it figure it out. | 7 # graph in front of make and let it figure it out. |
8 # | 8 # |
9 # The code below generates a separate .mk file for each target, but | 9 # The code below generates a separate .mk file for each target, but |
10 # all are sourced by the top-level Makefile. This means that all | 10 # all are sourced by the top-level Makefile. This means that all |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 | 723 |
724 | 724 |
725 def FixupArgPath(self, arg): | 725 def FixupArgPath(self, arg): |
726 if '/' in arg or '.h.' in arg: | 726 if '/' in arg or '.h.' in arg: |
727 return self.Absolutify(arg) | 727 return self.Absolutify(arg) |
728 return arg | 728 return arg |
729 | 729 |
730 | 730 |
731 def GenerateOutput(target_list, target_dicts, data, params): | 731 def GenerateOutput(target_list, target_dicts, data, params): |
732 options = params['options'] | 732 options = params['options'] |
733 generator_flags = params['generator_flags'] | 733 generator_flags = params.get('generator_flags', {}) |
734 builddir_name = generator_flags.get('output_dir', 'out') | 734 builddir_name = generator_flags.get('output_dir', 'out') |
735 | 735 |
736 # TODO: search for the first non-'Default' target. This can go | 736 # TODO: search for the first non-'Default' target. This can go |
737 # away when we add verification that all targets have the | 737 # away when we add verification that all targets have the |
738 # necessary configurations. | 738 # necessary configurations. |
739 default_configuration = None | 739 default_configuration = None |
740 for target in target_list: | 740 for target in target_list: |
741 spec = target_dicts[target] | 741 spec = target_dicts[target] |
742 if spec['default_configuration'] != 'Default': | 742 if spec['default_configuration'] != 'Default': |
743 default_configuration = spec['default_configuration'] | 743 default_configuration = spec['default_configuration'] |
(...skipping 20 matching lines...) Expand all Loading... |
764 writer.Write(qualified_target, output_file, options.depth, spec, configs) | 764 writer.Write(qualified_target, output_file, options.depth, spec, configs) |
765 | 765 |
766 # Our root_makefile lives at the source root. Compute the relative path | 766 # Our root_makefile lives at the source root. Compute the relative path |
767 # from there to the output_file for including. | 767 # from there to the output_file for including. |
768 submakefile_path = gyp.common.RelativePath(output_file, options.depth) | 768 submakefile_path = gyp.common.RelativePath(output_file, options.depth) |
769 root_makefile.write('include ' + submakefile_path + "\n") | 769 root_makefile.write('include ' + submakefile_path + "\n") |
770 | 770 |
771 root_makefile.write(SHARED_FOOTER) | 771 root_makefile.write(SHARED_FOOTER) |
772 | 772 |
773 root_makefile.close() | 773 root_makefile.close() |
OLD | NEW |