write:
@echo `date`
file_1: write file_2
@echo "file_1 begin"
$(shell sleep 3)
@echo "file_1 end"
file_3: write file_4
@echo "file_3 begin"
$(shell sleep 3)
@echo "file_3 end"
all: file_1 file_3
.PHONY: write
When I run make, it outputs:
Sat Oct 9 15:22:45 CST 2021
file_1 begin
file_3 begin
file_1 end
file_3 end
target write
run only once.
My ultimate goal is to calculate the execution time of file_1
and file_3
by writing the start time of target write
. In the process of testing whether it will be covered, the above problems were found. If there is a better way to calculate the time, let me know.