From b780c797beb726839e99e3f4054f9b4c33331cdc Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 28 Oct 2021 01:07:53 +0100 Subject: [PATCH] Migrate makefile utilities to sub-directory (#14917) --- Makefile | 3 ++- build_keyboard.mk | 13 +++++++------ build_test.mk | 5 +++-- bootloader.mk => builddefs/bootloader.mk | 0 .../disable_features.mk | 0 .../generic_features.mk | 0 {quantum => builddefs}/mcu_selection.mk | 0 message.mk => builddefs/message.mk | 0 show_options.mk => builddefs/show_options.mk | 0 common.mk => paths.mk | 5 +++-- 10 files changed, 15 insertions(+), 11 deletions(-) rename bootloader.mk => builddefs/bootloader.mk (100%) rename disable_features.mk => builddefs/disable_features.mk (100%) rename generic_features.mk => builddefs/generic_features.mk (100%) rename {quantum => builddefs}/mcu_selection.mk (100%) rename message.mk => builddefs/message.mk (100%) rename show_options.mk => builddefs/show_options.mk (100%) rename common.mk => paths.mk (91%) diff --git a/Makefile b/Makefile index a1741dd961..c221cb89e0 100644 --- a/Makefile +++ b/Makefile @@ -425,7 +425,8 @@ define SET_SILENT_MODE endif endef -include $(ROOT_DIR)/message.mk +include paths.mk +include $(BUILDDEFS_PATH)/message.mk ifeq ($(strip $(BREAK_ON_ERRORS)), yes) HANDLE_ERROR = exit 1 diff --git a/build_keyboard.mk b/build_keyboard.mk index c1f4f93381..36c628c7ce 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -10,7 +10,8 @@ endif .DEFAULT_GOAL := all -include common.mk +include paths.mk +include $(BUILDDEFS_PATH)/message.mk # Set the qmk cli to use QMK_BIN ?= qmk @@ -164,7 +165,7 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) include platforms/chibios/boards/QMK_PROTON_C/convert_to_proton_c.mk endif -include quantum/mcu_selection.mk +include $(BUILDDEFS_PATH)/mcu_selection.mk # Find all the C source files to be compiled in subfolders. KEYBOARD_SRC := @@ -342,7 +343,7 @@ ifneq ("$(wildcard $(USER_PATH)/post_config.h)","") endif # Disable features that a keyboard doesn't support --include disable_features.mk +-include $(BUILDDEFS_PATH)/disable_features.mk # Pull in post_rules.mk files from all our subfolders ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","") @@ -385,10 +386,10 @@ VPATH += $(KEYBOARD_PATHS) VPATH += $(COMMON_VPATH) include common_features.mk -include generic_features.mk +include $(BUILDDEFS_PATH)/generic_features.mk include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/common.mk -include bootloader.mk +include $(BUILDDEFS_PATH)/bootloader.mk SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) @@ -445,7 +446,7 @@ check-size: build check-md5: build objs-size: build -include show_options.mk +include $(BUILDDEFS_PATH)/show_options.mk include $(TMK_PATH)/rules.mk # Ensure we have generated files available for each of the objects diff --git a/build_test.mk b/build_test.mk index dd66a008ee..8f1ff1e849 100644 --- a/build_test.mk +++ b/build_test.mk @@ -4,7 +4,8 @@ endif .DEFAULT_GOAL := all -include common.mk +include paths.mk +include $(BUILDDEFS_PATH)/message.mk TARGET=test/$(TEST) @@ -52,7 +53,7 @@ include tests/$(TEST)/rules.mk endif include common_features.mk -include generic_features.mk +include $(BUILDDEFS_PATH)/generic_features.mk include $(TMK_PATH)/common.mk include $(QUANTUM_PATH)/debounce/tests/rules.mk include $(QUANTUM_PATH)/sequencer/tests/rules.mk diff --git a/bootloader.mk b/builddefs/bootloader.mk similarity index 100% rename from bootloader.mk rename to builddefs/bootloader.mk diff --git a/disable_features.mk b/builddefs/disable_features.mk similarity index 100% rename from disable_features.mk rename to builddefs/disable_features.mk diff --git a/generic_features.mk b/builddefs/generic_features.mk similarity index 100% rename from generic_features.mk rename to builddefs/generic_features.mk diff --git a/quantum/mcu_selection.mk b/builddefs/mcu_selection.mk similarity index 100% rename from quantum/mcu_selection.mk rename to builddefs/mcu_selection.mk diff --git a/message.mk b/builddefs/message.mk similarity index 100% rename from message.mk rename to builddefs/message.mk diff --git a/show_options.mk b/builddefs/show_options.mk similarity index 100% rename from show_options.mk rename to builddefs/show_options.mk diff --git a/common.mk b/paths.mk similarity index 91% rename from common.mk rename to paths.mk index 8acea39376..78eaf39967 100644 --- a/common.mk +++ b/paths.mk @@ -1,5 +1,3 @@ -include message.mk - # Directory common source files exist TOP_DIR = . TMK_DIR = tmk_core @@ -15,6 +13,9 @@ DRIVER_PATH = $(DRIVER_DIR) PLATFORM_DIR = platforms PLATFORM_PATH = $(PLATFORM_DIR) +BUILDDEFS_DIR = builddefs +BUILDDEFS_PATH = $(BUILDDEFS_DIR) + BUILD_DIR := .build COMMON_VPATH := $(TOP_DIR)