@@ -130,9 +130,6 @@ CONFIG_COREBOOT_CONFIG ?= config/coreboot-$(BOARD).config
130
130
CONFIG_COREBOOT_LOCALVERSION ?= "$(BRAND_NAME)-$(HEADS_GIT_VERSION)"
131
131
CONFIG_COREBOOT_SMBIOS_PRODUCT_NAME ?= $(BOARD)
132
132
133
- # Ensure that touching the config file will force a rebuild
134
- $(build)/$(coreboot_dir)/.configured: $(CONFIG_COREBOOT_CONFIG)
135
-
136
133
# Select the coreboot version to use for the toolchain
137
134
ifeq "$($(coreboot_module)_toolchain)" ""
138
135
# Use the same module
@@ -144,34 +141,29 @@ modules-y += $(coreboot_toolchain_module)
144
141
# The toolchain module won't build anything for this board, we just need
145
142
# the module prepped so we can hook up the toolchain target
146
143
$(coreboot_toolchain_module)_output := .nobuild
147
- $(coreboot-toolchain_module )_configure := echo -e 'all:\n\ttouch .nobuild' > Makefile.nobuild
148
- $(coreboot-toolchain_module )_target := -f Makefile.nobuild
144
+ $(coreboot_toolchain_module )_configure := echo -e 'all:\n\ttouch .nobuild' > Makefile.nobuild
145
+ $(coreboot_toolchain_module )_target := -f Makefile.nobuild
149
146
endif
150
147
151
- $(coreboot_module)_configure := \
152
- mkdir -p "$(build)/$(coreboot_dir)"; \
153
- $(call install_config,$(pwd)/$(CONFIG_COREBOOT_CONFIG),$(build)/$(coreboot_dir)/.config); \
154
- sed -i '/^CONFIG_LOCALVERSION/d' $(build)/$(coreboot_dir)/.config; \
155
- echo 'CONFIG_LOCALVERSION=$(CONFIG_COREBOOT_LOCALVERSION)' >> $(build)/$(coreboot_dir)/.config; \
156
- sed -i '/^CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME/d' $(build)/$(coreboot_dir)/.config; \
157
- echo 'CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="$(CONFIG_COREBOOT_SMBIOS_PRODUCT_NAME)"' >> $(build)/$(coreboot_dir)/.config; \
158
- if [ ! -z "$(CONFIG_COREBOOT_SMBIOS_MANUFACTURER)" ]; then \
159
- sed -i '/^CONFIG_MAINBOARD_SMBIOS_MANUFACTURER/d' $(build)/$(coreboot_dir)/.config; \
160
- echo 'CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="$(CONFIG_COREBOOT_SMBIOS_MANUFACTURER)"' >> $(build)/$(coreboot_dir)/.config; \
161
- fi; \
162
- $(MAKE) olddefconfig \
163
- -C "$(build)/$(coreboot_base_dir)" \
164
- obj="$(build)/$(coreboot_dir)" \
165
- DOTCONFIG="$(build)/$(coreboot_dir)/.config" \
166
- BUILD_TIMELESS=1 \
148
+ # Define COREBOOT_TOOLCHAIN_DIR based on the resolved toolchain module
149
+ COREBOOT_TOOLCHAIN_DIR := $(build)/$($(coreboot_toolchain_module)_base_dir)
150
+
151
+ # Ensure that touching the config file will force a rebuild
152
+ $(build)/$(coreboot_dir)/.configured: $(CONFIG_COREBOOT_CONFIG) $(COREBOOT_TOOLCHAIN_DIR)/.heads-toolchain
153
+ @echo "DEBUG: Triggering coreboot configuration for $(coreboot_dir)";
154
+ $(coreboot_module)_configure
155
+ @touch $@
167
156
168
157
# Create a dependency from coreboot to the toolchain. Use .heads-toolchain to
169
158
# mark that the toolchain was built.
170
- COREBOOT_TOOLCHAIN_DIR=$(build)/$($(coreboot_toolchain_module)_base_dir)
171
159
$(COREBOOT_TOOLCHAIN_DIR)/.heads-toolchain: $(COREBOOT_TOOLCHAIN_DIR)/.canary
172
- $(MAKE) -C "$(build)/$($(coreboot_toolchain_module)_base_dir)" CPUS=$(CPUS) "crossgcc-$(COREBOOT_TARGET)" \
160
+ @echo "DEBUG: Building coreboot toolchain in $(COREBOOT_TOOLCHAIN_DIR)";
161
+ $(MAKE) -C "$(COREBOOT_TOOLCHAIN_DIR)" CPUS=$(CPUS) "crossgcc-$(COREBOOT_TARGET)" \
173
162
$($(coreboot_toolchain_module)_toolchain_build_args)
174
- touch "$@"
163
+ @touch "$@"
164
+
165
+ # Ensure the toolchain module is included in the build process
166
+ modules-y += $(coreboot_toolchain_module)
175
167
176
168
$(build)/$(coreboot_dir)/.configured: $(COREBOOT_TOOLCHAIN_DIR)/.heads-toolchain
177
169
0 commit comments