[PATCH] kbuild: add test-{ge,gt,le,lt} macros

Nicolas Schier nicolas at fjasle.eu
Mon Dec 12 20:02:17 PST 2022


On Sun 11 Dec 2022 11:46:47 GMT, Masahiro Yamada wrote:
> GNU Make 4.4 introduced $(intcmp ...), which is useful to compare two
> integers without forking a new process.
> 
> Add test-{ge,gt,le,lt} macros, which work more efficiently with GNU
> Make >= 4.4. For older Make versions, they fall back to the 'test'
> shell command.
> 
> The first two parameters to $(intcmp ...) must not be empty. To avoid
> the syntax error, I appended '0' to them. Fortunately, '00' is treated
> as '0'. This is needed because CONFIG options may expand to an empty
> string when the kernel configuration is not included.
> 
> Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
> Acked-by: Palmer Dabbelt <palmer at rivosinc.com> # RISC-V
> ---
> 
> Changes in v3:
>   - Use $(intcmp ...) instead of playing with $(sort ...)

Reviewed-by: Nicolas Schier <nicolas at fjasle.eu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20221213/fa655de1/attachment.sig>


More information about the linux-riscv mailing list