]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Proper handling for running make from a subproject or keymap dir
authorFred Sundvik <fsundvik@gmail.com>
Sun, 7 Aug 2016 15:44:57 +0000 (18:44 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Sat, 20 Aug 2016 00:56:24 +0000 (03:56 +0300)
Makefile

index 7180b41476aca93d2b524b638afdc75d80484cd6..a14642af6cdd2f1056331d87514c3243028da83a 100644 (file)
--- 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.)