Move dependency checks to one-time build

So we don't re-run "shell ... grep ... sed ..." on every make

This makes "time make -j 4 all" on a clean build drop ~50% in
time