aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-08-16 08:42:08 +0300
committerFred Sundvik <fsundvik@gmail.com>2016-08-20 03:56:43 +0300
commit03e31ef8b9752220d092a1950030cf7942e002eb (patch)
treeadd6ed9124ac87d9f575566233e28842fac3cbc0
parent3442e216dcec3ce6c8ba1c755b0d647a7f384f01 (diff)
downloadqmk_firmware-03e31ef8b9752220d092a1950030cf7942e002eb.tar.gz
qmk_firmware-03e31ef8b9752220d092a1950030cf7942e002eb.zip
Continue on error
-rw-r--r--Makefile6
-rw-r--r--message.mk7
2 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ed89b0733..f80d4e99c 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ endif
12 12
13override SILENT = false 13override SILENT = false
14 14
15ON_ERROR := error_occured=1
16
15STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) 17STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
16ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) 18ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
17ROOT_DIR := $(dir $(ROOT_MAKEFILE)) 19ROOT_DIR := $(dir $(ROOT_MAKEFILE))
@@ -302,7 +304,9 @@ $(SUBPROJECTS): %: %-allkm
302 done 304 done
303 $(eval $(call PARSE_RULE,$@)) 305 $(eval $(call PARSE_RULE,$@))
304 $(eval $(call SET_SILENT_MODE)) 306 $(eval $(call SET_SILENT_MODE))
305 +$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) 307 +error_occured=0; \
308 $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \
309 if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi
306 310
307 311
308.PHONY: all 312.PHONY: all
diff --git a/message.mk b/message.mk
index 6abc78215..f8fd38712 100644
--- a/message.mk
+++ b/message.mk
@@ -15,6 +15,8 @@ else
15 AWK=cat && test 15 AWK=cat && test
16endif 16endif
17 17
18ON_ERROR ?= exit 1
19
18OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n 20OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n
19ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n 21ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n
20WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n 22WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n
@@ -23,9 +25,9 @@ TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }'
23TAB_LOG_PLAIN = printf "$$LOG\n" 25TAB_LOG_PLAIN = printf "$$LOG\n"
24AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' 26AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }'
25AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }' 27AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }'
26PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && exit 1 28PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && $(ON_ERROR)
27PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) 29PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG)
28PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1 30PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && $(ON_ERROR)
29PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) 31PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN)
30PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) 32PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS)
31BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; 33BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
@@ -34,6 +36,7 @@ MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, pleas
34# Define Messages 36# Define Messages
35# English 37# English
36MSG_ERRORS_NONE = Errors: none 38MSG_ERRORS_NONE = Errors: none
39MSG_ERRORS = $(ERROR_COLOR)Make finished with errors\n$(NO_COLOR)
37MSG_BEGIN = -------- begin -------- 40MSG_BEGIN = -------- begin --------
38MSG_END = -------- end -------- 41MSG_END = -------- end --------
39MSG_SIZE_BEFORE = Size before: 42MSG_SIZE_BEFORE = Size before: