Hi,
I have a build system that has a top level makefile and includes
multiple makefile fragments (module.mk) from each source subdirectory.
I want the build to only rebuild the objects if the corresponding
source file or module.mk file has been touched.
eg. source tree
Makefile
src/foo/module.mk
src/foo/test1.c
src/foo/test2.c
I currently have the following generic rule in the Makefile.
build/%.o : src/%.c
$(CC) -o $@ $(CFLAGS) $<
I was thinking something along the lines of:
build/%.o : src/%.c $(<D)/module.mk
or
build/%.o : src/%.c $(dir src/%.c)module.mk
or
build/%.o : src/%.c $(dir src/$*.c)module.mk
but none of these work.
Can anyone suggest another way of achieving the same thing. I was
hoping to have a generic rule.
Please do reply-all to email me directly as well as the list.
Thanks,
Brendan Simon.
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make