cd into $DIR before attempting to build