Implement flexible target specification

See commit message.
This has historically been `"macos"`