#!/usr/bin/env python
import sys
import subprocess

source_file = sys.argv[1]
file_info = subprocess.check_output(['ninja', '-t', 'query', source_file])
target = file_info.split()[-1]

subprocess.call(['ninja', target])

