summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-08-07 16:48:59 +0200
committerFred Sundvik <fsundvik@gmail.com>2016-08-20 02:56:19 +0200
commit2dd9c1edcdcc3fc579e6109daf9012f9a82b7435 (patch)
tree64d9e62c2ce0109b1430fade4cfd1ede9c1697c7
parent44441de8cad7255fd0637459ed39b89e34751b78 (diff)
downloadqmk_firmware-2dd9c1edcdcc3fc579e6109daf9012f9a82b7435.tar.gz
qmk_firmware-2dd9c1edcdcc3fc579e6109daf9012f9a82b7435.tar.xz
Proper parsing of keymaps inside subprojects
-rw-r--r--Makefile26
1 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index b2a873532..028d14393 100644
--- a/Makefile
+++ b/Makefile
@@ -131,16 +131,32 @@ endef
# $1 Subproject
define PARSE_SUBPROJECT
ifeq ($1,defaultsp)
+ SUBPROJECT_DEFAULT=
$$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
CURRENT_SP := $$(SUBPROJECT_DEFAULT)
else
CURRENT_SP := $1
endif
- KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
- ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
- $$(eval $$(call PARSE_ALL_KEYMAPS))
- else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
- $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
+ # If current subproject is empty (the default was not defined), and we have a list of subproject
+ # then make all
+ ifeq ($$(CURRENT_SP),)
+ ifneq ($$(SUBPROJECTS),)
+ CURRENT_SP := allsp
+ endif
+ endif
+ ifneq ($$(CURRENT_SP),allsp)
+ KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
+ ifneq ($$(CURRENT_SP),)
+ SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.)))
+ KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS))
+ endif
+ ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
+ $$(eval $$(call PARSE_ALL_KEYMAPS))
+ else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
+ $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
+ endif
+ else
+ $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS)))
endif
endef