1
0
Fork 0

Userspace: add support for adding environment variables during build (#22887)

This commit is contained in:
Nick Brassel 2024-08-12 22:34:22 +10:00 committed by GitHub
parent 158aaef78c
commit 380e0c9cad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 372 additions and 159 deletions

View file

@ -34,10 +34,16 @@ ifeq ($(strip $(DUMP_CI_METADATA)),yes)
endif
# Force expansion
TARGET := $(TARGET)
override TARGET := $(TARGET)
$(info TARGET=$(TARGET))
ifneq ($(FORCE_LAYOUT),)
TARGET := $(TARGET)_$(FORCE_LAYOUT)
override TARGET := $(TARGET)_$(FORCE_LAYOUT)
$(info TARGET=$(TARGET))
endif
ifneq ($(CONVERT_TO),)
override TARGET := $(TARGET)_$(CONVERT_TO)
$(info TARGET=$(TARGET))
endif
# Object files and generated keymap directory
@ -58,9 +64,6 @@ ifdef SKIP_GIT
VERSION_H_FLAGS += --skip-git
endif
# Generate the board's version.h file.
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(INTERMEDIATE_OUTPUT)/src/version.h)
# Determine which subfolders exist.
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
@ -218,6 +221,9 @@ endif
include $(BUILDDEFS_PATH)/converters.mk
# Generate the board's version.h file.
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(INTERMEDIATE_OUTPUT)/src/version.h)
MCU_ORIG := $(MCU)
include $(wildcard $(PLATFORM_PATH)/*/mcu_selection.mk)

View file

@ -32,9 +32,6 @@ ifneq ($(CONVERT_TO),)
PLATFORM_KEY = $(shell echo $(CONVERTER) | cut -d "/" -f2)
# force setting as value can be from environment
override TARGET := $(TARGET)_$(CONVERT_TO)
# Configure any defaults
OPT_DEFS += -DCONVERT_TO_$(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]')
OPT_DEFS += -DCONVERTER_TARGET=\"$(CONVERT_TO)\"