печально быть антисоциальным - dažreiz kaitina, ka murgs ir iebūvēts sistēmas pamatos

Nov. 6th, 2013

07:39 pm - dažreiz kaitina, ka murgs ir iebūvēts sistēmas pamatos

Previous Entry Add to Memories Tell A Friend Next Entry

"These dependency files are then all included by the makefile, to obtain dependency info. An implicit rule is provided that describes how the dependency files are to be created. In short, something like this:

 
SRCS = foo.c bar.c ...

  %.P : %.c
          $(MAKEDEPEND)
          @sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $*.d > $@; \
             rm -f $*.d; [ -s $@ ] || rm -f $@

  include $(SRCS:.c=.P)
"
http://mad-scientist.net/make/autodep.html

(3 comments | Leave a comment)

Comments:

From:[info]wasted
Date:November 6th, 2013 - 08:07 pm
(Link)
Nav jau tik traki.

DEPS := $(OBJS:.o=.d)

%.o : %.c
	$(CC) -MM -MP -MF $*.d -MT "$@" $<
	$(CC) -o $@ -c $<

-include $(DEPS)
(Reply to this) (Thread)
[User Picture]
From:[info]smejmoon
Date:November 6th, 2013 - 08:10 pm
(Link)
TIK traki jau nav. Es nesen uzzināju par atšķirību starp -MM un -MMD.
(Reply to this) (Parent) (Thread)
From:[info]wasted
Date:November 6th, 2013 - 08:57 pm
(Link)
O, to nezināju. Gadiem neesmu skāries klāt.
(Reply to this) (Parent)