aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-10-14 11:32:19 -1000
committerGitHub <noreply@github.com>2017-10-14 11:32:19 -1000
commit800ec55dfca06b4630acf62cbb5f130c4031e4f1 (patch)
tree718e43d976bc71627558b5f9e1b657e8a64e4131 /tmk_core
parente5dc2253e26a105a11e0fad3e4e39c306e49cc92 (diff)
downloadfirmware-800ec55dfca06b4630acf62cbb5f130c4031e4f1.tar.gz
firmware-800ec55dfca06b4630acf62cbb5f130c4031e4f1.tar.bz2
firmware-800ec55dfca06b4630acf62cbb5f130c4031e4f1.zip
Make arguments redo, subproject elimination (#1784)
* redo make args to use colons, better folder structuring system [skip ci] * don't put spaces after statements - hard lessons in makefile development * fix-up some other rules.mk * give travis a chance * reset KEYMAPS variable * start converting keyboards to new system * try making all with travis * redo make args to use colons, better folder structuring system [skip ci] * don't put spaces after statements - hard lessons in makefile development * fix-up some other rules.mk * give travis a chance * reset KEYMAPS variable * start converting keyboards to new system * try making all with travis * start to update readmes and keyboards * look in keyboard directories for board.mk * update visualizer rules * fix up some other keyboards/keymaps * fix arm board ld includes * fix board rules * fix up remaining keyboards * reset layout variable * reset keyboard_layouts * fix remainging keymaps/boards * update readmes, docs * add note to makefile error * update readmes * remove planck keymap warnings * update references and docs * test out tarvis build stages * don't use stages for now * don't use stages for now
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk35
-rw-r--r--tmk_core/rules.mk2
2 files changed, 32 insertions, 5 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index c938eaeb9..c804d237e 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -46,13 +46,32 @@ endif
include $(PLATFORM_MK)
-BOARD_MK = $(KEYBOARD_PATH)/boards/$(BOARD)/board.mk
+BOARD_MK :=
+
+ifneq ("$(wildcard $(KEYBOARD_PATH_5)/boards/$(BOARD)/board.mk)","")
+ BOARD_PATH = $(KEYBOARD_PATH_5)
+ BOARD_MK += $(KEYBOARD_PATH_5)/boards/$(BOARD)/board.mk
+else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/boards/$(BOARD)/board.mk)","")
+ BOARD_PATH = $(KEYBOARD_PATH_4)
+ BOARD_MK += $(KEYBOARD_PATH_4)/boards/$(BOARD)/board.mk
+else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/boards/$(BOARD)/board.mk)","")
+ BOARD_PATH = $(KEYBOARD_PATH_3)
+ BOARD_MK += $(KEYBOARD_PATH_3)/boards/$(BOARD)/board.mk
+else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/boards/$(BOARD)/board.mk)","")
+ BOARD_PATH = $(KEYBOARD_PATH_2)
+ BOARD_MK += $(KEYBOARD_PATH_2)/boards/$(BOARD)/board.mk
+else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/boards/$(BOARD)/board.mk)","")
+ BOARD_PATH = $(KEYBOARD_PATH_1)
+ BOARD_MK += $(KEYBOARD_PATH_1)/boards/$(BOARD)/board.mk
+endif
+
ifeq ("$(wildcard $(BOARD_MK))","")
BOARD_MK = $(CHIBIOS)/os/hal/boards/$(BOARD)/board.mk
ifeq ("$(wildcard $(BOARD_MK))","")
BOARD_MK = $(CHIBIOS_CONTRIB)/os/hal/boards/$(BOARD)/board.mk
endif
endif
+
include $(BOARD_MK)
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
@@ -72,10 +91,18 @@ RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
endif
# Define linker script file here
-ifneq ("$(wildcard $(KEYBOARD_PATH)/ld/$(MCU_LDSCRIPT).ld)","")
-LDSCRIPT = $(KEYBOARD_PATH)/ld/$(MCU_LDSCRIPT).ld
+ifneq ("$(wildcard $(KEYBOARD_PATH_5)/ld/$(MCU_LDSCRIPT).ld)","")
+ LDSCRIPT = $(KEYBOARD_PATH_5)/ld/$(MCU_LDSCRIPT).ld
+else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/ld/$(MCU_LDSCRIPT).ld)","")
+ LDSCRIPT = $(KEYBOARD_PATH_4)/ld/$(MCU_LDSCRIPT).ld
+else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/ld/$(MCU_LDSCRIPT).ld)","")
+ LDSCRIPT = $(KEYBOARD_PATH_3)/ld/$(MCU_LDSCRIPT).ld
+else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld)","")
+ LDSCRIPT = $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld
+else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld)","")
+ LDSCRIPT = $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld
else
-LDSCRIPT = $(STARTUPLD)/$(MCU_LDSCRIPT).ld
+ LDSCRIPT = $(STARTUPLD)/$(MCU_LDSCRIPT).ld
endif
CHIBISRC = $(STARTUPSRC) \
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 73ffeaac1..53e79ef47 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -290,7 +290,7 @@ BEGIN = gccversion sizebefore
define GEN_OBJRULE
$1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC))
ifdef $1_CONFIG
-$1_CONFIG_FLAGS += -include $$($1_CONFIG)
+$1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG))
endif
$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS)
$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS)