All of lore.kernel.org
 help / color / mirror / Atom feed
* Makefile: uses rsync(1), could this be optional?
@ 2022-01-20 19:21 Steffen Nurpmeso
  2022-01-21  7:12 ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Steffen Nurpmeso @ 2022-01-20 19:21 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Steffen Nurpmeso

Hello.

I sent this to linux-kernel@vger.kernel.org on the 15th, which
seems to be legacy.  Just in case someone is wondering about the
resend.

As a not-yet-tested low-quality Makefile suggestion, with modern
GNU tools and find(1)'s -printf, wouldn't the following code work
out gracefully in practice?  (Not subscribed.)

Thanks for Linux!

--- Makefile.orig	2022-01-15 19:33:59.337393371 +0100
+++ Makefile	2022-01-15 19:34:07.447393217 +0100
@@ -1260,8 +1288,17 @@ export INSTALL_HDR_PATH = $(objtree)/usr
 quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include
       cmd_headers_install = \
 	mkdir -p $(INSTALL_HDR_PATH); \
-	rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
-	usr/include $(INSTALL_HDR_PATH)
+	if command -v rsync; then \
+		rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
+		usr/include $(INSTALL_HDR_PATH);\
+	else \
+		cd usr;\
+		find include/ -type f -name '*.h' -printf '%f %h\n' |\
+		while read f d; do \
+			mkdir -p $(INSTALL_HDR_PATH)/$$d;\
+			cp -P $$d/$$f $(INSTALL_HDR_PATH)/$$d/$$f;\
+		done;\
+	fi
 
 PHONY += headers_install
 headers_install: headers

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Makefile: uses rsync(1), could this be optional?
  2022-01-20 19:21 Makefile: uses rsync(1), could this be optional? Steffen Nurpmeso
@ 2022-01-21  7:12 ` Masahiro Yamada
  2022-01-21 16:36   ` Steffen Nurpmeso
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2022-01-21  7:12 UTC (permalink / raw)
  To: Steffen Nurpmeso; +Cc: Linux Kbuild mailing list

On Fri, Jan 21, 2022 at 4:31 AM Steffen Nurpmeso <steffen@sdaoden.eu> wrote:
>
> Hello.
>
> I sent this to linux-kernel@vger.kernel.org on the 15th, which
> seems to be legacy.  Just in case someone is wondering about the
> resend.

I did not see your previous post.
What is bad about using rsync?

>
> As a not-yet-tested low-quality Makefile suggestion, with modern
> GNU tools and find(1)'s -printf, wouldn't the following code work
> out gracefully in practice?  (Not subscribed.)
>
> Thanks for Linux!
>
> --- Makefile.orig       2022-01-15 19:33:59.337393371 +0100
> +++ Makefile    2022-01-15 19:34:07.447393217 +0100
> @@ -1260,8 +1288,17 @@ export INSTALL_HDR_PATH = $(objtree)/usr
>  quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include
>        cmd_headers_install = \
>         mkdir -p $(INSTALL_HDR_PATH); \
> -       rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
> -       usr/include $(INSTALL_HDR_PATH)
> +       if command -v rsync; then \
> +               rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
> +               usr/include $(INSTALL_HDR_PATH);\
> +       else \
> +               cd usr;\
> +               find include/ -type f -name '*.h' -printf '%f %h\n' |\
> +               while read f d; do \
> +                       mkdir -p $(INSTALL_HDR_PATH)/$$d;\
> +                       cp -P $$d/$$f $(INSTALL_HDR_PATH)/$$d/$$f;\
> +               done;\
> +       fi
>
>  PHONY += headers_install
>  headers_install: headers
>
> --steffen
> |
> |Der Kragenbaer,                The moon bear,
> |der holt sich munter           he cheerfully and one by one
> |einen nach dem anderen runter  wa.ks himself off
> |(By Robert Gernhardt)



--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Makefile: uses rsync(1), could this be optional?
  2022-01-21  7:12 ` Masahiro Yamada
@ 2022-01-21 16:36   ` Steffen Nurpmeso
  2022-01-23  0:50     ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Steffen Nurpmeso @ 2022-01-21 16:36 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list

Guten Tag.

Masahiro Yamada wrote in
 <CAK7LNAQOm8NYiTDQnd0P-UsGa7GurffQiWQgGh0Cze4wLmDmgA@mail.gmail.com>:
 |On Fri, Jan 21, 2022 at 4:31 AM Steffen Nurpmeso <steffen@sdaoden.eu> \
 |wrote:
 |> I sent this to linux-kernel@vger.kernel.org on the 15th, which
 |> seems to be legacy.  Just in case someone is wondering about the
 |> resend.
 |
 |I did not see your previous post.
 |What is bad about using rsync?

