Re: Specifying CFLAGS for a directory on the command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 21, 2023 at 10:54:10AM +0200, Peter Oberparleiter wrote:
> Leaving the method of how this input data is processed inside kbuild
> aside for a moment, I'm wondering if specifying the list of directories
> via a CONFIG symbol instead of make parameters would work equally well.
> 
> Initially I thought this would be too complex to process using Makefile
> functions alone, but with the logic shown above this could be relatively
> simple to achieve. Also having given this some more thought, a CONFIG
> symbol indeed seems like a better fit considering aspects such as
> reproducibility of builds and config symbol documentation.
> 
> The CONFIG symbols could look something like:
> 
> - CONFIG_GCOV_PROFILE_INCLUDE: list of directories to include in
>   profiling
> - CONFIG_GCOV_PROFILE_EXCLUDE: list of directories to exclude from
>   profiling
> 
> where the precedence would be: exclude list > include list >
> GCOV_PROFILE_* specified in Makefiles > CONFIG_GCOV_PROFILE_ALL
> 
> Sub-directory handling could work similar to how you described it for
> the make parameter, i.e. an include/exclude statement for a parent
> directory would also apply to sub-directories.
> 
> What this approach work for your use case? Note that I'm not asking you
> to implement this - I just want to get a better picture of how a generic
> solution could look like.

Yeah, that would work fine. I'm assuming the config option list would
just be a comma separated string?

btw, here's the results - fully automated code coverage analysis
integrated into the CI:
https://evilpiepirate.org/~testdashboard/ci?branch=bcachefs&commit=eac40840098bfbb5fa1711f6bbce71b27bbccb89
https://evilpiepirate.org/~testdashboard/c/eac40840098bfbb5fa1711f6bbce71b27bbccb89/lcov/

And the result of the makefile work is that adding a gcov variant of an
existing test is as easy as:
https://evilpiepirate.org/git/ktest.git/tree/tests/bcachefs/gcov-xfstests.ktest



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux