]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
Fix Makefile.xen generation when building external modules
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Jun 2009 10:06:10 +0000 (11:06 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Jun 2009 10:06:10 +0000 (11:06 +0100)
Otherwise, the file will be (attempted to be) put in the (possibly
read-only) source tree.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
scripts/Makefile.build

index 218199b54d80164ccc2386fc82b57dc0077fe313..6473fd2ab89925cd6a856241f3a2e91819bfa552 100644 (file)
@@ -69,7 +69,8 @@ $(warning kbuild: Makefile.build is included improperly)
 endif
 
 ifeq ($(CONFIG_XEN),y)
-$(objtree)/scripts/Makefile.xen: $(srctree)/scripts/Makefile.xen.awk $(srctree)/scripts/Makefile.build
+Makefile.xen := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD),$(objtree)/scripts)/Makefile.xen
+$(Makefile.xen): $(srctree)/scripts/Makefile.xen.awk $(srctree)/scripts/Makefile.build
        @echo '  Updating $@'
        $(if $(shell echo a | $(AWK) '{ print gensub(/a/, "AA", "g"); }'),\
         ,$(error 'Your awk program does not define gensub.  Use gawk or another awk with gensub'))
@@ -79,7 +80,7 @@ xen-src-single-used-m := $(patsubst $(srctree)/%,%,$(wildcard $(addprefix $(srct
 xen-single-used-m      := $(xen-src-single-used-m:-xen.c=.o)
 single-used-m          := $(filter-out $(xen-single-used-m),$(single-used-m))
 
--include $(objtree)/scripts/Makefile.xen
+-include $(Makefile.xen)
 endif
 
 # ===========================================================================