All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Kconfig: fix environment variable handling
@ 2016-01-13 10:46 Jan Beulich
  2016-01-13 15:50 ` Doug Goldstein
  2016-01-15 15:44 ` Ian Campbell
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2016-01-13 10:46 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Ian Jackson, Keir Fraser, Doug Goldstein,
	Tim Deegan

[-- Attachment #1: Type: text/plain, Size: 2878 bytes --]

With xen/Makefile including include/config/auto.conf.cmd, environment
variables checked in the latter must be available at the time of
inclusion of that file, and hence must be populated in xen/Makefile
rather than by passing to or inside xen/tools/kconfig/Makefile.kconfig.
Otherwise incremental re-builds will always be full re-builds, which is
not only annoying but actively problematic when building as non-root
and only running "install-xen" as root.

Also take the opportunity and remove stray $(Q) uses.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -20,6 +20,9 @@ MAKEFLAGS += -rR
 
 EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
 
+ARCH=$(XEN_TARGET_ARCH)
+SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
+
 # Don't break if the build process wasn't called from the top level
 # we need XEN_TARGET_ARCH to generate the proper config
 include $(XEN_ROOT)/Config.mk
@@ -101,7 +104,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig clean
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
@@ -236,14 +239,14 @@ kconfig := silentoldconfig oldconfig con
 	nconfig xconfig gconfig savedefconfig listnewconfig olddefconfig
 .PHONY: $(kconfig)
 $(kconfig):
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) $@
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) $@
 
 include/config/%.conf: include/config/auto.conf.cmd $(KCONFIG_CONFIG)
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) silentoldconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) silentoldconfig
 
 # Allow people to just run `make` as before and not force them to configure
 $(KCONFIG_CONFIG):
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) defconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) defconfig
 
 # Break the dependency chain for the first run
 include/config/auto.conf.cmd: ;
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -44,10 +44,6 @@ PHONY += FORCE
 
 FORCE:
 
-SRCARCH = $(shell echo $(ARCH) | \
-	sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
-export SRCARCH
-
 # include the original Makefile and Makefile.host from Linux
 include $(src)/Makefile
 include $(src)/Makefile.host




[-- Attachment #2: Kconfig-env-vars.patch --]
[-- Type: text/plain, Size: 2918 bytes --]

Kconfig: fix environment variable handling

With xen/Makefile including include/config/auto.conf.cmd, environment
variables checked in the latter must be available at the time of
inclusion of that file, and hence must be populated in xen/Makefile
rather than by passing to or inside xen/tools/kconfig/Makefile.kconfig.
Otherwise incremental re-builds will always be full re-builds, which is
not only annoying but actively problematic when building as non-root
and only running "install-xen" as root.

Also take the opportunity and remove stray $(Q) uses.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -20,6 +20,9 @@ MAKEFLAGS += -rR
 
 EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
 
+ARCH=$(XEN_TARGET_ARCH)
+SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
+
 # Don't break if the build process wasn't called from the top level
 # we need XEN_TARGET_ARCH to generate the proper config
 include $(XEN_ROOT)/Config.mk
@@ -101,7 +104,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig clean
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
@@ -236,14 +239,14 @@ kconfig := silentoldconfig oldconfig con
 	nconfig xconfig gconfig savedefconfig listnewconfig olddefconfig
 .PHONY: $(kconfig)
 $(kconfig):
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) $@
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) $@
 
 include/config/%.conf: include/config/auto.conf.cmd $(KCONFIG_CONFIG)
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) silentoldconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) silentoldconfig
 
 # Allow people to just run `make` as before and not force them to configure
 $(KCONFIG_CONFIG):
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) defconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) defconfig
 
 # Break the dependency chain for the first run
 include/config/auto.conf.cmd: ;
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -44,10 +44,6 @@ PHONY += FORCE
 
 FORCE:
 
-SRCARCH = $(shell echo $(ARCH) | \
-	sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
-export SRCARCH
-
 # include the original Makefile and Makefile.host from Linux
 include $(src)/Makefile
 include $(src)/Makefile.host

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-15 16:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 10:46 [PATCH] Kconfig: fix environment variable handling Jan Beulich
2016-01-13 15:50 ` Doug Goldstein
2016-01-15 15:44 ` Ian Campbell
2016-01-15 15:54   ` Jan Beulich
2016-01-15 16:01     ` Ian Campbell
2016-01-15 16:17       ` Jan Beulich

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.