bug-make
[Top][All Lists]
Advanced

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

[bug #54791] means to generate the list of dependencies for a given targ


From: Markus Kuhn
Subject: [bug #54791] means to generate the list of dependencies for a given target
Date: Fri, 5 Oct 2018 14:04:22 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0

URL:
  <https://savannah.gnu.org/bugs/?54791>

                 Summary: means to generate the list of dependencies for a
given target
                 Project: make
            Submitted by: mgk25
            Submitted on: Fri 05 Oct 2018 06:04:20 PM UTC
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.1
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

It would be very useful to have an official means of generating a list of all
files on which a given target depends.

One existing way to generate such a list is to parse the output of option -d
for "Considering" lines, as in:


$ make -Bndr <target-file> | perl -ne "/Considering target file '(.+)'./ &&
print \"\$1\\n\""


But this *hack* is based on a potentially unstable format of a debugging
function, so not something recommendable for production scripts.

It would be nice to have both a proper command-line option
"make -D <target>" and a function $(dependencies <target>) to generate such a
list for <target>.

Example application: I want to find out what is the latest git commit that
modified any of the dependencies of <target> (for example to derive a version
number for that target from that commit using "git describe"). Using the
proposed facilities, I could do that with


$ make -D <target> | xargs git log -n1 --pretty=format:%H --


or inside a Makefile


        git log -n1 --pretty=format:%H -- $(dependencies <target>)






    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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