targetOne : header/headerAB.h source/sourceA.cpp source/sourceB.cpp source/main.cpp
g++ -Wall header/headerAB.h source/sourceA.cpp source/sourceB.cpp source/main.cpp
Is there a reason why I should break this in multiple targets rather then keeping it as one?
In what cases do we need to have separate targets rather than one in a Makefile?
Citing http://mrbook.org/tutorials/make/
So you will get faster recompilation after partial source update. And this is “must to implement” for huge projects, where any change is very small (comparing to entire > 1M LOC project).
Also, multiple targets allows you to set different rules for different parts of project.