makefile dependencies

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

makefile dependencies

gcc - Dev mailing list
Hi all,
I'm wondering if there is any guidance regarding the list of dependencies to include for object files. For example, I see this list of dependencies for aarch64-builtins.o in aarch64/t-aarch64:

 $(srcdir)/config/aarch64/aarch64-builtins.c $(CONFIG_H) \
  $(SYSTEM_H) coretypes.h $(TM_H) \
  $(RTL_H) $(TREE_H) expr.h $(TM_P_H) $(RECOG_H) langhooks.h \
  $(DIAGNOSTIC_CORE_H) $(OPTABS_H) \
  $(srcdir)/config/aarch64/aarch64-simd-builtins.def \
  $(srcdir)/config/aarch64/aarch64-simd-builtin-types.def \
  aarch64-builtin-iterators.h

But I can see that aarch64-builtins.c also includes headers not listed here. (function.h, basic-block.h, for example) Are we supposed to manually keep track of the transitive header dependencies and keep the makefiles up to date, or is there some sort of automatic dependency management that is happening on our behalf? Something along the lines of some of the answers provided here: https://stackoverflow.com/questions/2394609/makefile-header-dependencies

Thanks,
Andrew

Reply | Threaded
Open this post in threaded view
|

Re: makefile dependencies

Joseph Myers
On Tue, 8 Oct 2019, Andrew Dean via gcc wrote:

> But I can see that aarch64-builtins.c also includes headers not listed
> here. (function.h, basic-block.h, for example) Are we supposed to
> manually keep track of the transitive header dependencies and keep the
> makefiles up to date, or is there some sort of automatic dependency
> management that is happening on our behalf? Something along the lines of
> some of the answers provided here:
> https://stackoverflow.com/questions/2394609/makefile-header-dependencies

The automatic dependency patch series
<https://gcc.gnu.org/ml/gcc-patches/2013-09/msg01662.html> did not
generally address target-specific files (though it updated t-i386 as an
example); see <https://gcc.gnu.org/ml/gcc-patches/2013-07/msg01218.html>
for more discussion of what it did not include.  It is quite possible that
some places are specifying dependencies manually unnecessarily.

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: makefile dependencies

gcc - Dev mailing list
Thanks, Joseph. This is exactly what I was looking for.
-Andrew

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Joseph Myers
Sent: Tuesday, October 8, 2019 3:57 PM
To: Andrew Dean <[hidden email]>
Cc: [hidden email]
Subject: Re: makefile dependencies

On Tue, 8 Oct 2019, Andrew Dean via gcc wrote:

> But I can see that aarch64-builtins.c also includes headers not listed
> here. (function.h, basic-block.h, for example) Are we supposed to
> manually keep track of the transitive header dependencies and keep the
> makefiles up to date, or is there some sort of automatic dependency
> management that is happening on our behalf? Something along the lines
> of some of the answers provided here:
> https://stackoverflow.com/questions/2394609/makefile-header-dependencies

The automatic dependency patch series
<https://gcc.gnu.org/ml/gcc-patches/2013-09/msg01662.html> did not generally address target-specific files (though it updated t-i386 as an example); see <https://gcc.gnu.org/ml/gcc-patches/2013-07/msg01218.html>
for more discussion of what it did not include.  It is quite possible that some places are specifying dependencies manually unnecessarily.

--
Joseph S. Myers
[hidden email]