test cases/common/49 custom target/depfile/dep.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import sys, os |
| 4 | from glob import glob |
| 5 | |
| 6 | _, srcdir, depfile, output = sys.argv |
| 7 | |
| 8 | depfiles = glob(os.path.join(srcdir, '*')) |
| 9 | |
| 10 | quoted_depfiles = [x.replace(' ', r'\ ') for x in depfiles] |
| 11 | |
| 12 | with open(output, 'w') as f: |
| 13 | f.write('I am the result of globbing.') |
| 14 | with open(depfile, 'w') as f: |
| 15 | f.write('{}: {}\n'.format(output, ' '.join(quoted_depfiles))) |