Skip to content

Commit 65da6fc

Browse files
authored
Merge pull request #2138 from Pinata-Consulting/sub-make-fix-take-2
makefile: SUB_MAKE fix
2 parents b8cd70a + 15c7fce commit 65da6fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

flow/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,13 @@ endif
549549

550550
UNSET_VARS = for var in $(UNSET_VARIABLES_NAMES); do unset $$var; done
551551

552-
SUB_MAKE = $(MAKE) $(foreach V,$(COMMAND_LINE_ARGS), $(if $($V),$V=$(shell echo "$($V)" | $(FLOW_HOME)/scripts/escape.sh),$V='')) --no-print-directory DESIGN_CONFIG=$(DESIGN_CONFIG)
552+
# FILE_MAKEFILE is needed when ORFS is invoked with
553+
# `make --file=$FLOW_DIR/Makefile` or `make --directory $FLOW_DIR`.
554+
#
555+
# However, on some versions of make, MAKEFILE_LIST can be empty, so
556+
# don't expand it in that case.
557+
FILE_MAKEFILE ?= $(if $(firstword $(MAKEFILE_LIST)),--file=$(firstword $(MAKEFILE_LIST)),)
558+
SUB_MAKE = $(MAKE) $(foreach V,$(COMMAND_LINE_ARGS), $(if $($V),$V=$(shell echo "$($V)" | $(FLOW_HOME)/scripts/escape.sh),$V='')) --no-print-directory $(FILE_MAKEFILE) DESIGN_CONFIG=$(DESIGN_CONFIG)
553559
UNSET_AND_MAKE = @bash -c '$(UNSET_VARS); $(SUB_MAKE) $$@' --
554560

555561
$(OBJECTS_DIR)/copyright.txt:

0 commit comments

Comments
 (0)