Suppose I have a rule below at Makefile.
test.o: test.cpp foo.h
g++ -c -o test.o test.cpp
Now suppose that foo.hincludes bar.h, as shown below.
user $ head -n 5 foo.h
#include"bar.h"
user $
Will it be built test.oagain if there is any change in bar.h?
Or should I specifically specify bar.hin the rule, as shown below:
test.o: test.cpp foo.h bar.h
g++ -c -o test.o test.cpp
source
share