bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60297] optimize autodeps


From: Paul D. Smith
Subject: [bug #60297] optimize autodeps
Date: Sun, 4 Apr 2021 14:56:16 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36

Follow-up Comment #15, bug #60297 (project make):

Just a note, in various examples you give prerequisites to the
.SECONDEXPANSION target; these are ignored.  .SECONDEXPANSION is either on or
off, for the entire makefile (starting with where it was defined).  It doesn't
currently support being applied only to a subset of targets, although this
could be added as a feature.

Thanks for the extra detail.  I want to preface this by just saying I don't
really have anything against the concept of a NOTINTERMEDIATE facility, I'm
just generally against adding complexity, and there's already a lot of
complexity around intermediate/secondary/etc. files :)

There are two reasons to use this new target type in your proposal.  Let us
consider them separately.

The first is for %.h.  However, this is not really necessary as far as I can
tell.  First, all the headers will be listed (after the $(file <%.d) is
expanded) as explicit prerequisites of the target so they won't be
intermediate files anyway.  Second, headers are almost always source files
(not built by make and so not eligible to be removed).  The only time a source
file would be removed is if the user deleted it, which is why the %.h pattern
exists: solely as a way to keep make from complaining until the .d file can be
rebuilt and the deleted header disappears.  In the rare situations where a
header is an intermediate file (built from something else) you currently need
to list it as a specific prerequisite anyway and people seem OK with that.

The second is for %.d.  Assuming we have some variable or set of variables
that lists all the object files to be built, which almost all makefiles must
have or can have cheaply, we don't really need this one because we can force
all the %.d files to be not intermediate by mentioning them somewhere as a
prerequisite to some target.  For example:

    build-deps: $(OBJECTS:%.o=%.d)

will be sufficient.

I will agree that there's something nice about being able to just mark all %.d
files as not intermediate without having to know all the .o files in a
variable like this.  But is it worth the extra complexity?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60297>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]