Makefile, header dependencies
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 dmckee If you are using a GNU compiler, the compiler can assemble a list of dependencies for you. Makefile fragment: depend: .depend .depend: $(SRCS) rm -f ./.depend $(CC) $