Macroscopic maximally-entangled-state preparation between two atomic ensembles