I have a project that can be built via makefile, and I would like to add the ability for someone in the base directory to not only be able to build the executable via make
, but also to build the documentation pdfs from LaTeX in a separate directory by typing make docs
or something similar.
I only need one pass to generate the documentation, and there are no dependencies in the .tex files.
I don't have any experience with recursive makefiles, so any general resources would also be appreciated.
PS. I am not using noweb or similar systems, I simply have some source files and some separate .tex files.
Desired behavior:
$ ls
docs/
Makefile
source1.cpp
source1.h
source2.cpp
source2.h
$ ls docs
Makefile
doc1.tex
$ make
=my program gets compiled=
$ make docs
$ ls docs
Makefile
doc1.tex
doc1.pdf