Skip to content

Commit 0ec2a3a

Browse files
committed
make: fix recursive SUB_MAKE
command line args need to be forwarded as command line args to retain the origin information. Command line arguments were forwarded as environment variables. Environment variables are erased upon invocation of SUB_MAKE Signed-off-by: Øyvind Harboe <[email protected]>
1 parent d723079 commit 0ec2a3a

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

flow/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ IS_CHIP = 1
507507
endif
508508

509509
UNSET_VARS = for var in $(UNSET_VARIABLES_NAMES); do unset $$var; done
510-
SUB_MAKE = $(MAKE) --no-print-directory DESIGN_CONFIG=$(DESIGN_CONFIG)
510+
511+
SUB_MAKE = $(MAKE) $(foreach V,$(COMMAND_LINE_ARGS), $(if $($V),$V=$(shell echo $($V) | sed 's/ /\\ /g'),$V='')) --no-print-directory DESIGN_CONFIG=$(DESIGN_CONFIG)
511512
UNSET_AND_MAKE = @bash -c '$(UNSET_VARS); $(SUB_MAKE) $$@' --
512513

513514
# Separate dependency checking and doing a step. This can

flow/util/generate-vars.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ EXCLUDED_VARS+='|RESULTS_ODB|PUBLIC|ISSUE_SCRIPTS'
1010
EXCLUDED_VARS+='|HOME|PWD|MAIL|SHELL|NPROC|NUM_CORES|FLOW_HOME|\\n'
1111
EXCLUDED_VARS+='|UNSET_VARIABLES_NAMES|do-step|get_variables|do-copy'
1212
EXCLUDED_VARS+='|CURDIR|OPEN_GUI|OPEN_GUI_SHORTCUT'
13+
EXCLUDED_VARS+='|COMMAND_LINE_ARGS'
1314

1415
EXCLUDED_PATTERNS="_EXE$|PATH$|_CMD$|\."
1516

flow/util/utils.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment%
9393
export ISSUE_VARIABLES_NAMES := $(call get_variables,environment% default automatic)
9494
export ISSUE_VARIABLES := $(foreach V, $(ISSUE_VARIABLES_NAMES), $(if $($V),$V=$($V),$V='')${\n})
9595

96+
export COMMAND_LINE_ARGS := $(foreach V,$(.VARIABLES),$(if $(filter command% line, $(origin $V)),$(V)))
97+
9698
$(foreach script,$(ISSUE_SCRIPTS),$(script)_issue): %_issue : versions.txt
9799
$(UTILS_DIR)/makeIssue.sh $*
98100

0 commit comments

Comments
 (0)