An example for vim-latex/vim-latex#20. With vim-latex installed, run the following command
vim -o a.tex b.tex a.log +'set ft=tex autoread makeprg=pdflatex\ \\\\nonstopmode\ \\\\input\\{%} | make | copen'
The quickfix window should show b.tex as the file names, but the bug in errorformat makes vim lose track of filenames.