How are programming compilers made?

A compiler is itself a computer program. This program would read the source code of another program, and write machine code to accomplish whatever that program is supposed to do.