Added buildscript for Mac.
Added cmdline device support to os x buildscript.