aboutsummaryrefslogtreecommitdiff
path: root/Common.mk
diff options
context:
space:
mode:
authorPieter du Preez <pdupreez@gmail.com>2018-10-02 22:53:12 +0200
committerPieter du Preez <pdupreez@gmail.com>2018-10-02 22:53:12 +0200
commitd4d3d3d6c354db1e2989d8dd671f8af96cc036d8 (patch)
treee2039458133c714d061dc477beb09f9b683b81a8 /Common.mk
parentddf7210407b8716973b9890cf7b59561af641b96 (diff)
parentfe84c591944f74c902466d813fae0d164761dc59 (diff)
Merge remote-tracking branch 'org/master' into move_core_link_last
Diffstat (limited to 'Common.mk')
-rw-r--r--Common.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/Common.mk b/Common.mk
index 5f30fba..c5f2bc2 100644
--- a/Common.mk
+++ b/Common.mk
@@ -5,6 +5,17 @@ COMMON_INCLUDED = TRUE
# (directory and optional filename) exists
dir_if_exists = $(if $(wildcard $(1)$(2)),$(1))
+ifndef PARSE_BOARD
+# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
+PARSE_BOARD = $(shell if [ -f $(BOARDS_TXT) ]; \
+then \
+ grep -Ev '^\#' $(BOARDS_TXT) | \
+ grep -E "^[ \t]*$(1).$(2)=" | \
+ cut -d = -f 2 | \
+ cut -d : -f 2; \
+fi)
+endif
+
# Run a shell script if it exists. Stops make on error.
runscript_if_exists = \
$(if $(wildcard $(1)), \