Revert "Simplify build target order"

This reverts commit 42dc9d517cdb61d0fbb0d3bfe8705ef8fb9cf134.