All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: linux-kernel@vger.kernel.org
Cc: Steffen Nurpmeso <steffen@sdaoden.eu>
Subject: Makefile: uses rsync(1), could this be optional?
Date: Sat, 15 Jan 2022 19:40:26 +0100	[thread overview]
Message-ID: <20220115184026.U6ZIV%steffen@sdaoden.eu> (raw)

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)

             reply	other threads:[~2022-01-15 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15 18:40 Steffen Nurpmeso [this message]
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

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=20220115184026.U6ZIV%steffen@sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=linux-kernel@vger.kernel.org \
    /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.