creating intermediate file inside output directory

intermediate files made the source directory dirty during and after compilation and this fixes the problem.