All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: John Millikin <jmillikin@gmail.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH] lib/raid6: Let $(UNROLL) rules work with BSD userland.
Date: Wed, 16 Dec 2020 14:45:50 +0900	[thread overview]
Message-ID: <CAK7LNAQRa18QWQep=Tj9Due_TvAotD4_v0GX83yP0SKX=jUQSQ@mail.gmail.com> (raw)
In-Reply-To: <CAL1ky9r9FutN2baRhV_WO-stV1FHKq-par4uv-VfCdofcGhSVg@mail.gmail.com>

On Mon, Dec 14, 2020 at 5:21 PM John Millikin <jmillikin@gmail.com> wrote:
>
> BSD awk is fussy about the order of '-v' and '-f' flags, and it requires
> a space after the flag name. GNU awk is fine with both forms, so the
> definition of 'cmd_unroll' can be trivially tweaked to let the lib/raid6
> Makefile work with either awk.

Does it depend on the awk version?

I tried this in FreeBSD 12.

masahiro@:~ $ cat test.awk
BEGIN {  print N }
masahiro@:~ $ awk --version
awk version 20121220 (FreeBSD)
masahiro@:~ $ awk -ftest.awk -vN=1
1

It worked for me.





> Signed-off-by: John Millikin <john@john-millikin.com>
> ---
>  lib/raid6/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
> index b4c0df6d706d..c770570bfe4f 100644
> --- a/lib/raid6/Makefile
> +++ b/lib/raid6/Makefile
> @@ -48,7 +48,7 @@ endif
>  endif
>
>  quiet_cmd_unroll = UNROLL  $@
> -      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$* < $< > $@
> +      cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
>
>  targets += int1.c int2.c int4.c int8.c int16.c int32.c
>  $(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
> --
> 2.24.3 (Apple Git-128)



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2020-12-16  5:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14  8:21 [PATCH] lib/raid6: Let $(UNROLL) rules work with BSD userland John Millikin
2020-12-16  5:45 ` Masahiro Yamada [this message]
2020-12-23  4:24   ` John Millikin
2020-12-23  6:08     ` Masahiro Yamada
2020-12-23  6:23       ` [PATCH v2] lib/raid6: Let $(UNROLL) rules work with macOS userland John Millikin
2020-12-23  8:11         ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNAQRa18QWQep=Tj9Due_TvAotD4_v0GX83yP0SKX=jUQSQ@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=jmillikin@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.