changed to (hopefully) allow the build dir to be outside of the source dir
fixed logic inversion problem