Factor out some common bits of `arch/*/makefile`