Add getdents function to linux.
Make system/arch dependent rules generic.

    Use a wild card rule for the copying.