The cp -t flag is a GNU-ism. Instead, add a trailing slash to bindir to ensure that it is not treated as a file.