This question already has an answer here:
I have a .tex file that includes several chapters (all through the
\input command). I would like to run
pdflatex in one command such that it saves each chapter into a separate PDF file, while maintaining correct references to sections, bibliography (that appears in the end) and so on. Is that possible?