1
0
Fork 0
forked from forks/qmk_firmware

Migrate more makefile utilities to builddefs sub-directory (#16002)

This commit is contained in:
Joel Challis 2022-02-10 17:45:51 +00:00 committed by GitHub
parent 7a0fd646e3
commit f7e7671f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 15 additions and 13 deletions

View file

@ -275,7 +275,7 @@ define PARSE_KEYMAP
# Specify the variables that we are passing forward to submake # Specify the variables that we are passing forward to submake
MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) QMK_BIN=$$(QMK_BIN) MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) QMK_BIN=$$(QMK_BIN)
# And the first part of the make command # And the first part of the make command
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET) MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_keyboard.mk $$(MAKE_TARGET)
# The message to display # The message to display
MAKE_MSG := $$(MSG_MAKE_KB) MAKE_MSG := $$(MSG_MAKE_KB)
# We run the command differently, depending on if we want more output or not # We run the command differently, depending on if we want more output or not
@ -317,7 +317,7 @@ define BUILD_TEST
TEST_NAME := $$(notdir $$(TEST_PATH)) TEST_NAME := $$(notdir $$(TEST_PATH))
MAKE_TARGET := $2 MAKE_TARGET := $2
COMMAND := $1 COMMAND := $1
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET) MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_test.mk $$(MAKE_TARGET)
MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)" MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)"
MAKE_MSG := $$(MSG_MAKE_TEST) MAKE_MSG := $$(MSG_MAKE_TEST)
$$(eval $$(call BUILD)) $$(eval $$(call BUILD))
@ -339,7 +339,7 @@ define PARSE_TEST
TESTS := TESTS :=
TEST_NAME := $$(firstword $$(subst :, ,$$(RULE))) TEST_NAME := $$(firstword $$(subst :, ,$$(RULE)))
TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME):,,$$(RULE))) TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME):,,$$(RULE)))
include $(ROOT_DIR)/testlist.mk include $(BUILDDEFS_PATH)/testlist.mk
ifeq ($$(TEST_NAME),all) ifeq ($$(TEST_NAME),all)
MATCHED_TESTS := $$(TEST_LIST) MATCHED_TESTS := $$(TEST_LIST)
else else

View file

@ -111,7 +111,7 @@ INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard
include $(INFO_RULES_MK) include $(INFO_RULES_MK)
# Check for keymap.json first, so we can regenerate keymap.c # Check for keymap.json first, so we can regenerate keymap.c
include build_json.mk include $(BUILDDEFS_PATH)/build_json.mk
# Pull in keymap level rules.mk # Pull in keymap level rules.mk
ifeq ("$(wildcard $(KEYMAP_PATH))", "") ifeq ("$(wildcard $(KEYMAP_PATH))", "")
@ -138,7 +138,7 @@ ifeq ("$(wildcard $(KEYMAP_PATH))", "")
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
else ifneq ($(LAYOUTS),) else ifneq ($(LAYOUTS),)
# If we haven't found a keymap yet fall back to community layouts # If we haven't found a keymap yet fall back to community layouts
include build_layout.mk include $(BUILDDEFS_PATH)/build_layout.mk
else else
$(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap) $(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap)
# this state should never be reached # this state should never be reached
@ -398,7 +398,7 @@ VPATH += $(COMMON_VPATH)
VPATH += $(KEYBOARD_OUTPUT)/src VPATH += $(KEYBOARD_OUTPUT)/src
VPATH += $(KEYMAP_OUTPUT)/src VPATH += $(KEYMAP_OUTPUT)/src
include common_features.mk include $(BUILDDEFS_PATH)/common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk include $(BUILDDEFS_PATH)/generic_features.mk
include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/protocol.mk
include $(PLATFORM_PATH)/common.mk include $(PLATFORM_PATH)/common.mk
@ -460,7 +460,7 @@ check-md5: build
objs-size: build objs-size: build
include $(BUILDDEFS_PATH)/show_options.mk include $(BUILDDEFS_PATH)/show_options.mk
include $(TMK_PATH)/rules.mk include $(BUILDDEFS_PATH)/common_rules.mk
# Ensure we have generated files available for each of the objects # Ensure we have generated files available for each of the objects
define GEN_FILES define GEN_FILES

