PDF:
Use a pdf merging utility. Calibre comes with one that is command line only called pdf-manipulate.
EPUB using Sigil:
- Convert EPUB to HTMLZ (I recommend using the inline CSS option) using calibre.
- HTMLZ is a ZIP archive so unzip.
- Take the HTML file created form the HTMLZ conversion and add it as a page in Sigil.
- Repeat until you have all pages added to Sigil.
- Save the file in Sigil (it will be an EPUB).
You now have a single EPUB.
Other Formats:
Use the same steps as EPUB but substitute EPUB for a format calibre can use as conversion input.