One of the longstanding problems when modifying code in the mozilla code base, is that when you change some file under e.g.
content/, and you don’t want to waste the whole lot of time it takes to run a complete
make -f client.mk, you need to build under
layout/build/, and finally
toolkit/library/. And you need to remember that (or use tools that remember for you).
These days are finally over. After several attempts a year ago (!), and again several attempts during the past weeks, bug 644608 is finally on mozilla-central and is likely to stick, this time. There may be some corner cases, in which case please file bugs.
Anyways, Now, you just need to build under e.g.
toolkit/library/. No need to rebuild