Error when building documentation of Postgres
Error: ENOENT, no such file or directory '/Users/thomas/Source/postgres/doc/src/sgml/-p'


I'd say you have some ancient version of one of the required tools, and it's seeing the -p command-line switch as a regular path argument instead.