Added logic to produce targets file.