summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-08-07 18:44:57 +0300
committerFred Sundvik <fsundvik@gmail.com>2016-08-20 03:56:24 +0300
commit4f20061f6619f632c28518979d17a51674a3f2c9 (patch)
tree65f90f286cc9a058dc4355eb4df685245b6db962 /Makefile
parent051017c3129a17a1f4c610f19067c60bf0a49da9 (diff)
Proper handling for running make from a subproject or keymap dir
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7180b41476..a14642af6c 100644
--- a/Makefile
+++ b/Makefile
@@ -105,6 +105,15 @@ define PARSE_RULE
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
else ifneq ($$(KEYBOARD),)
+ # If there's no match in the beginning, then use the working directory instead
+ # First add the keymap to the commandline if we are in a keymap subdirectory
+ ifneq ($$(KEYMAP),)
+ RULE := $$(KEYMAP)-$$(RULE)
+ endif
+ # If we are in a subproject subdirectory add the subproject
+ ifneq ($$(SUBPROJECT),)
+ RULE := $$(SUBPROJECT)-$$(RULE)
+ endif
$$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD)))
else
$$(info make: *** No rule to make target '$1'. Stop.)