First, you have to clone emacs and checkout your branch of choice (most likely a major version branch like `emacs29`). Go nuts, though, this step is half the fun of building from source.
Once you’ve done that, you have to generate a bunch of c files templatized for different operating systems:
./autogen.sh
twiddles thumbs