Exelixis may have had a rough moment this summer in its relationship with Bristol-Myers Squibb, but apparently the two companies still see a lot in common and no reason to break up.

South San Francisco-based Exelixis (NASDAQ: EXEL) said today it has struck a new partnership in which it will get a $60 million upfront payment, $505 million more in development and regulatory milestone payments, plus royalties on sales. In return, Bristol-Myers gets the exclusive worldwide commercial rights to develop small molecule drugs that stimulate a target called TGR5 and block another called ROR. The former target is thought to provide a new approach for treating diabetes, and the latter is thought to be important for treating inflammatory disorders.

The new partnership provides an important shot of cash, and some renewed validation to Exelixis after it went through a rough patch this summer. Back in June, Bristol decided to terminate a partnership with Exelixis to co-develop XL184, a high-profile cancer drug candidate. Nine days later, CEO George Scangos resigned to take the CEO job at Cambridge, MA-based Biogen Idec (NASDAQ: BIIB). Exelixis, despite its reputation for building one of the industry’s most prolific pipelines of drug candidates, saw its stock dip below $3 a share briefly this summer.

As part of today’s partnership announcement, Exelixis said it has chosen not to co-develop another cancer drug the companies have been working on, XL139, granting Bristol the full rights to the compound.

“We continue our strong relationship with Bristol-Myers Squibb and are excited for these collaborations to maximize the potential of these novel programs and bring benefits to patients with serious diseases,” said Exelixis CEO Michael Morrissey, in a statement.