aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/chibios.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/chibios.mk')
-rw-r--r--tmk_core/chibios.mk24
1 files changed, 19 insertions, 5 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 957a25922..6b298732c 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -42,6 +42,11 @@ ifeq ($(strip $(MCU)), risc-v)
42 PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/platform.mk 42 PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/platform.mk
43else 43else
44 # ARM Support 44 # ARM Support
45 CHIBIOS_PORT ?=
46 ifeq ("$(CHIBIOS_PORT)","")
47 CHIBIOS_PORT = ARMv$(ARMV)-M
48 endif
49
45 # Startup files. Try a few different locations, for compability with old versions and 50 # Startup files. Try a few different locations, for compability with old versions and
46 # for things hardware in the contrib repository 51 # for things hardware in the contrib repository
47 STARTUP_MK = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_$(MCU_STARTUP).mk 52 STARTUP_MK = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_$(MCU_STARTUP).mk
@@ -52,15 +57,24 @@ else
52 endif 57 endif
53 endif 58 endif
54 59
55 # Compability with old version 60 # Port files. Try a few different locations, for compability with old versions and
56 PORT_V = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk 61 # for things hardware in the contrib repository
62 PORT_V = $(CHIBIOS)/os/common/ports/$(CHIBIOS_PORT)/compilers/GCC/mk/port.mk
57 ifeq ("$(wildcard $(PORT_V))","") 63 ifeq ("$(wildcard $(PORT_V))","")
58 PORT_V = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk 64 PORT_V = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk
65 ifeq ("$(wildcard $(PORT_V))","")
66 PORT_V = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk
67 endif
59 endif 68 endif
60 69
61 RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC 70 # Rules location. Try a few different locations, for compability with old versions and
71 # for things hardware in the contrib repository
72 RULESPATH = $(CHIBIOS)/os/common/ports/$(CHIBIOS_PORT)/compilers/GCC
62 ifeq ("$(wildcard $(RULESPATH)/rules.mk)","") 73 ifeq ("$(wildcard $(RULESPATH)/rules.mk)","")
63 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC 74 RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
75 ifeq ("$(wildcard $(RULESPATH)/rules.mk)","")
76 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
77 endif
64 endif 78 endif
65endif 79endif
66 80