From bcbc64aed83c676bf4cfbf64e877b020812b4c0a Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 7 Jun 2018 20:54:25 -0400 Subject: [PATCH] fix layouts --- build_keyboard.mk | 8 ++++---- build_layout.mk | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index ec21f02ba5..3a671b0631 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -231,10 +231,6 @@ ifeq ("$(USER_NAME)","") endif USER_PATH := users/$(USER_NAME) --include $(USER_PATH)/rules.mk -ifneq ("$(wildcard $(USER_PATH)/config.h)","") - CONFIG_H += $(USER_PATH)/config.h -endif # Object files directory # To put object files in current directory, use a dot (.), do NOT make @@ -243,6 +239,7 @@ KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET) -include $(PARENT_KEYMAP_PATH)/rules.mk -include $(KEYMAP_PATH)/rules.mk +-include $(USER_PATH)/rules.mk ifneq ("$(wildcard $(PARENT_KEYMAP_PATH)/config.h)","") CONFIG_H += $(PARENT_KEYMAP_PATH)/config.h @@ -250,6 +247,9 @@ endif ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") CONFIG_H += $(KEYMAP_PATH)/config.h endif +ifneq ("$(wildcard $(USER_PATH)/config.h)","") + CONFIG_H += $(USER_PATH)/config.h +endif # # project specific files SRC += $(KEYBOARD_SRC) \ diff --git a/build_layout.mk b/build_layout.mk index bc76d3b9f1..06d091a806 100644 --- a/build_layout.mk +++ b/build_layout.mk @@ -3,12 +3,15 @@ LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/)))) define SEARCH_LAYOUTS_REPO LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP) + PARENT_LAYOUT_KEYMAP_PATH := $(patsubst %/,%,$(dir $(LAYOUT_KEYMAP_PATH))) LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c + PARENT_LAYOUT_KEYMAP_C := $$(PARENT_LAYOUT_KEYMAP_PATH)/keymap.c ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","") KEYMAP_C := $$(LAYOUT_KEYMAP_C) KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH) - else - $$(error Could not find keymap) + else ifneq ("$$(wildcard $$(PARENT_LAYOUT_KEYMAP_C))","") + KEYMAP_C := $$(PARENT_LAYOUT_KEYMAP_C) + KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH) endif endef