rewrite platform magic in makefile, introduce targets for different platforms