aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-08-24 10:29:01 +0300
committerFred Sundvik <fsundvik@gmail.com>2016-08-24 10:29:01 +0300
commit7c9fff59d0bfd36016a5cd79d40ec27ae591610b (patch)
treeddca26737e70599063fa9dfcc3facdb5bb171b2b
parentfeebc58d327b969fe1ef11cd5b5989a60c51ac87 (diff)
downloadqmk_firmware-7c9fff59d0bfd36016a5cd79d40ec27ae591610b.tar.gz
qmk_firmware-7c9fff59d0bfd36016a5cd79d40ec27ae591610b.zip
Fix slight inconsistency
When running make from either a keyboard folder or a subproject it runs all keymaps for all subprojects and the selected subproject respectively. Without this fix, the same doesn't happen if your run make clean for example. As it would just provide you with an error message. Now this will work as expected.
-rw-r--r--Makefile28
1 files changed, 15 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index c8122e576..f78cca6c6 100644
--- a/Makefile
+++ b/Makefile
@@ -262,7 +262,7 @@ define PARSE_KEYBOARD
262 # If there's no matching subproject, we assume it's the default 262 # If there's no matching subproject, we assume it's the default
263 # This will allow you to leave the subproject part of the target out 263 # This will allow you to leave the subproject part of the target out
264 else 264 else
265 $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) 265 $$(eval $$(call PARSE_SUBPROJECT,))
266 endif 266 endif
267endef 267endef
268 268
@@ -278,12 +278,14 @@ endef
278define PARSE_SUBPROJECT 278define PARSE_SUBPROJECT
279 # If we want to compile the default subproject, then we need to 279 # If we want to compile the default subproject, then we need to
280 # include the correct makefile to determine the actual name of it 280 # include the correct makefile to determine the actual name of it
281 ifeq ($1,defaultsp) 281 CURRENT_SP := $1
282 ifeq ($$(CURRENT_SP),)
283 CURRENT_SP := defaultsp
284 endif
285 ifeq ($$(CURRENT_SP),defaultsp)
282 SUBPROJECT_DEFAULT= 286 SUBPROJECT_DEFAULT=
283 $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) 287 $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
284 CURRENT_SP := $$(SUBPROJECT_DEFAULT) 288 CURRENT_SP := $$(SUBPROJECT_DEFAULT)
285 else
286 CURRENT_SP := $1
287 endif 289 endif
288 # If current subproject is empty (the default was not defined), and we have a list of subproject 290 # If current subproject is empty (the default was not defined), and we have a list of subproject
289 # then make all of them 291 # then make all of them
@@ -314,16 +316,16 @@ define PARSE_SUBPROJECT
314 # Otherwise try to match the keymap from the current folder, or arguments to the make command 316 # Otherwise try to match the keymap from the current folder, or arguments to the make command
315 else ifneq ($$(KEYMAP),) 317 else ifneq ($$(KEYMAP),)
316 $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP))) 318 $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
319 # No matching keymap found, so we assume that the rest of the rule is the target
320 # If we haven't been able to parse out a subproject, then make all of them
321 # This is consistent with running make without any arguments from the keyboard
322 # folder
323 else ifeq ($1,)
324 $$(eval $$(call PARSE_ALL_SUBPROJECTS))
325 # Otherwise, make all keymaps, again this is consistent with how it works without
326 # any arguments
317 else 327 else
318 # Otherwise something is wrong with the target 328 $$(eval $$(call PARSE_ALL_KEYMAPS))
319 # Try to give as much information as possible of what it it was trying to do
320 ifeq ($$(CURRENT_SP),)
321 $$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(RULE)'. Stop.)
322 else
323 $$(info make: *** No rule to make target '$$(CURRENT_KB)-$$(CURRENT_SP)-$$(RULE)'. Stop.)
324 endif
325 # Notice the tab instead of spaces below!
326 exit 1
327 endif 329 endif
328 else 330 else
329 # As earlier mentione,d when allsb is specified, we call our self recursively 331 # As earlier mentione,d when allsb is specified, we call our self recursively