View file

@ -54,7 +54,7 @@ include tests/test_common/build.mk
include $(TEST_PATH)/test.mk include $(TEST_PATH)/test.mk
endif endif
include common_features.mk include $(BUILDDEFS_PATH)/common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk include $(BUILDDEFS_PATH)/generic_features.mk
include $(PLATFORM_PATH)/common.mk include $(PLATFORM_PATH)/common.mk
include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/protocol.mk
@ -63,7 +63,7 @@ include $(QUANTUM_PATH)/encoder/tests/rules.mk
include $(QUANTUM_PATH)/sequencer/tests/rules.mk include $(QUANTUM_PATH)/sequencer/tests/rules.mk
include $(PLATFORM_PATH)/test/rules.mk include $(PLATFORM_PATH)/test/rules.mk
ifneq ($(filter $(FULL_TESTS),$(TEST)),) ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include build_full_test.mk include $(BUILDDEFS_PATH)/build_full_test.mk
endif endif
$(TEST)_SRC += \ $(TEST)_SRC += \
@ -77,7 +77,7 @@ $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG) $(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
include $(TMK_PATH)/rules.mk include $(BUILDDEFS_PATH)/common_rules.mk
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null) $(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)

View file

@ -69,7 +69,7 @@ def multibuild(cli):
all: {keyboard_safe}_binary all: {keyboard_safe}_binary
{keyboard_safe}_binary: {keyboard_safe}_binary:
@rm -f "{QMK_FIRMWARE}/.build/failed.log.{keyboard_safe}" || true @rm -f "{QMK_FIRMWARE}/.build/failed.log.{keyboard_safe}" || true
+@$(MAKE) -C "{QMK_FIRMWARE}" -f "{QMK_FIRMWARE}/build_keyboard.mk" KEYBOARD="{keyboard_name}" KEYMAP="{cli.args.keymap}" REQUIRE_PLATFORM_KEY= COLOR=true SILENT=false {' '.join(cli.args.env)} \\ +@$(MAKE) -C "{QMK_FIRMWARE}" -f "{QMK_FIRMWARE}/builddefs/build_keyboard.mk" KEYBOARD="{keyboard_name}" KEYMAP="{cli.args.keymap}" REQUIRE_PLATFORM_KEY= COLOR=true SILENT=false {' '.join(cli.args.env)} \\
>>"{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" 2>&1 \\ >>"{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" 2>&1 \\
|| cp "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" "{QMK_FIRMWARE}/.build/failed.log.{os.getpid()}.{keyboard_safe}" || cp "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" "{QMK_FIRMWARE}/.build/failed.log.{os.getpid()}.{keyboard_safe}"
@{{ grep '\[ERRORS\]' "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;31m[ERRORS]\e[0m\\n" "{keyboard_name}:{cli.args.keymap}" ; }} \\ @{{ grep '\[ERRORS\]' "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;31m[ERRORS]\e[0m\\n" "{keyboard_name}:{cli.args.keymap}" ; }} \\

View file

@ -213,7 +213,7 @@ def compile_configurator_json(user_keymap, bootloader=None, parallel=1, **env_va
'-r', '-r',
'-R', '-R',
'-f', '-f',
'build_keyboard.mk', 'builddefs/build_keyboard.mk',
]) ])
if bootloader: if bootloader:

View file

@ -2,7 +2,9 @@
TOP_DIR = . TOP_DIR = .
TMK_DIR = tmk_core TMK_DIR = tmk_core
TMK_PATH = $(TMK_DIR) TMK_PATH = $(TMK_DIR)
LIB_PATH = lib
LIB_DIR = lib
LIB_PATH = $(LIB_DIR)
QUANTUM_DIR = quantum QUANTUM_DIR = quantum
QUANTUM_PATH = $(QUANTUM_DIR) QUANTUM_PATH = $(QUANTUM_DIR)