[coreboot-gerrit] Change in coreboot[master]: Makefile: Keep list of exported variables

Nico Huber (Code Review) gerrit at coreboot.org
Thu Aug 24 00:19:44 CEST 2017


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/21162


Change subject: Makefile: Keep list of exported variables
......................................................................

Makefile: Keep list of exported variables

This can be useful to unexport them later.

Change-Id: I2ce9eff32d817ec190441550116376843abd1c11
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M Makefile
M Makefile.inc
2 files changed, 36 insertions(+), 24 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/21162/1

diff --git a/Makefile b/Makefile
index 343ec65..4d76340 100644
--- a/Makefile
+++ b/Makefile
@@ -30,24 +30,31 @@
 ## SUCH DAMAGE.
 ##
 
-export top := $(CURDIR)
-export src := src
-export srck := $(top)/util/kconfig
+top := $(CURDIR)
+src := src
+srck := $(top)/util/kconfig
 obj ?= build
 override obj := $(subst $(top)/,,$(abspath $(obj)))
-export obj
-export objutil ?= $(obj)/util
-export objk := $(objutil)/kconfig
+objutil ?= $(obj)/util
+objk := $(objutil)/kconfig
 absobj := $(abspath $(obj))
 
+COREBOOT_EXPORTS := COREBOOT_EXPORTS
+COREBOOT_EXPORTS += top src srck obj objutil objk
 
-export KCONFIG_AUTOHEADER := $(obj)/config.h
-export KCONFIG_AUTOCONFIG := $(obj)/auto.conf
-export KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd
-export KCONFIG_SPLITCONFIG := $(obj)/config
-export KCONFIG_TRISTATE := $(obj)/tristate.conf
-export KCONFIG_NEGATIVES := 1
-export KCONFIG_STRICT := 1
+DOTCONFIG ?= $(top)/.config
+KCONFIG_CONFIG = $(DOTCONFIG)
+KCONFIG_AUTOHEADER := $(obj)/config.h
+KCONFIG_AUTOCONFIG := $(obj)/auto.conf
+KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd
+KCONFIG_SPLITCONFIG := $(obj)/config
+KCONFIG_TRISTATE := $(obj)/tristate.conf
+KCONFIG_NEGATIVES := 1
+KCONFIG_STRICT := 1
+
+COREBOOT_EXPORTS += KCONFIG_CONFIG KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG
+COREBOOT_EXPORTS += KCONFIG_DEPENDENCIES KCONFIG_SPLITCONFIG KCONFIG_TRISTATE
+COREBOOT_EXPORTS += KCONFIG_NEGATIVES KCONFIG_STRICT
 
 # directory containing the toplevel Makefile.inc
 TOPLEVEL := .
@@ -55,9 +62,6 @@
 CONFIG_SHELL := sh
 KBUILD_DEFCONFIG := configs/defconfig
 UNAME_RELEASE := $(shell uname -r)
-DOTCONFIG ?= $(top)/.config
-KCONFIG_CONFIG = $(DOTCONFIG)
-export KCONFIG_CONFIG
 HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG))
 MAKEFLAGS += -rR --no-print-directory
 
@@ -82,6 +86,8 @@
 DOXYGEN := doxygen
 DOXYGEN_OUTPUT_DIR := doxygen
 
+export $(COREBOOT_EXPORTS)
+
 all: real-all
 
 help_coreboot help::
diff --git a/Makefile.inc b/Makefile.inc
index 679e0ac..54ed00d 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -29,33 +29,35 @@
 # misleadingly named, this is the coreboot version
 ifeq ($(KERNELVERSION),)
 ifeq ($(BUILD_TIMELESS),1)
-export KERNELVERSION := TIMELESS
+KERNELVERSION := TIMELESS
 else
-export KERNELVERSION := $(strip $(if $(GIT),\
+KERNELVERSION := $(strip $(if $(GIT),\
 	$(shell git describe --dirty --always || git describe),\
 	$(if $(wildcard $(top)/.coreboot-version),\
 		$(shell cat $(top)/.coreboot-version),\
 		coreboot-unknown$(KERNELREVISION))))
 endif
 endif
+COREBOOT_EXPORTS += KERNELVERSION
 
 #######################################################################
 # Basic component discovery
 MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR))
 VARIANT_DIR:=$(call strip_quotes,$(CONFIG_VARIANT_DIR))
-export MAINBOARDDIR
-export VARIANT_DIR
+COREBOOT_EXPORTS += MAINBOARDDIR VARIANT_DIR
 
 ## Final build results, which CBFSTOOL uses to create the final
 ## rom image file, are placed under $(objcbfs).
 ## These typically have suffixes .debug .elf .bin and .map
-export objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX)
+objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX)
+COREBOOT_EXPORTS += objcbfs
 
 ## Based on the active configuration, Makefile conditionally collects
 ## the required assembly includes and saves them in a file.
 ## Such files that do not have a clear one-to-one relation to a source
 ## file under src/ are placed and built under $(objgenerated)
-export objgenerated := $(obj)/generated
+objgenerated := $(obj)/generated
+COREBOOT_EXPORTS += objgenerated
 
 #######################################################################
 # root rule to resolve if in build mode (ie. configuration exists)
@@ -195,7 +197,8 @@
 # unless explicitly requested and enabled through --checkout
 forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs))
 endif
-export UPDATED_SUBMODULES:=1
+UPDATED_SUBMODULES:=1
+COREBOOT_EXPORTS += UPDATED_SUBMODULES
 endif
 
 postcar-c-deps:=$$(OPTION_TABLE_H)
@@ -347,7 +350,8 @@
 endif
 
 ifneq ($(CONFIG_LOCALVERSION),"")
-export COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION))
+COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION))
+COREBOOT_EXPORTS += COREBOOT_EXTRA_VERSION
 endif
 
 CPPFLAGS_common := -Isrc -Isrc/include -Isrc/commonlib/include -I$(obj)
@@ -435,6 +439,8 @@
 		   $(objutil)/ifdfake $(objutil)/options $(objutil)/amdfwtool \
 		   $(objutil)/cbootimage $(objutil)/bimgtool
 
+export $(COREBOOT_EXPORTS)
+
 #######################################################################
 # generate build support files
 $(obj)/build.h: .xcompile

-- 
To view, visit https://review.coreboot.org/21162
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ce9eff32d817ec190441550116376843abd1c11
Gerrit-Change-Number: 21162
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170823/e576813e/attachment-0001.html>


More information about the coreboot-gerrit mailing list