如何制作曲目时间戳 [英] How does make track timestamps

查看:74
本文介绍了如何制作曲目时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使文件保留时间戳记?我正在尝试放置我的git repo.我要为文件添加预编译的二进制文件,这些文件大部分不会改变.现在,当我从git签出repo时,我不想编译这些c文件.我想使用这些预构建的二进制文件.因此,要设置此方案,我想知道makefile如何跟踪时间戳.谁能帮我吗?

How does make keep timestamps for files? I am trying to put in place my git repo. I am adding precompiled binaries for files which are mostly not gonna change. Now, when I checkout repo from git then I dont want to compile these c files. I want to use these prebuilt binaries. So, to set up this scheme, I want to know how makefile tracks timestamps. Can anyone help me?

谢谢

推荐答案

make查看上次修改时间.从 GNU make手册:

make looks at the last-modified times. From the GNU make manual:

make程序使用Makefile数据库和文件的最后修改时间来确定哪些文件需要更新.

The make program uses the makefile data base and the last-modification times of the files to decide which of the files need to be updated.

以及 IEEE Std 1003.1-2008 make手册:

make 实用程序将检查时间关系,并更新其修改时间早于其衍生文件的修改时间(称为先决条件)的那些衍生文件(称为目标).

The make utility examines time relationships and shall update those derived files (called targets) that have modified times earlier than the modified times of the files (called prerequisites) from which they are derived.

您可以使用 touch :

You can use touch:

触摸-更改文件访问和修改时间

touch - change file access and modification times

根据需要调整时间戳记.

to adjust the timestamps if necessary.

这篇关于如何制作曲目时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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