If the question is how to make sure that make (as opposed to make docs) also rebuilds your documentation:
Make a docs target that is either phony or has all source and header files listed as dependencies.
Make sure your default target (the first one in the makefile) has both docs and your executable as dependencies.
For example
all: hello docs .PHONY: docs docs: @doxygen ./Doxyfile hello: hello.o foo.o ... hello.o: hello.cpp hello.h foo.h ... foo.o: foo.cpp foo.h ...
Alternative which will only rerun Doxygen if any of its inputs changed (more work to maintain though):
all: hello docs # Doxygen needs to be rerun if the Doxyfile changed, or if any source or # header file with Doxygen comments changed. If all your comments are in # the headers, you don't need to include the .cpp files. docs: hello.cpp hello.h foo.cpp foo.h ./Doxyfile @doxygen ./Doxyfile hello: hello.o foo.o ... hello.o: hello.cpp hello.h foo.h ... foo.o: foo.cpp foo.h ...
(Make sure to replace the spaces before the build rules by tabs in the actual Makefile)
doxygen ./Doxyfiledirectly do nothing? What aboutmake docs? Have you tried adding the linePHONY: docsto your Makefile?.PHONY: docs(with a period in the beginning?). I think it's only really needed if doxygen is putting its output in a docs/ directory. In that case, make will notice the directory already exists and since there are no dependencies listed, it will not rebuild it. If there is no file or directory called "docs", the target will be rebuilt every time, but I agree it's still cleaner to mark it as phony. Even better would be to list all the source and header files as dependencies instead (so you only rerun doxygen if anything has changed).