aboutsummaryrefslogtreecommitdiffstats
path: root/build_keyboard.mk
diff options
context:
space:
mode:
authorGravatar Fred Sundvik <fsundvik@gmail.com>2016-08-15 08:58:05 +0300
committerGravatar Fred Sundvik <fsundvik@gmail.com>2016-08-20 03:56:41 +0300
commit9028a412eaf95e37e98a9f2e4573653ec70d7e18 (patch)
treec684154bf682eb988876f23115f8d56462c4e1b9 /build_keyboard.mk
parent33fbd3be36bf58c6a02fb6b4ae99dc5bca7c8e58 (diff)
downloadqmk_firmware-9028a412eaf95e37e98a9f2e4573653ec70d7e18.tar.gz
Add output specific config file
Diffstat (limited to 'build_keyboard.mk')
-rw-r--r--build_keyboard.mk17
1 files changed, 10 insertions, 7 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 0debc4925..a6b578efb 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -56,9 +56,17 @@ ifeq ($(PLATFORM),CHIBIOS)
OPT_OS = chibios
endif
+CONFIG_H = $(KEYBOARD_PATH)/config.h
+ifneq ($(SUBPROJECT),)
+ ifneq ("$(wildcard $(SUBPROJECT_C))","")
+ CONFIG_H = $(SUBPROJECT_PATH)/config.h
+ endif
+endif
+
# Save the defines and includes here, so we don't include any keymap specific ones
PROJECT_DEFS := $(OPT_DEFS)
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH)
+PROJECT_CONFIG := $(CONFIG_H)
MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
@@ -94,13 +102,6 @@ KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H = $(KEYMAP_PATH)/config.h
-else
- CONFIG_H = $(KEYBOARD_PATH)/config.h
- ifneq ($(SUBPROJECT),)
- ifneq ("$(wildcard $(SUBPROJECT_C))","")
- CONFIG_H = $(SUBPROJECT_PATH)/config.h
- endif
- endif
endif
# # project specific files
@@ -192,9 +193,11 @@ OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
$(KEYMAP_OUTPUT)_INC := $(EXTRAINCDIRS) $(VPATH)
+$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
+$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
include $(TMK_PATH)/rules.mk