Implement flexible target specification

See commit message.
This comment was lost when transferring the info down to the linux target below