I am using Ubuntu on a bespoke router and after seeing the latency drops capable with custom compiling on Gentoo, I would like to recompile all packages with CFLAGS="-march=atom". The guide for this and a helpful forum thread demonstrate the recompilation steps:
export CFLAGS="-march=nocona"
export CXXFLAGS="-march=nocona"
apt-get build-dep packagename
apt-get -b source packagename
dpkg -i *.deb
Is it possible to automate a complete system recompilation instead of specifying one package at a time and to automatically recompile new package updates before they are installed?