From: TJ <linux@tjworld.net>
To: kvm <kvm@vger.kernel.org>
Subject: [PATCH] Fix userspace kernel/Makefile header-sync target build failures
Date: Thu, 04 Sep 2008 01:20:44 +0100 [thread overview]
Message-ID: <1220487645.12107.13.camel@hephaestion> (raw)
This patch fixes problems using the kernel/Makefile header-sync target.
1. If unifdef modifies a header file it returns 1, which caused make to
exit, thinking it was an error.
2. Allow rsync to de-reference symbolic links when syncing the include
headers.
This supports both distro-specific header aliases (e.g. Ubuntu) and
developer working-directory structures.
It allows, for example:
./configure --prefix=/usr --with-patched-kernel
make LINUX=../../kvm
to build in userspace repository using headers from sibling directory
containing the kvm repository:
dev/kvm/.git
dev/userspace/.git
Signed-off-by: TJ <linux@tjworld.net>
---
kernel/Makefile | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/Makefile b/kernel/Makefile
index 3f5f6da..b10259e 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -23,7 +23,7 @@ _hack = mv $1 $1.orig && \
| sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
unifdef = mv $1 $1.orig && \
- unifdef -DCONFIG_$(ARCH_CONFIG) $1.orig > $1; \
+ unifdef -DCONFIG_$(ARCH_CONFIG) $1.orig > $1 && true; \
[ $$? -le 1 ] && rm $1.orig
hack = $(call _hack,$T/$(strip $1))
@@ -52,15 +52,15 @@ T = $(subst -sync,,$@)-tmp
header-sync:
rm -rf $T
- rsync -R \
+ rsync -LR \
"$(LINUX)"/./include/linux/kvm*.h \
"$(LINUX)"/./include/asm-*/kvm*.h \
$T/
- -rsync -R \
+ -rsync -LR \
"$(LINUX)"/arch/$(ARCH_DIR)/include/asm/./kvm*.h \
$T/include/asm-$(ARCH_DIR)/
- set -e && for i in $(find $T -name '*.h'); do \
+ set -e && for i in $$(find $T -name '*.h'); do \
$(call unifdef,$$i); done
$(call hack, include/linux/kvm.h)
set -e && for i in $$(find $T -type f -printf '%P '); \
@@ -69,12 +69,12 @@ header-sync:
source-sync:
rm -rf $T
- rsync --exclude='*.mod.c' -R \
+ rsync --exclude='*.mod.c' -LR \
"$(LINUX)"/arch/$(ARCH_DIR)/kvm/./*.[cSh] \
"$(LINUX)"/virt/kvm/./*.[cSh] \
$T/
- set -e && for i in $(find $T -name '*.c'); do \
+ set -e && for i in $$(find $T -name '*.c'); do \
$(call unifdef,$$i); done
for i in $(hack-files); \
--
1.5.4.3
reply other threads:[~2008-09-04 0:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1220487645.12107.13.camel@hephaestion \
--to=linux@tjworld.net \
--cc=kvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox