Liste des Groupes | Revenir à cl c |
David Brown <david.brown@hesbynett.no> writes:This is part of the makefile macro I use when generating dependency files:On 04/12/2024 23:48, Scott Lurndal wrote:We use the standard makedepend support built into GCC. It createsDavid Brown <david.brown@hesbynett.no> writes:>On 04/12/2024 17:55, Scott Lurndal wrote:>>13 minutes by the wall clock, a bit over an hour>
of CPU time.
>
Is that a "typical" build - or an atypical full clean build?
>
That was a build that touched a key header file, so maybe
85% full. A full build adds a minute or two wall time.
>
A single source file build (for most source files) takes
about 28 seconds real, a large portion of that in make as it
figures out what to rebuild in a project with thousands
of source files and associated dependencies.
That sounds like your dependency handling in make is not ideal. Store
your dependencies in individual files per source file, where both the
object file and the dependency file itself are dependent on the headers
used by the C file. (The makefile should also have both the object file
and the dependency file dependent on the C source file.)
a .d file for each source file that contains the dependencies
for that source file.
Scale matters, (with two thousand+ source and header files, that's a lotIf the issue is stat'ing the times for those files in order to check the dependencies, then I understand the bottleneck. But I would not expect people to be sharing a source tree on NFS like that - it is certainly not the usual way of collaborating on projects.
of 'access', 'read' and 'stat' system calls just to build the dependency
graph. On NFS filesystems, which we use in most environments, the make
takes even more time.
Yes, when that happens there will be a lot of re-compilation. But usually that doesn't happen very often.Thus your build only generates new dependency files when either the CIn the case above, over 1000 source files were dependent upon that
source file changes, or any of the headers included (recursively) by
that C file change. Change a C file, and it's dependencies will be
re-calculated - but not the dependencies for anything else. Change a
header, and you only need to re-calculate the dependencies for the
source files that actually use it.
>
key project-wide header file which had been modified.
Les messages affichés proviennent d'usenet.