I'm using a setup with latexmk and different folders for source files, build files and my output.

I want to use the nomencl package and thus used the custom rc file as in [latexmk and nomencl](https://tex.stackexchange.com/questions/105943/latexmk-and-nomencl).
However, makeindex cannot be invoked from another directory and thus produces errors. Instead, I'd need to cd into my build directory first and then change back to the source folder.

How do I do this with latexmk?