I'm working on a large firmware and I've to add GNU gprof to only some modules(file directories) of it. The makefiles have inherited structure. So I do it this way:
ft/*.o : ft/*.c
CFLAGS += -pg
ft/*.o : ft/*.c
LDFLAGS += -pg
But this gives me a warning that it will overwrite the CFLAGS and then it adds the gprof to all the modules. My guess is that CFLAG is somewhere common. How can I make sure that CFLAG only works on the part of module(directory) I want on?