Oh really nothing, but this Linux distribution (CRUX) recreates
Linux headers before the GNU LibC is build, and this is the only
dependency of rsync around.  And, unless i am mistaken, the other
code path is more expensive but otherwise functionally equivalent?

 |> As a not-yet-tested low-quality Makefile suggestion, with modern
 |> GNU tools and find(1)'s -printf, wouldn't the following code work
 |> out gracefully in practice?  (Not subscribed.)
 |>
 |> Thanks for Linux!
 |>
 |> --- Makefile.orig       2022-01-15 19:33:59.337393371 +0100
 |> +++ Makefile    2022-01-15 19:34:07.447393217 +0100
 |> @@ -1260,8 +1288,17 @@ export INSTALL_HDR_PATH = $(objtree)/usr
 |>  quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include
 |>        cmd_headers_install = \
 |>         mkdir -p $(INSTALL_HDR_PATH); \
 |> -       rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
 |> -       usr/include $(INSTALL_HDR_PATH)
 |> +       if command -v rsync; then \
 |> +               rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
 |> \
 |> +               usr/include $(INSTALL_HDR_PATH);\
 |> +       else \
 |> +               cd usr;\
 |> +               find include/ -type f -name '*.h' -printf '%f %h\n' |\
 |> +               while read f d; do \
 |> +                       mkdir -p $(INSTALL_HDR_PATH)/$$d;\
 |> +                       cp -P $$d/$$f $(INSTALL_HDR_PATH)/$$d/$$f;\
 |> +               done;\
 |> +       fi
 |>
 |>  PHONY += headers_install
 |>  headers_install: headers

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Makefile: uses rsync(1), could this be optional?
  2022-01-21 16:36   ` Steffen Nurpmeso
@ 2022-01-23  0:50     ` Randy Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2022-01-23  0:50 UTC (permalink / raw)
  To: Steffen Nurpmeso, Masahiro Yamada; +Cc: Linux Kbuild mailing list



On 1/21/22 08:36, Steffen Nurpmeso wrote:
> Guten Tag.
> 
> Masahiro Yamada wrote in
>  <CAK7LNAQOm8NYiTDQnd0P-UsGa7GurffQiWQgGh0Cze4wLmDmgA@mail.gmail.com>:
>  |On Fri, Jan 21, 2022 at 4:31 AM Steffen Nurpmeso <steffen@sdaoden.eu> \
>  |wrote:
>  |> I sent this to linux-kernel@vger.kernel.org on the 15th, which
>  |> seems to be legacy.  Just in case someone is wondering about the
>  |> resend.
>  |
>  |I did not see your previous post.
>  |What is bad about using rsync?
> 
> Oh really nothing, but this Linux distribution (CRUX) recreates
> Linux headers before the GNU LibC is build, and this is the only
> dependency of rsync around.  And, unless i am mistaken, the other
> code path is more expensive but otherwise functionally equivalent?

Do we need to add it to Documentation/Changes?

>  |> As a not-yet-tested low-quality Makefile suggestion, with modern
>  |> GNU tools and find(1)'s -printf, wouldn't the following code work
>  |> out gracefully in practice?  (Not subscribed.)


-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Makefile: uses rsync(1), could this be optional?
@ 2022-01-15 18:40 Steffen Nurpmeso
  0 siblings, 0 replies; 5+ messages in thread
From: Steffen Nurpmeso @ 2022-01-15 18:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Steffen Nurpmeso

Hello.

As a not-yet-tested low-quality Makefile suggestion, with modern
GNU tools and find(1)'s -printf, wouldn't the following code work
out gracefully in practice?  (Not subscribed.)

Thanks for Linux!

--- Makefile.orig	2022-01-15 19:33:59.337393371 +0100
+++ Makefile	2022-01-15 19:34:07.447393217 +0100
@@ -1260,8 +1288,17 @@ export INSTALL_HDR_PATH = $(objtree)/usr
 quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include
       cmd_headers_install = \
 	mkdir -p $(INSTALL_HDR_PATH); \
-	rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
-	usr/include $(INSTALL_HDR_PATH)
+	if command -v rsync; then \
+		rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
+		usr/include $(INSTALL_HDR_PATH);\
+	else \
+		cd usr;\
+		find include/ -type f -name '*.h' -printf '%f %h\n' |\
+		while read f d; do \
+			mkdir -p $(INSTALL_HDR_PATH)/$$d;\
+			cp -P $$d/$$f $(INSTALL_HDR_PATH)/$$d/$$f;\
+		done;\
+	fi
 
 PHONY += headers_install
 headers_install: headers

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-23  0:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 19:21 Makefile: uses rsync(1), could this be optional? Steffen Nurpmeso
2022-01-21  7:12 ` Masahiro Yamada
2022-01-21 16:36   ` Steffen Nurpmeso
2022-01-23  0:50     ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2022-01-15 18:40 Steffen Nurpmeso

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.