将我的构建的持续时间添加到Makefile中 [英] Adding time duration of my build into Makefile

查看:87
本文介绍了将我的构建的持续时间添加到Makefile中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建完成后,我想将Makefile构建的构建持续时间添加到打印输出中.

构建持续时间:1:23.45

我没有找到任何有关此操作的信息,但它必须是可行的..现在我打印以$(TIME)完成的时间,但我想打印多长时间构建完成.我正在使用clearmake.

解决方案

time二进制文件提供了此功能.您需要专门执行它来绕过外壳程序内置的任何时间命令(如bash中一样):

/usr/bin/time --format="Build Duration: %E" make

I would like to add the build time duration of my Makefile build to the printout when the build is done.. something like this:

Build Duration: 1:23.45

I haven't been able to find anything about doing this but it has to be do-able.. Right now i print the time in which is completes with $(TIME), but i'd like to print how long the build took to complete. I am using clearmake.

解决方案

The time binary supplies this functionality. You need to specifically execute it to bypass any time command built into your shell (as in bash):

/usr/bin/time --format="Build Duration: %E" make

这篇关于将我的构建的持续时间添加到Makefile中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