Mining companies either become smart or perish.