dump-emacs

dump-emacs is a built-in function in `C source code'.

(dump-emacs FILENAME SYMFILE)

Dump current state of Emacs into executable file FILENAME.
Take symbols from SYMFILE (presumably the file you executed to run Emacs).
This is used in the file `loadup.el' when building Emacs.

You must run Emacs in batch mode in order to dump it.