Its pretty well docuented in this sticky
forum.linuxcnc.org/ethercat/45336-etherc...-how-to-step-by-step
There is another sticky in the ethercat section dealing with building the ethercat master from iGh
There are 3 seperate core components.
Linuxcnc
The Ethercat master
The linuxcnc ethercat driver
If you have CIA402 compatible drives (that is all I would buy) the CIA402 component is recommended as it makes it all easier.
Linuxcnc is our favourite CNC controller
Ethercat master is an open source ethercat master that finds and connects to the slaves
The hal driver connects linuxcnc to the ethercat master
It requires a custom xml file that describes the ethercat environment to linuxcnc
the cia402 component is designed to simplify connecting a drive that is compliant with the CIA402 standard whichh specifies specific regster level compatability.
I might add that it is no longer necessary to compile anything to use ethercat. Everything (except the cia402 component) is contained in repositories which are already connected in the 2.91 ISO on the downloads page.
You just need to type
sudo apt update
sudo apt install ethercat-master libethercat-dev linuxcnc-ethercat
And follow the instructions on the sticky.