Hello...after fiddling around a bit learning make, I'd like to suggest
a minor change to the make manual at http://www.gnu.org/manual/make/

In the section "Generating Prerequisites Automatically", there's a
sed script used to add a rule for the .d file.  The problem I ran into 
is that I was using source files in a different directory than the 
Makefile, and thus they contained slashes, which blew up the sed 
expression.  I used a subst expression to escape out the slashes, and 
things started working again.

I also '@'-ed the expression to keep the noise down.

Anyway, I thought these fixes might be handy to pass on.

   Sincerely,

        Scott A. Colcord
        Software Engineer


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


_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to