Skip to contentSkip to conversation

linux: fix Makefile.xen generation when building external modules

PATCH New Jan Beulich 1 participant 1 message Jun 9, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: fix Makefile.xen generation when building external modules

Otherwise, the file will be (attempted to be) put in the (possibly read-only) source tree.

scripts/Makefile.build +3 -2
@@ -77,7 +77,8 @@ $(warning kbuild: Makefile.build is incl
 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'))
@@ -87,7 +88,7 @@ xen-src-single-used-m	:= $(patsubst $(sr
 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
 
 # ===========================================================================