simplify build.sh; extract definitions into separate Platform files