Let's say I have a makefile with the rule
%.o: %.c
gcc -Wall -Iinclude ...
I want *.o to be rebuilt whenever a header file changes. Rather than work out a list of dependencies, whenever any header file in /include
changes, then all objects in the dir must be rebuilt.
I can't think of a nice way to change the rule to accomodate this, I'm open to suggestions. Bonus points if the list of headers doesn't have to be hard-coded