A method for calculating "constant volume" pair potentials in Al-rich transition-metal compounds is presented. The method is based on a combination of a Green's-function analysis of the interaction between transition-metal d shells, and a perturbative treatment of the Al and transition-metal pseudopotentials. In addition to the d-shell interactions, the pair potentials include terms describing interactions between pseudopotentials on different atoms, as well as interactions between the pseudopotential on one atom and the charge density induced by the d shell on another atom. The potentials are parametrized by use of both ab initio total-energy results and experimental inputs. The methodology is tested by calculating the energies of many different structures at the Al-rich end of the Al-Co phase diagram. The potentials correctly predict the sequence of complex phases that occurs with increasing Co content, with just one exception. The complex phases are favored relative to simpler fcc-based phases by a large energy due mainly to short-ranged spacing constraints. The Co-Co potential has a secondary minimum at 4.4 A which coincides with the Co-Co spacings in the complex structures, and thus further enhances their stability.