> I want to measure much the runtimes for each of the three operations
> that computes A, B and C. I'm wondering how to do it with gnu make.
You can always use date from the shell:
$ cat Makefile
.PHONY: all
start := $(shell date +%N)
A := $(patsubst %.1, %, $(wildcard *.1))
after_A := $(shell date +%N)
B := $(patsubst %.2, %, $(wildcard *.2))
after_B := $(shell date +%N)
C := $(filter $(A),$(B))
after_C := $(shell date +%N)
all:
echo $(C)
@echo "A=$(shell expr $(after_A) - $(start)) nsec"
@echo "B=$(shell expr $(after_B) - $(after_A)) nsec"
@echo "C=$(shell expr $(after_C) - $(after_B)) nsec"
a:
@touch a.1 b.1 c.1
b:
@touch a.2 b.2 d.2
This will include the time to invoke date - which you can measure and
compensate for.
Note that I changed your Makefile to use direct assignments to avoid deferring
the assignment.
Sam
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make