On Mon, Dec 06, 2010 at 11:02:38AM +0330, ali hagigat wrote:
> In section 4.13, we have the following example:
> ----------------------------------------------------------
> %.d: %.c
> @set -e; rm -f $@; \
> $(CC) -M $(CPPFLAGS) $< > $...@.$$$$; \
> sed ’s,\($*\)\.o[ :]*,\1.o $@ : ,g’ < $...@.$$$$ > $@; \
> rm -f $...@.$$$$
> ----------------------------------------------------------
> Under what conditions this implicit rule is executed?
> Would you please give an example?
> 
> Why the 'sed' command is necessary? and why we need to have the following 
> rule:
> main.o main.d : main.c defs.h
> Can the command, 'sed' be replaced with:
> cp $...@.$$$$ $@
> (I mean we have one .d file for each .c file and it will be included,
> why we need a rule like   main.d : main.c defs.h? This rule is without
> recipe and what is it supposed to do?)

Sorry Ali.
I have tried to explain things but obvioulsy without luck.
Please go ahead and try out the things described - and _then_ ask questions.
I guess you would then figure out that the above has a receipe,
the purpose of sed etc.

Until then,

        Sam

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

Reply via email to