pull out some logic from Makefile into bin/ivy-scalac and bin/ivy-scala