public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix userspace kernel/Makefile header-sync target build failures
@ 2008-09-04  0:20 TJ
  0 siblings, 0 replies; only message in thread
From: TJ @ 2008-09-04  0:20 UTC (permalink / raw)
  To: kvm

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-04  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04  0:20 [PATCH] Fix userspace kernel/Makefile header-sync target build failures TJ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox