We are using branching in our project extensively, and it seems when switching a branch, sometimes artifacts (objects) form the previous branch will remain. I think it is due to the matter that source files might have an older mtime in other branches, so the specific target doesn't get rebuild.
To avoid that I'd like the build system to force a clean, when an other branch is being checked out.