[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH] build: C= build parameter for specifying different `.config` file



Adds the make parameter `C=` which can be used to specify a different
path for the configuration file `.config`. The parameter is optional
and the default will select `.config` in the application directory.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 Makefile | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index b1e80303..7b653bb4 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,7 @@ ifeq ($(CONFIG_UK_BASE),)
 $(error "Invalid base directory (CONFIG_UK_BASE)")
 endif
 
-# A // APP_DIR
+# parameter A: APP_DIR ###
 # Set A variable if not already done on the command line;
 ifneq ("$(origin A)", "command line")
 A := $(CONFIG_UK_BASE)
@@ -115,7 +115,7 @@ override CONFIG_UK_APP   := $(A)
 override APP_DIR  := $(A)
 override APP_BASE := $(A)
 
-# BUILD_DIR
+# parameter O: BUILD_DIR ###
 # Use O variable if set on the command line, otherwise use $(A)/build;
 ifneq ("$(origin O)", "command line")
 BUILD_DIR := $(shell mkdir -p $(CONFIG_UK_APP)/build && cd 
$(CONFIG_UK_APP)/build >/dev/null && pwd)
@@ -126,6 +126,15 @@ $(if $(BUILD_DIR),, $(error could not create directory 
"$(O)"))
 endif
 override BUILD_DIR := $(realpath $(patsubst %/,%,$(patsubst 
%.,%,$(BUILD_DIR))))
 
+# parameter C: UK_CONFIG ###
+# Use C variable if set on the command line, otherwise use $(A)/.config;
+ifneq ("$(origin C)", "command line")
+UK_CONFIG := $(CONFIG_UK_APP)/.config
+else
+UK_CONFIG := $(realpath $(dir $(C)))/$(C)
+endif
+override CONFIG_DIR := $(realpath $(dir $(UK_CONFIG)))
+
 # EPLAT_DIR (list of external platform libraries)
 # Retrieved from P variable from the command line (paths separated by colon)
 ifeq ("$(origin P)", "command line")
@@ -167,11 +176,9 @@ ELIB_DIR := $(realpath $(patsubst %/,%,$(patsubst 
%.,%,$(ELIB_DIR))))
 
 CONFIG_UK_PLAT        := $(CONFIG_UK_BASE)/plat/
 CONFIG_UK_LIB         := $(CONFIG_UK_BASE)/lib/
-CONFIG_DIR            := $(CONFIG_UK_APP)
 CONFIG_CONFIG_IN      := $(CONFIG_UK_BASE)/Config.uk
 CONFIG                := $(CONFIG_UK_BASE)/support/kconfig
 CONFIGLIB            := $(CONFIG_UK_BASE)/support/kconfiglib
-UK_CONFIG             := $(CONFIG_DIR)/.config
 UK_CONFIG_OUT         := $(BUILD_DIR)/config
 UK_GENERATED_INCLUDES := $(BUILD_DIR)/include
 KCONFIG_DIR           := $(BUILD_DIR)/kconfig
@@ -397,7 +404,8 @@ properclean:
 
 distclean: properclean
        $(call verbose_cmd,RM,config,$(RM) \
-               $(UK_CONFIG) $(UK_CONFIG).old $(CONFIG_DIR)/..config.tmp \
+               $(UK_CONFIG) $(UK_CONFIG).old \
+               $(CONFIG_DIR)/.$(notdir $(UK_CONFIG)).tmp \
                $(CONFIG_DIR)/.auto.deps)
 
 .PHONY: distclean properclean
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.