OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 '-I', options.include_path, | 24 '-I', options.include_path, |
25 '-o', options.output, | 25 '-o', options.output, |
26 options.template | 26 options.template |
27 ]) | 27 ]) |
28 | 28 |
29 build_utils.CheckOutput(gcc_cmd) | 29 build_utils.CheckOutput(gcc_cmd) |
30 | 30 |
31 | 31 |
32 def main(): | 32 def main(): |
33 parser = optparse.OptionParser() | 33 parser = optparse.OptionParser() |
| 34 build_utils.AddDepfileOption(parser) |
| 35 |
34 parser.add_option('--include-path', help='Include path for gcc.') | 36 parser.add_option('--include-path', help='Include path for gcc.') |
35 parser.add_option('--template', help='Path to template.') | 37 parser.add_option('--template', help='Path to template.') |
36 parser.add_option('--output', help='Path for generated file.') | 38 parser.add_option('--output', help='Path for generated file.') |
37 parser.add_option('--stamp', help='Path to touch on success.') | 39 parser.add_option('--stamp', help='Path to touch on success.') |
38 parser.add_option('--defines', help='Pre-defines macros', action='append') | 40 parser.add_option('--defines', help='Pre-defines macros', action='append') |
39 | 41 |
40 options, _ = parser.parse_args() | 42 options, _ = parser.parse_args() |
41 | 43 |
42 DoGcc(options) | 44 DoGcc(options) |
43 | 45 |
| 46 if options.depfile: |
| 47 build_utils.WriteDepfile( |
| 48 options.depfile, |
| 49 build_utils.GetPythonDependencies()) |
| 50 |
44 if options.stamp: | 51 if options.stamp: |
45 build_utils.Touch(options.stamp) | 52 build_utils.Touch(options.stamp) |
46 | 53 |
47 | 54 |
48 if __name__ == '__main__': | 55 if __name__ == '__main__': |
49 sys.exit(main()) | 56 sys.exit(main()) |
OLD | NEW |