question about make

38 views
Skip to first unread message

Thiago Adams

unread,
Jul 18, 2022, 11:02:42 AMJul 18
to
Maybe a little bit of topic.. but I think someone will know the answer.

Where make program saves state? for instance where it saves the
"timestamp" of the files compiled?

Lew Pitcher

unread,
Jul 18, 2022, 11:27:25 AMJul 18
to
On Mon, 18 Jul 2022 08:02:33 -0700, Thiago Adams wrote:

> Maybe a little bit of topic..

Definitely off topic for comp.lang.c

> but I think someone will know the answer.
>
> Where make program saves state? for instance where it saves the
> "timestamp" of the files compiled?

make doesn't "save" any state. It uses state information provided
by the operating environment. Specifically, for the "timestamp of
files compiled", it uses the OS "last modified" date/time stamp
(POSIX mtime) of each file in the dependency list to determine
which files are "newer" than the existing target files.


--
Lew Pitcher
"In Skills, We Trust"

Thiago Adams

unread,
Jul 18, 2022, 11:52:26 AMJul 18
to
thanks it is so obvious now! I guessed it was using the file timesmap
but my problem into understand this was not considering the "ouput" as part
of the state. But taking the timestamp of the ouput we have the timestamp
of the last compilation. So the state is each file. thanks.

Scott Lurndal

unread,
Jul 18, 2022, 12:02:09 PMJul 18
to
The operating system stores the timestamps as part of the file
system metadata. Creation/Modification/Access times are typically
kept.

Kenny McCormack

unread,
Jul 18, 2022, 12:32:39 PMJul 18
to
In article <UtfBK.517338$ntj.1...@fx15.iad>,
s/Creation/Change/p

--
"The party of Lincoln has become the party of John Wilkes Booth."

- Carlos Alazraqui -

Siri Cruise

unread,
Jul 18, 2022, 12:57:14 PMJul 18
to
In article <tb41ur$312il$1...@news.xmission.com>,
gaz...@shell.xmission.com (Kenny McCormack) wrote:

> >>Where make program saves state? for instance where it saves the
> >>"timestamp" of the files compiled?
> >
> >The operating system stores the timestamps as part of the file
> >system metadata. [change]/Modification/Access times are typically
> >kept.

target: dependents
touch target

Make compares existence and mod times of target and dependents.
To 'save' the state of the target, it must be created and/or
updated by the make rule.

--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
Discordia: not just a religion but also a parody. This post / \
I am an Andrea Chen sockpuppet. insults Islam. Mohammed

Kenny McCormack

unread,
Jul 18, 2022, 1:11:34 PMJul 18
to
In article <chine.bleu-2268B...@news.eternal-september.org>,
Siri Cruise <chine...@yahoo.com> wrote:
>In article <tb41ur$312il$1...@news.xmission.com>,
> gaz...@shell.xmission.com (Kenny McCormack) wrote:
>
>> >>Where make program saves state? for instance where it saves the
>> >>"timestamp" of the files compiled?
>> >
>> >The operating system stores the timestamps as part of the file
>> >system metadata. [change]/Modification/Access times are typically
>> >kept.
>
>target: dependents
> touch target
>
>Make compares existence and mod times of target and dependents.
>To 'save' the state of the target, it must be created and/or
>updated by the make rule.

Whoooosh!

--
There are a lot of Wisconsin farmers right now who, despite having
themselves voted for Trump, are now wishing that their state's electors
had had the good sense to vote for the other candidate - thereby saving
them from their current predicament.

Scott Lurndal

unread,
Jul 18, 2022, 1:14:11 PMJul 18
to
gaz...@shell.xmission.com (Kenny McCormack) writes:
>In article <UtfBK.517338$ntj.1...@fx15.iad>,
>Scott Lurndal <sl...@pacbell.net> wrote:
>>Thiago Adams <thiago...@gmail.com> writes:
>>>Maybe a little bit of topic.. but I think someone will know the answer.
>>>
>>>Where make program saves state? for instance where it saves the
>>>"timestamp" of the files compiled?
>>
>>The operating system stores the timestamps as part of the file
>>system metadata. Creation/Modification/Access times are typically
>>kept.
>
>s/Creation/Change/p

I said typically. There are filesystems that keep creation time.

Kenny McCormack

unread,
Jul 18, 2022, 4:25:27 PMJul 18
to
In article <qxgBK.535286$5fVf....@fx09.iad>,
Scott Lurndal <sl...@pacbell.net> wrote:
>gaz...@shell.xmission.com (Kenny McCormack) writes:
>>In article <UtfBK.517338$ntj.1...@fx15.iad>,
>>Scott Lurndal <sl...@pacbell.net> wrote:
>>>Thiago Adams <thiago...@gmail.com> writes:
>>>>Maybe a little bit of topic.. but I think someone will know the answer.
>>>>
>>>>Where make program saves state? for instance where it saves the
>>>>"timestamp" of the files compiled?
>>>
>>>The operating system stores the timestamps as part of the file
>>>system metadata. Creation/Modification/Access times are typically
>>>kept.
>>
>>s/Creation/Change/p
>
>I said typically. There are filesystems that keep creation time.
>

https://www.youtube.com/watch?v=HhSjwU8gEsI


--
Genesis 2:7 And the LORD God formed man of the dust of the ground, and
breathed into his nostrils the breath of life; and man became a living soul.
Reply all
Reply to author
Forward
0 new messages