[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Clarification of 2 Trivial Issues?
From: |
Jon Forrest |
Subject: |
Clarification of 2 Trivial Issues? |
Date: |
Wed, 16 Feb 2022 20:35:34 -0800 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 |
This may seem silly but I'm trying to make sure I understand what
I'm seeing in gmake's source code.
1) In "filedef.h I see the composition of the "file" struct, with the
comment
/* Structure that represents the info on one file
that the makefile says how to make.
All of these are chained together through 'next'. */
But there is no field named "next" in a "file" struct.
Instead, there's a field named "deps", which is a pointer to the
"dep" structure. The "dep" structure does contain a "next" field.
So, is it accurate to say "All of these are chained together
through 'next'? This is especially relevant in the situation
where there are no double-colon entries, which would mean that
the "file" struct's "prev" and "next" fields won't be used,
and therefore, there won't be any chaining.
2) In "dep.h" I see the comment
/* Structure representing one dependency of a file.
Each struct file's 'deps' points to a chain of these,
through 'next'. [...] */
Let's say I have a makefile with the following target and prerequisites:
main.o : main.c defs.h
Am I right in assuming that the "file" struct for "main.o" will
have nothing in its "prev" and "next" fields, but its "dep"
field will have a chain of 2 "dep" structures, one for "main.c"
and the other for "defs.h" because "main.c" and "def.h" are
dependencies of "main.o"?
In other words, in a makefile without double-colons, there's no chaining
at all in the "file" structure.
Sorry for such trivial questions but the "All of these are chained
together through 'next'." comment in filedef.h seems misleading.
Cordially,
Jon Forrest