如何制作曲目时间戳 [英] How does make track timestamps
问题描述
如何使文件保留时间戳记?我正在尝试放置我的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屋!