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?
Thanks
make
looks at the last-modified times. From the GNU make
manual:
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.
And from IEEE Std 1003.1-2008 make
manual:
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.
You can use touch
:
touch - change file access and modification times
to adjust the timestamps if necessary.
If you are using make
I do not think that you should put these binaries into the repository - simply just enable make
to check that they are up to date. You can always rebuildd them. This is especially true if you are not the only person working on the project. You will need to update some of these files in the future and hence recompile them. If you are under the illusion that they are not going to change you might get bitten when things do not work.