I use target-specific variable definitions for things like CFLAGS
and CPPFLAGS.
Unfortunately, GNU make's ability to automatically make makefiles
can't take advantage of this:
prog: CPPFLAGS = -I/my/include/dir
prog: file1.o file2.o
%.d: %.c
$(CC) -MM $(CPPFLAGS) $< > $@
include file1.d file2.d
Since the rule that makes file.d and file2.d is not invoked
as a dependency of prog, CPPFLAGS is not set to the correct
value.
What's the right way to do this? I have a number of dependency
includes which need to use different CPPFLAGS to search different
header directories. I'd rather not have to define prog_CPPFLAGS,
prog2_CPPFLAGS and then do some command magic to use the right
variable in the $(CC) -MM invocation depending on the value of [EMAIL PROTECTED]
Thanks again.
-Dave
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make