summaryrefslogtreecommitdiff
path: root/make_helpers
diff options
context:
space:
mode:
Diffstat (limited to 'make_helpers')
-rw-r--r--make_helpers/build_macros.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index 0e2e2ac9..9ab6e648 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -112,6 +112,12 @@ endef
# Auxiliary macros to build TF images from sources
################################################################################
+# If no goal is specified in the command line, .DEFAULT_GOAL is used.
+# .DEFAULT_GOAL is defined in the main Makefile before including this file.
+ifeq ($(MAKECMDGOALS),)
+MAKECMDGOALS := $(.DEFAULT_GOAL)
+endif
+
define match_goals
$(strip $(foreach goal,$(1),$(filter $(goal),$(MAKECMDGOALS))))
endef