diff mbox series

[v2] Makefile: Fix grep warning

Message ID 20230810121527.62217-2-ajones@ventanamicro.com
State Accepted
Headers show
Series [v2] Makefile: Fix grep warning | expand

Commit Message

Andrew Jones Aug. 10, 2023, 12:15 p.m. UTC
grep (at least my version, grep-3.8-3.fc38.x86_64) warns with
"grep: warning: stray \ before -". Fix the warning by making
the command line input to grep less ambiguous.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
v2: Use -e instead of -- [Andreas]

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anup Patel Aug. 18, 2023, 9:38 a.m. UTC | #1
On Thu, Aug 10, 2023 at 5:45 PM Andrew Jones <ajones@ventanamicro.com> wrote:
>
> grep (at least my version, grep-3.8-3.fc38.x86_64) warns with
> "grep: warning: stray \ before -". Fix the warning by making
> the command line input to grep less ambiguous.
>
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>

Looks good to me.

Reviewed-by: Anup Patel  <anup@brainfault.org>

Regards,
Anup

> ---
> v2: Use -e instead of -- [Andreas]
>
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 730dbd910e51..ca70949df480 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -168,7 +168,7 @@ endif
>  OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n)
>
>  # Check whether the compiler supports -m(no-)save-restore
> -CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep "\-save\-restore" >/dev/null && echo n || echo y)
> +CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep -e "-save-restore" >/dev/null && echo n || echo y)
>
>  # Check whether the assembler and the compiler support the Zicsr and Zifencei extensions
>  CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null 2>&1 | grep "zicsr\|zifencei" > /dev/null && echo n || echo y)
> --
> 2.41.0
>
Anup Patel Aug. 22, 2023, 8:13 a.m. UTC | #2
On Thu, Aug 10, 2023 at 5:45 PM Andrew Jones <ajones@ventanamicro.com> wrote:
>
> grep (at least my version, grep-3.8-3.fc38.x86_64) warns with
> "grep: warning: stray \ before -". Fix the warning by making
> the command line input to grep less ambiguous.
>
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>

Applied this patch to the riscv/opensbi repo

Thanks,
Anup


> ---
> v2: Use -e instead of -- [Andreas]
>
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 730dbd910e51..ca70949df480 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -168,7 +168,7 @@ endif
>  OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n)
>
>  # Check whether the compiler supports -m(no-)save-restore
> -CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep "\-save\-restore" >/dev/null && echo n || echo y)
> +CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep -e "-save-restore" >/dev/null && echo n || echo y)
>
>  # Check whether the assembler and the compiler support the Zicsr and Zifencei extensions
>  CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null 2>&1 | grep "zicsr\|zifencei" > /dev/null && echo n || echo y)
> --
> 2.41.0
>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 730dbd910e51..ca70949df480 100644
--- a/Makefile
+++ b/Makefile
@@ -168,7 +168,7 @@  endif
 OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n)
 
 # Check whether the compiler supports -m(no-)save-restore
-CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep "\-save\-restore" >/dev/null && echo n || echo y)
+CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep -e "-save-restore" >/dev/null && echo n || echo y)
 
 # Check whether the assembler and the compiler support the Zicsr and Zifencei extensions
 CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null 2>&1 | grep "zicsr\|zifencei" > /dev/null && echo n || echo y)