NEW YORK — Roger N. Farah could rake in $10 million without ever working a day for R.H. Macy & Co.

Under the terms of his bankruptcy court-approved contract with Macy’s, Farah has the option to terminate his agreement if there is a change in Macy’s management triggered by an outside party acquiring a stake of 30 percent or more in the chain.

If Farah opts to end the contract, he would be entitled to three times his annual $1.2 million salary, three times his $600,000 minimum bonus, and the right to immediately exercise stock options with a guaranteed value of another $5 million.

Farah is set to join Macy’s as president and chief operating officer on July 1, but some are beginning to ponder the fate of Macy’s management team following a bid by Farah’s former employer — Federated Department Stores — to acquire Macy’s.

Myron E. Ullman, Macy’s chairman and chief executive officer, could also receive a multi-million-dollar windfall should Federated acquire control of Macy’s.

If an ownership change occurs after July, Ullman would be entitled to about $4 million — twice what will then be his annual salary of $1.25 million — plus bonuses. Ullman negotiated an amended contract that increased his annual salary from $880,000 and granted him future stock options once Macy’s emerges from Chapter 11. However, the pact is not effective until Farah starts working at Macy’s.

If the change should happen before then, Ullman would get twice his current annual salary and bonuses, or about $2 million.

Farah was the center of a battle between Macy’s and Federated last fall when Macy’s succeeded in wooing him away from his position as chairman and chief executive officer of Federated Merchandising Services.

Federated tried to block Farah from going to Macy’s based on a no-compete clause in his Federated contract.

The dispute was settled in November when Macy’s agreed to pick up Farah’s $1 million Federated salary through June and allowed Federated to file a $3.3 million claim against Macy’s for use of Federated’s SABRE computer system.