Re: Specifying CFLAGS for a directory on the command line

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

 



On Thu, Jun 15, 2023 at 11:54:23AM +0200, Peter Oberparleiter wrote:
> I'll likely not be able to implement this myself, but if you or anyone
> else wants to go that route, here are my thoughts: $(src) should have
> the relative source code path that is needed, so here's what needs to be
> done:
> 
> 1. Determine how to handle non-letter/digit/underscore characters in the
>    variable name:
> 
>    a) GCOV_PROFILE_fs/bcachefs => supported by GNU make [1], though
>       discouraged due to possible side-effects
>    b) GCOV_PROFILE_fs_bcachefs => might cause overlays, e.g. a/b/c and
>       a/b_c both have the same a_b_c suffix
> 
>    Personally I'd prefer option b)

Agreed, feels more consistent

> 2. Define a new Makefile variable that contains $(src) with required
>    character replacements (scripts/Kbuild.include might be a good place)
> 
> 3. Add $(GCOV_PROFILE_$(name_of_that_new_var)) to the code quoted above
>    (scripts/Makefile.lib)

So this is where I was getting stuck, because we really want this to
apply to subdirectories (e.g. GCOV_PROFILE_fs_xfs should really also
apply to fs/xfs/libxfs).

Do we have existing code for generating a list of path prefixes for a
given path?



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

  Powered by Linux