summaryrefslogtreecommitdiffstats
path: root/build_keyboard.mk
diff options
context:
space:
mode:
authorDonald Kjer <don.kjer@gmail.com>2021-06-19 15:30:23 -0700
committerGitHub <noreply@github.com>2021-06-19 15:30:23 -0700
commit1272ecd73c218e5827116aa68ce8ce6a4b6df4ec (patch)
tree38ebcec1c7fe11189dbc74d69b095cccd91a0b23 /build_keyboard.mk
parent7c5ef4060e32396ddcbf0fd2ea9a22f569a4e984 (diff)
Fixing incorrect keymap build when switching between multiple keymap.jsons (#12632)
Diffstat (limited to 'build_keyboard.mk')
-rw-r--r--build_keyboard.mk18
1 files changed, 9 insertions, 9 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 91a6c23b71..4c4ff3b5fd 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -103,6 +103,15 @@ MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/rules.mk)
include $(INFO_RULES_MK)
+ifneq ($(FORCE_LAYOUT),)
+ TARGET := $(TARGET)_$(FORCE_LAYOUT)
+endif
+
+# Object files and generated keymap directory
+# To put object files in current directory, use a dot (.), do NOT make
+# this an empty or blank macro!
+KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
+
# Check for keymap.json first, so we can regenerate keymap.c
include build_json.mk
@@ -145,10 +154,6 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
include platforms/chibios/QMK_PROTON_C/convert_to_proton_c.mk
endif
-ifneq ($(FORCE_LAYOUT),)
- TARGET := $(TARGET)_$(FORCE_LAYOUT)
-endif
-
include quantum/mcu_selection.mk
# Find all the C source files to be compiled in subfolders.
@@ -327,11 +332,6 @@ endif
# Disable features that a keyboard doesn't support
-include disable_features.mk
-# Object files directory
-# To put object files in current directory, use a dot (.), do NOT make
-# this an empty or blank macro!
-KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
-
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H += $(KEYMAP_PATH)/config.h
endif