Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Managed Build rebuilding whole folder when options of one file change

On 2022-08-19 at 17:39, Christian Walther <walther@xxxxxxxx> wrote:

>> With that change, does it not make you get a rebuild anyway the first time to change the setting of a specific file?
> 
> Yes, that is true. That seemed unavoidable. I was mainly concerned with the case of changing the options on a file that already has special options. But now that I think about it, I guess it could actually be avoided by putting the pattern rule in its own file as well, so that no rule has subdir.mk as a dependency anymore. Let me try that…

Done: https://github.com/indel-ag/cdt/commit/db08f66451b7847e0887d0ddbb636527102ff0e7#diff-d13c7787e9262d76490b1426af7b2e293a491e247430c5bd30d844a0349859d4

It works (as far as I have tested) and I have tentatively deployed it in our product, but it’s a bit more invasive in that it affects all projects (they all now get the additional subdir.rule.mk files) instead of just those that have files with file-specific options.

One case is still not solved perfectly: When there are multiple pattern rules, they are still put into the same subdir.rule.mk file, and changes to one cause unnecessary rebuilds of files built by the others. E.g. when there are both C and C++ source files in the same directory like in build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/dir1/dd/ff/subdir.rule.mk. I considered this too complicated to solve and too irrelevant for my use case.

I also considered an alternative approach of still putting the pattern rules in subdir.mk, but putting the include statements for the rule files not in subdir.mk but in the main makefile. That would affect fewer existing projects, but 1. it would not work properly when source files are added or removed (since that modifies subdir.mk, and when subdir.mk is still a prerequisite of some rules, causes unnecessary rebuilds), and 2. it turned out to be more complicated to implement.

 -Christian


-- 
Indel AG
Christian Walther - Software
Tuefiwis 26
CH-8332 Russikon
Switzerland

Tel.: +41 44 956 20 00
www.indel.ch
------------------------------------------------------------------------------------------
New product GIN-MAX4x4: The compact 4-axis motion board now also available as PRO version!
https://www.indel.ch/en/products/drives/compact-motion-drives



Back to the top