Hi all,
The "Auto dependecy generation" mechanism can be used to generation dependency list for a target automatically. For a C file this can be done by invoking gcc with the -MM switch. So in a make file we normally have the following rule to generate dependency files and later include them:

-------------------------------------------------------------------------------------
%.d: %.c
            @set -e; rm -f $@; \
             $(CC) -M $(CPPFLAGS) $< > $...@.$$$$; \
             sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $...@.$$$$ > $@; \
             rm -f $...@.$$$$

    sources = foo.c bar.c

    include $(sources:.c=.d)
-------------------------------------------------------------------------------------

When using the above facility how can use the "Target specific variable values" facility?
For example, I would want the CPP flag -DLINUX to be defined for foo.c only.

Regards,
mwnn



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to