summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--make_helpers/build_macros.mk6
2 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 31ac5d6f..ac059e82 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,9 @@
VERSION_MAJOR := 1
VERSION_MINOR := 1
+# Default goal is build all images
+.DEFAULT_GOAL := all
+
include make_helpers/build_macros.mk
################################################################################
@@ -375,9 +378,6 @@ endif
# Build targets
################################################################################
-# Default target
-.DEFAULT_GOAL := all
-
.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool fip certtool
.SUFFIXES:
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