I have never written a single line of Erlang, but I run my own ejabberd. However, looking at the package build scripts and build instruction, I have the impression that compiling a project like ejabberd can be complicated.

Does someone know if this is an inherent Erlang problem or just due to some weird project setup in this case?

Ejabberd runs with a lot of legacy. Essentially the first build tool that could pull deps in Erlang dates from 2007-2009, and it took another few years before more modern tools came to be in what their current form is.

All these bigger projects tend to have a bit weirder idiomatic build setups because they had to haphazardly reimplement bits of (at the time) yet non-existing build systems by hand.

Okay, but if I would start a project today, there would be better tools? Are those documented in the Erlang documentation or are there any recommendations on which tool I should use?

As one of its maintainers I’m partial to rebar3 (http://www.rebar3.org/)

It’s become near-official for OSS Erlang work and the OTP team has moved the repo under their GitHub organisation (https://github.com/erlang/rebar3)

Erlang.mk tends to be the other option otherwise.