added a parameter to override the target directory for the optimized
files