[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Measure time spent in each target of a Makefile
From: |
Matthias Puech |
Subject: |
Re: Measure time spent in each target of a Makefile |
Date: |
Mon, 08 Aug 2011 18:29:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 |
Dear Greg,
Thank you for your quick reply. I am sorry, my question was not clear
enough. I am aware of the SHELL trick but it doesn't quite fit my needs.
I need to be able to know the time taken by each *target*, not just the
commands launched. For example if I have:
.PHONY: all binary doc
all: binary doc
binary: bin/exec
doc: doc/refman.pdf html
html: ...
I would like to see (or construct) something like:
all: 5s
binary: 2s
[all sub-targets of binary]
doc: 3s
doc/refman.pdf: pdflatex doc/refman.tex (1s)
[all sub-targets of doc] (2s)
I could of course sum all the times taken by ([time]-wrapped) commands
in a given sub-target, but then how to know in which target, sub-target
etc. I am in? Maybe the right question is then:
How can I pass to the SHELL command the *list* of targets this command
is executed for. $@ doesn't suffice since I need the whole path.
Example: when the pdflatex command is run, I need to retrieve:
all :: doc :: doc/refman.pdf
Thank you very much for any advice,
-m
PS: could you cc me in reply, I'm not subscribed to the list?