Taking a quick look, build.bat seems like it should be directly convertible to a shell script for Linux. Just get rid of the path for gcc and the parameters will work the same, barring any file changes that the Linux version might need. I also have the 'ar' program installed, I'm not sure what package it was from though.
For the purge_precompiled_parts.bat just use "rm" instead of "del" and then it should work as expected.
Hope that helps,