Compile unit test natively and cross compile code for embedded target

It looks as though the first question has already been answered before: