parent
a3544847ca
commit
e87d3c07ad
6 changed files with 59 additions and 1 deletions
@ -0,0 +1,10 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
|
||||||
|
import time, sys |
||||||
|
|
||||||
|
# Make sure other script runs first if dependency |
||||||
|
# is missing. |
||||||
|
time.sleep(0.5) |
||||||
|
|
||||||
|
contents = open(sys.argv[1], 'r').read() |
||||||
|
open(sys.argv[2], 'w').write(contents) |
@ -0,0 +1,9 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
|
||||||
|
import sys |
||||||
|
from glob import glob |
||||||
|
|
||||||
|
files = glob('*.tmp') |
||||||
|
assert(len(files) == 1) |
||||||
|
|
||||||
|
open(sys.argv[1], 'w').write(open(files[0], 'r').read()) |
@ -0,0 +1 @@ |
|||||||
|
This is a piece of text. |
@ -0,0 +1,20 @@ |
|||||||
|
project('custom target dependency', 'c') |
||||||
|
|
||||||
|
# Sometimes custom targets do not take input files |
||||||
|
# but instead do globbing or some similar wackiness. |
||||||
|
# In this case we need to be able to specify a |
||||||
|
# manual dependency between two custom targets, |
||||||
|
# if one needs to be run before the other. |
||||||
|
|
||||||
|
g1 = find_program('gen1.py') |
||||||
|
g2 = find_program('gen2.py') |
||||||
|
|
||||||
|
c1 = custom_target('medput', |
||||||
|
input : 'input.dat', |
||||||
|
output : 'medput.tmp', |
||||||
|
command : [g1, '@INPUT@', '@OUTPUT@']) |
||||||
|
|
||||||
|
custom_target('output', |
||||||
|
output : 'output.dat', |
||||||
|
command : [g2, '@OUTPUT@'], |
||||||
|
depends : c1) |
Loading…
Reference in new issue