aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a03421365..1e11dd5ff 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR))
12 12
13PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR)) 13PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
14 14
15QUANTUM_DIR:=$(ROOT_DIR)/quantum
16
15define NEXT_PATH_ELEMENT 17define NEXT_PATH_ELEMENT
16 $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS))) 18 $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS)))
17 $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS))) 19 $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
@@ -111,8 +113,14 @@ define PARSE_KEYBOARD
111 SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile))) 113 SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile)))
112 ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true) 114 ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true)
113 $$(eval $$(call PARSE_ALL_SUBPROJECTS)) 115 $$(eval $$(call PARSE_ALL_SUBPROJECTS))
116 else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true)
117 $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
114 else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) 118 else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true)
115 $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) 119 $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM)))
120 else
121 # If there's no matching subproject, we assume it's the default
122 # This will allow you to leave the subproject part of the target out
123 $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
116 endif 124 endif
117endef 125endef
118 126
@@ -122,7 +130,12 @@ endef
122 130
123# $1 Subproject 131# $1 Subproject
124define PARSE_SUBPROJECT 132define PARSE_SUBPROJECT
125 CURRENT_SP := $1 133 ifeq ($1,defaultsp)
134 $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
135 CURRENT_SP := $$(SUBPROJECT_DEFAULT)
136 else
137 CURRENT_SP := $1
138 endif
126 KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) 139 KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
127 ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) 140 ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
128 $$(eval $$(call PARSE_ALL_KEYMAPS)) 141 $$(eval $$(call PARSE_ALL_KEYMAPS))
@@ -133,7 +146,7 @@ endef
133 146
134define PARSE_ALL_SUBPROJECTS 147define PARSE_ALL_SUBPROJECTS
135 ifeq ($$(SUBPROJECTS),) 148 ifeq ($$(SUBPROJECTS),)
136 $$(eval $$(call PARSE_SUBPROJECT,)) 149 $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
137 else 150 else
138 $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS))) 151 $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
139 endif 152 endif