aboutsummaryrefslogtreecommitdiff
path: root/Common.mk
diff options
context:
space:
mode:
authorSudar Muthu <sudar@sudarmuthu.com>2018-09-30 20:13:29 +0530
committerGitHub <noreply@github.com>2018-09-30 20:13:29 +0530
commitfe84c591944f74c902466d813fae0d164761dc59 (patch)
tree5c29b0153379c57c9d75e1c03b9fef987fb82015 /Common.mk
parent089b535601b6411eb8055d449125888bcc666aa1 (diff)
parent62d23d66a2f9326235022bfd8711c62e015c0bc8 (diff)
Merge pull request #580 from wingunder/master
Moved the PARSE_BOARD macro and added the TOOL_PREFIX variable for setting up tool chains.
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)), \