2 ## This file is part of the coreboot project.
4 ## Copyright (C) 2011 secunet Security Networks AG
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; version 2 of the License.
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
16 GIT:=$(shell [ -e "$(top)/.git" ] && command -v git)
18 #######################################################################
19 # normalize Kconfig variables in a central place
20 CONFIG_CBFS_PREFIX:=$(call strip_quotes,$(CONFIG_CBFS_PREFIX))
21 CONFIG_FMDFILE:=$(call strip_quotes,$(CONFIG_FMDFILE))
23 #######################################################################
24 # misleadingly named, this is the coreboot version
25 export KERNELVERSION := $(strip $(if $(GIT),\
26 $(shell git describe --dirty --always || git describe),\
27 $(if $(wildcard $(top)/.coreboot-version),\
28 $(shell cat $(top)/.coreboot-version),\
29 coreboot-unknown$(KERNELREVISION))))
31 #######################################################################
32 # Basic component discovery
33 MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR))
36 ## Final build results, which CBFSTOOL uses to create the final
37 ## rom image file, are placed under $(objcbfs).
38 ## These typically have suffixes .debug .elf .bin and .map
39 export objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX)
41 ## Based on the active configuration, Makefile conditionally collects
42 ## the required assembly includes and saves them in a file.
43 ## Such files that do not have a clear one-to-one relation to a source
44 ## file under src/ are placed and built under $(objgenerated)
45 export objgenerated := $(obj)/generated
47 #######################################################################
48 # root rule to resolve if in build mode (ie. configuration exists)
49 real-target: $(obj)/config.h coreboot
50 coreboot: build-dirs $(obj)/coreboot.rom $(obj)/cbfstool $(obj)/rmodtool
52 #######################################################################
54 PHONY+= clean-abuild coreboot lint lint-stable build-dirs
56 #######################################################################
57 # root source directories of coreboot
58 subdirs-y := src/lib src/commonlib/ src/console src/device src/acpi
59 subdirs-y += src/ec/acpi $(wildcard src/ec/*/*) $(wildcard src/southbridge/*/*)
60 subdirs-y += $(wildcard src/soc/*/*) $(wildcard src/northbridge/*/*)
61 subdirs-y += src/superio $(wildcard src/drivers/*) src/cpu src/vendorcode
62 subdirs-y += util/cbfstool util/sconfig util/nvramtool util/broadcom
63 subdirs-y += $(wildcard src/arch/*)
64 subdirs-y += src/mainboard/$(MAINBOARDDIR)
65 subdirs-y += payloads/external
67 subdirs-y += site-local
69 #######################################################################
70 # Add source classes and their build options
71 classes-y := ramstage romstage bootblock smm smmstub cpu_microcode libverstage verstage
73 # Add dynamic classes for rmodules
74 $(foreach supported_arch,$(ARCH_SUPPORTED), \
75 $(eval $(call define_class,rmodules_$(supported_arch),$(supported_arch))))
76 # Provide a macro to determine environment for free standing rmodules.
77 $(foreach supported_arch,$(ARCH_SUPPORTED), \
78 $(eval rmodules_$(supported_arch)-generic-ccopts += -D__RMODULE__))
80 #######################################################################
81 # Helper functions for math and various file placement matters.
82 # macros work on all formats understood by printf(1)
83 # values are space separated if using more than one value
85 # int-add: adds an arbitrary length list of integers
86 # int-subtract: subtracts the the second of two integers from the first
87 # int-multiply: multiplies an arbitrary length list of integers
88 # int-divide: divides the first integer by the second
89 # int-remainder: arithmetic remainder of the first number divided by the second
90 # int-lt: 1 if the first value is less than the second. 0 otherwise
91 # int-gt: 1 if the first values is greater than the second. 0 otherwise
92 # int-eq: 1 if the two values are equal. 0 otherwise
93 # int-align: align $1 to $2 units
94 # file-size: returns the filesize of the given file
95 _toint=$(shell printf "%d" $1)
96 _int-add2=$(shell expr $(call _toint,$1) + $(call _toint,$2))
97 int-add=$(if $(filter 1,$(words $1)),$(strip $1),$(call int-add,$(call _int-add2,$(word 1,$1),$(word 2,$1)) $(wordlist 3,$(words $1),$1)))
98 int-subtract=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) - $(call _toint,$(word 2,$1))))
99 _int-multiply2=$(shell expr $(call _toint,$1) \* $(call _toint,$2))
100 int-multiply=$(if $(filter 1,$(words $1)),$(strip $1),$(call int-multiply,$(call _int-multiply2,$(word 1,$1),$(word 2,$1)) $(wordlist 3,$(words $1),$1)))
101 int-divide=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) / $(call _toint,$(word 2,$1))))
102 int-remainder=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) % $(call _toint,$(word 2,$1))))
103 int-lt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) \< $(call _toint,$(word 2,$1))))
104 int-gt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) \> $(call _toint,$(word 2,$1))))
105 int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))
106 int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) )
107 file-size=$(shell cat $1 | wc -c)
109 #######################################################################
110 # Helper functions for ramstage postprocess
117 # files-in-dir-recursive,dir,files
118 files-in-dir-recursive=$(filter $(1)%,$(2))
121 parent-dir=$(dir $(if $(patsubst /%,,$(1)),,/)$(subst $( ),/,$(strip $(subst /, ,$(1)))))
123 # filters out exactly the directory specified
124 # filter-out-dir,dir_to_keep,dirs
125 filter-out-dir=$(filter-out $(1),$(2))
127 # filters out dir_to_keep and all its parents
128 # filter-out-dirs,dir_to_keep,dirs
129 filter-out-dirs=$(if $(filter-out ./ /,$(1)),$(call filter-out-dirs,$(call parent-dir,$(1)),$(call filter-out-dir,$(1),$(2))),$(call filter-out-dir,$(1),$(2)))
132 dir-wildcards=$(addsuffix %,$(1))
134 # files-in-dir,dir,files
135 files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(sort $(dir $(2))))),$(call files-in-dir-recursive,$(1),$(2)))
137 #######################################################################
138 # reduce command line length by linking the objects of each
139 # directory into an intermediate file
140 ramstage-postprocess=$$(eval DEPENDENCIES+=$$(addsuffix .d,$$(basename $(1)))) \
141 $(foreach d,$(sort $(dir $(filter-out %.ld,$(1)))), \
142 $(eval $(d)ramstage.a: $(call files-in-dir,$(d),$(filter-out %.ld,$(1))); rm -f $$@ && $(AR_ramstage) rcsT $$@ $$^ ) \
143 $(eval ramstage-objs:=$(d)ramstage.a $(filter-out $(filter-out %.ld, $(call files-in-dir,$(d),$(1))),$(ramstage-objs))))
145 bootblock-generic-ccopts += -D__PRE_RAM__ -D__BOOTBLOCK__
146 romstage-generic-ccopts += -D__PRE_RAM__ -D__ROMSTAGE__
147 ramstage-generic-ccopts += -D__RAMSTAGE__
148 ifeq ($(CONFIG_TRACE),y)
149 ramstage-c-ccopts += -finstrument-functions
151 ifeq ($(CONFIG_COVERAGE),y)
152 ramstage-c-ccopts += -fprofile-arcs -ftest-coverage
155 # try to fetch non-optional submodules if the source is under git
156 forgetthis:=$(if $(GIT),$(shell git submodule update --init))
157 ifeq ($(CONFIG_USE_BLOBS),y)
158 # this is necessary because 3rdparty/blobs is update=none, and so is ignored
159 # unless explicitly requested and enabled through --checkout
160 forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs))
163 ramstage-c-deps:=$$(OPTION_TABLE_H)
164 romstage-c-deps:=$$(OPTION_TABLE_H)
165 libverstage-c-deps:=$$(OPTION_TABLE_H)
166 verstage-c-deps:=$$(OPTION_TABLE_H)
167 bootblock-c-deps:=$$(OPTION_TABLE_H)
169 # Add handler to copy linker scripts
170 define generic-objs_ld_template_gen
171 de$(EMPTY)fine $(1)-objs_ld_template
172 $$(call src-to-obj,$1,$$(1).ld): $$(1).ld $(obj)/config.h
173 @printf " CP $$$$(subst $$$$(obj)/,,$$$$(@))\n"
174 $$(CC_$(1)) -MMD $$(CPPFLAGS_$(1)) $$($(1)-ld-ccopts) $(PREPROCESS_ONLY) -include $(obj)/config.h -MT $$$$@ -o $$$$@ $$$$<
178 # Add handler to deal with archives
179 define generic-objs_a_template_gen
180 de$(EMPTY)fine $(1)-objs_a_template
181 $$(call src-to-obj,$1,$$(1).a): $$(1).a
182 @printf " AR $$$$(subst $$$$(obj)/,,$$$$(@))\n"
183 $$$$(AR_$(1)) rcsT $$$$@.tmp $$$$<
188 # Add handler to add no rules for manual files
189 define generic-objs_manual_template_gen
193 #######################################################################
194 # Add handler to compile ACPI's ASL
195 # arg1: base file name
196 # arg2: y or n for including in cbfs. defaults to y
198 $(CONFIG_CBFS_PREFIX)/$(1).aml-file = $(obj)/$(1).aml
199 $(CONFIG_CBFS_PREFIX)/$(1).aml-type = raw
200 $(CONFIG_CBFS_PREFIX)/$(1).aml-compression = none
201 cbfs-files-$(if $(2),$(2),y) += $(CONFIG_CBFS_PREFIX)/$(1).aml
202 -include $(obj)/$(1).d
203 $(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h
204 @printf " IASL $$(subst $(top)/,,$$(@))\n"
205 $(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) $$(CPPFLAGS_ramstage) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$@
206 ifeq ($(CONFIG_IASL_WARNINGS_ARE_ERRORS),y)
207 cd $$(dir $$@); $(IASL) -we -p $$(notdir $$@) $$(notdir $$@)
209 cd $$(dir $$@); $(IASL) -p $$(notdir $$@) $$(notdir $$@)
213 #######################################################################
214 # Parse plaintext cmos defaults into binary format
216 # arg2: binary file name
217 cbfs-files-processor-nvramtool= \
218 $(eval $(2): $(1) $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout | $(objutil)/nvramtool/nvramtool ; \
219 printf " CREATE $(2) (from $(1))\n"; \
220 $(objutil)/nvramtool/nvramtool -y $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout -D $(2).tmp -p $(1) && \
223 #######################################################################
224 # Link VSA binary to ELF-ish stage
226 # arg2: binary file name
227 cbfs-files-processor-vsa= \
228 $(eval $(2): $(1) ; \
229 printf " CREATE $(2) (from $(1))\n"; \
230 $(OBJCOPY_ramstage) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(1) $(2).tmp && \
231 $(LD_ramstage) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(2).tmp -o $(2))
233 #######################################################################
234 # Reduce a .config file to its minimal representation
237 cbfs-files-processor-defconfig= \
238 $(eval $(2): $(1) $(obj)/build.h; \
239 printf " CREATE $(2) (from $(1))\n"; \
240 printf "\# This image was built using coreboot " > $(2).tmp && \
241 grep "\<COREBOOT_VERSION\>" $(obj)/build.h |cut -d\" -f2 >> $(2).tmp && \
242 $(MAKE) DOTCONFIG=$(1) DEFCONFIG=$(2).tmp2 savedefconfig && \
243 cat $(2).tmp2 >> $(2).tmp && \
245 \mv -f $(2).tmp $(2))
247 #######################################################################
248 # Add handler for arbitrary files in CBFS
249 $(call add-special-class,cbfs-files)
250 cbfs-files-handler= \
251 $(eval tmp-cbfs-method:=$(word 2, $(subst :, ,$($(2)-file)))) \
252 $(eval $(2)-file:=$(call strip_quotes,$(word 1, $(subst :, ,$($(2)-file))))) \
253 $(eval tmp-cbfs-file:= ) \
255 $(if $(wildcard $(1)$($(2)-file)), \
256 $(eval tmp-cbfs-file:= $(wildcard $(1)$($(2)-file))), \
257 $(eval tmp-cbfs-file:= $($(2)-file)))) \
258 $(if $(strip $($(2)-required)), \
259 $(if $(wildcard $(tmp-cbfs-file)),, \
260 $(info This build configuration requires $($(2)-required)) \
261 $(eval FAILBUILD:=1) \
263 $(if $(strip $($(2)-align)), \
264 $(if $(strip $($(2)-position)), \
265 $(info ERROR: It is not allowed to specify both alignment and position for $($(2)-file)) \
266 $(eval FAILBUILD:=1) \
268 $(eval _cbfs-bucket:=regular ) \
269 $(if $(strip $($(2)-position)), \
270 $(eval _cbfs-bucket:=fixed)) \
271 $(if $(strip $($(2)-align)), \
272 $(eval _cbfs-bucket:=aligned)) \
273 $(if $(tmp-cbfs-method), \
274 $(eval tmp-old-cbfs-file:=$(tmp-cbfs-file)) \
275 $(eval tmp-cbfs-file:=$(shell mkdir -p $(obj)/mainboard/$(MAINBOARDDIR); mktemp $(obj)/mainboard/$(MAINBOARDDIR)/cbfs-file.XXXXXX).out) \
276 $(call cbfs-files-processor-$(tmp-cbfs-method),$(tmp-old-cbfs-file),$(tmp-cbfs-file))) \
277 $(if $(tmp-cbfs-file), \
278 $(eval cbfs-files-$(_cbfs-bucket) += $(subst $(spc),*,$(tmp-cbfs-file)|$(2)|$($(2)-type)|$($(2)-compression)|$(strip $($(2)-position))|$($(2)-align)|$($(2)-options)))) \
279 $(eval $(2)-name:=) \
280 $(eval $(2)-type:=) \
281 $(eval $(2)-compression:=) \
282 $(eval $(2)-position:=) \
283 $(eval $(2)-required:=) \
284 $(eval $(2)-options:=) \
287 #######################################################################
288 # a variety of flags for our build
289 CBFS_COMPRESS_FLAG:=none
290 ifeq ($(CONFIG_COMPRESS_RAMSTAGE),y)
291 CBFS_COMPRESS_FLAG:=LZMA
294 CBFS_PAYLOAD_COMPRESS_FLAG:=none
295 ifeq ($(CONFIG_COMPRESSED_PAYLOAD_LZMA),y)
296 CBFS_PAYLOAD_COMPRESS_FLAG:=LZMA
299 ifneq ($(CONFIG_LOCALVERSION),"")
300 export COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION))
303 CPPFLAGS_common := -Isrc -Isrc/include -Isrc/commonlib/include -I$(obj)
304 CPPFLAGS_common += -Isrc/device/oprom/include
305 VB_SOURCE ?= 3rdparty/vboot
306 CPPFLAGS_common += -I$(VB_SOURCE)/firmware/include
307 CPPFLAGS_common += -include $(src)/include/kconfig.h
308 CPPFLAGS_common += -I3rdparty
310 CFLAGS_common += -pipe -g -nostdinc
311 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
312 CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
313 CFLAGS_common += -Wstrict-aliasing -Wshadow
314 CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
315 CFLAGS_common += -ffunction-sections -fdata-sections
317 LDFLAGS_common := --gc-sections -nostdlib -nostartfiles -static --emit-relocs
319 ifeq ($(CONFIG_COMPILER_GCC),y)
320 # cf. commit f69a99db (coreboot: x86: enable gc-sections)
321 CFLAGS_common += -Wno-unused-but-set-variable
324 ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
325 CFLAGS_common += -Werror
327 ifneq ($(GDB_DEBUG),)
333 additional-dirs := $(objutil)/cbfstool $(objutil)/romcc $(objutil)/ifdtool \
334 $(objutil)/ifdfake $(objutil)/options $(objutil)/amdfwtool \
335 $(objutil)/cbootimage $(objutil)/bimgtool
337 #######################################################################
338 # generate build support files
339 $(obj)/build.h: .xcompile
340 @printf " GEN build.h\n"
342 util/genbuild_h/genbuild_h.sh > $(obj)/build.ht
343 mv $(obj)/build.ht $(obj)/build.h
346 mkdir -p $(objcbfs) $(objgenerated)
348 #######################################################################
350 CBFSTOOL:=$(objutil)/cbfstool/cbfstool
351 FMAPTOOL:=$(objutil)/cbfstool/fmaptool
352 RMODTOOL:=$(objutil)/cbfstool/rmodtool
354 $(obj)/cbfstool: $(CBFSTOOL)
357 $(obj)/fmaptool: $(FMAPTOOL)
360 $(obj)/rmodtool: $(RMODTOOL)
363 _WINCHECK=$(shell uname -o 2> /dev/null)
365 ifeq ($(_WINCHECK),Msys)
366 STACK=-Wl,--stack,16384000
368 ifeq ($(_WINCHECK),Cygwin)
369 STACK=-Wl,--stack,16384000
372 # this allows ccache to prepend itself
373 # (ccache handling happens first)
374 ROMCC_BIN= $(objutil)/romcc/romcc
376 $(ROMCC_BIN): $(top)/util/romcc/romcc.c
377 @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n"
378 @# Note: Adding -O2 here might cause problems. For details see:
379 @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html
380 $(HOSTCC) -g $(STACK) -Wall -o $@ $<
382 IFDTOOL:=$(objutil)/ifdtool/ifdtool
383 $(IFDTOOL): $(top)/util/ifdtool/ifdtool.c
384 @printf " HOSTCC $(subst $(obj)/,,$(@))\n"
385 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
387 IFDFAKE:=$(objutil)/ifdfake/ifdfake
388 $(IFDFAKE): $(top)/util/ifdfake/ifdfake.c
389 @printf " HOSTCC $(subst $(obj)/,,$(@))\n"
390 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
392 AMDFWTOOL:=$(objutil)/amdfwtool/amdfwtool
393 $(AMDFWTOOL): $(top)/util/amdfwtool/amdfwtool.c
394 @printf " HOSTCC $(subst $(obj)/,,$(@))\n"
395 $(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
397 CBOOTIMAGE:=$(objutil)/cbootimage/cbootimage
399 subdirs-y += util/nvidia
401 BIMGTOOL:=$(objutil)/bimgtool/bimgtool
402 $(BIMGTOOL): $(top)/util/bimgtool/bimgtool.c
403 @printf " HOSTCC $(subst $(obj)/,,$(@))\n"
404 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
406 #######################################################################
407 # needed objects that every mainboard uses
408 # Creation of these is architecture and mainboard independent
409 $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(objutil)/sconfig/sconfig
410 @printf " SCONFIG $(subst $(src)/,,$(<))\n"
411 mkdir -p $(obj)/mainboard/$(MAINBOARDDIR)
412 $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR)
414 ramstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c
415 romstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c
416 verstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c
418 $(objgenerated)/libverstage.a: $$(libverstage-objs)
420 $(AR_libverstage) rcsT $@ $^
422 #######################################################################
425 rm -rf coreboot-builds
427 clean-for-update-target:
428 rm -f $(obj)/ramstage?* $(obj)/coreboot.romstage $(obj)/coreboot.pre* $(obj)/coreboot.bootblock $(obj)/coreboot.a
429 rm -rf $(obj)/bootblock?* $(obj)/romstage?* $(obj)/location.*
430 rm -f $(obj)/option_table.* $(obj)/crt0.S $(obj)/ldscript
431 rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot
432 rm -f $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm
433 rm -f $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc
434 rm -f $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.* $(obj)/dsdt.*
435 rm -f $(obj)/cpu/x86/smm/smm_bin.c $(obj)/cpu/x86/smm/smm.* $(obj)/cpu/x86/smm/smm
436 $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean
439 rm -f $(obj)/coreboot*
441 #######################################################################
442 # Development utilities
445 @echo ldscripts=$(ldscripts)
448 dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF
456 for hook in commit-msg pre-commit ; do \
457 if [ util/gitconfig/$$hook -nt .git/hooks/$$hook -o \
458 ! -x .git/hooks/$$hook ]; then \
459 sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/$$hook > .git/hooks/$$hook; \
460 chmod +x .git/hooks/$$hook; \
463 # Now set up thehooks for 3rdparty/blobs
464 if [ -d .git/modules/3rdparty -a \
465 \( util/gitconfig/commit-msg -nt .git/modules/3rdparty/hooks/commit-msg -o \
466 ! -x .git/modules/3rdparty/hooks/commit-msg \) ]; then \
467 sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/commit-msg > .git/modules/3rdparty/hooks/commit-msg; \
468 chmod +x .git/modules/3rdparty/hooks/commit-msg; \
470 [ -d 3rdparty/blobs ] && cd 3rdparty/blobs && git config remote.origin.push HEAD:refs/for/master
471 git config remote.origin.push HEAD:refs/for/master
472 (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email@example.com\n'; exit 1)
474 help_toolchain help::
475 @echo '*** Toolchain targets ***'
476 @echo ' crossgcc - Build coreboot cross-compilers for all platforms'
477 @echo ' crosstools - Build coreboot cross-compiler and GDB for all platforms'
478 @echo ' crossgcc-clean - Remove all built coreboot cross-compilers'
479 @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)'
480 @echo ' clang - Build coreboot clang compiler'
481 @echo ' test-toolchain - Reports if toolchain components are out of date'
482 @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
483 @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture'
484 @echo ' ARCH can be "i386", "x64", "arm", "aarch64", "mips", "riscv", or "power8"'
485 @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores'
488 # For the toolchain builds, use CPUS=x to use multiple processors to build
489 # use BUILDGCC_OPTIONS= to set any crossgcc command line options
490 # Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build
491 crossgcc: clean-for-update
492 $(MAKE) -C util/crossgcc all_without_gdb SKIP_CLANG=1
494 .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \
495 crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
496 clang tools crosstools-i386 crosstools-x64 crosstools-arm \
497 crosstools-aarch64 crosstools-mips crosstools-riscv crosstools-power8
499 crossgcc-i386: clean-for-update
500 $(MAKE) -C util/crossgcc build-i386 SKIP_GDB=1
502 crossgcc-x64: clean-for-update
503 $(MAKE) -C util/crossgcc build-x64 SKIP_GDB=1
505 crossgcc-arm: clean-for-update
506 $(MAKE) -C util/crossgcc build-armv7a SKIP_GDB=1
508 crossgcc-aarch64: clean-for-update
509 $(MAKE) -C util/crossgcc build-aarch64 SKIP_GDB=1
511 crossgcc-mips: clean-for-update
512 $(MAKE) -C util/crossgcc build-mips SKIP_GDB=1
514 crossgcc-riscv: clean-for-update
515 $(MAKE) -C util/crossgcc build-riscv SKIP_GDB=1
517 crossgcc-power8: clean-for-update
518 $(MAKE) -C util/crossgcc build-power8 SKIP_GDB=1
520 crosstools: clean-for-update
521 $(MAKE) -C util/crossgcc all_with_gdb SKIP_CLANG=1
523 iasl: clean-for-update
524 $(MAKE) -C util/crossgcc build_iasl
526 clang: clean-for-update
527 $(MAKE) -C util/crossgcc build_clang
529 crosstools-i386: clean-for-update
530 $(MAKE) -C util/crossgcc build-i386
532 crosstools-x64: clean-for-update
533 $(MAKE) -C util/crossgcc build-x64
535 crosstools-arm: clean-for-update
536 $(MAKE) -C util/crossgcc build-armv7a
538 crosstools-aarch64: clean-for-update
539 $(MAKE) -C util/crossgcc build-aarch64
541 crosstools-mips: clean-for-update
542 $(MAKE) -C util/crossgcc build-mips
544 crosstools-riscv: clean-for-update
545 $(MAKE) -C util/crossgcc build-riscv
547 crosstools-power8: clean-for-update
548 $(MAKE) -C util/crossgcc build-power8
550 crossgcc-clean: clean-for-update
551 $(MAKE) -C util/crossgcc clean
553 tools: $(objutil)/kconfig/conf $(CBFSTOOL) $(FMAPTOOL) $(RMODTOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(IFDFAKE) $(CBOOTIMAGE) $(AMDFWTOOL)
556 ifeq ($(COMPILER_OUT_OF_DATE),1)
557 echo "The coreboot toolchain is not the current version."
560 echo "The coreboot toolchain is the current version."
561 endif # ifeq ($(COMPILER_OUT_OF_DATE),1)
563 ###########################################################################
564 # Common recipes for all stages
565 ###########################################################################
567 # loadaddr can determine the load address of a stage, which may be needed for
568 # platform-specific image headers (only works *after* the stage has been built)
569 loadaddr = $(shell $(OBJDUMP_$(1)) -p $(objcbfs)/$(1).debug | \
570 sed -ne '/LOAD/s/^.*vaddr 0x\([0-9a-fA-F]\{8\}\).*$$/0x\1/p')
572 # find-substr is required for stages like romstage_null and romstage_xip to
573 # eliminate the _* part of the string
574 find-substr = $(word 1,$(subst _, ,$(1)))
576 # find-class is used to identify the class from the name of the stage
577 # The input to this macro can be something like romstage.x or romstage.x.y
578 # find-class recursively strips off the suffixes to extract the exact class name
579 # e.g.: if romstage.x is provided to find-class, it will remove .x and return romstage
580 # if romstage.x.y is provided, it will first remove .y, call find-class with romstage.x
581 # and remove .x the next time and finally return romstage
582 find-class = $(if $(filter $(1),$(basename $(1))),$(if $(CC_$(1)), $(1), $(call find-substr,$(1))),$(call find-class,$(basename $(1))))
584 # Bootblocks are not CBFS stages. coreboot is currently expecting the bss to
585 # be cleared by the loader of the stage. For ARM SoCs that means one needs to
586 # include the bss section in the binary so the BootROM clears the bss on
587 # loading of the bootblock stage. Achieve this by marking the bss section
588 # loadable,allocatable, and data. Do the same for the .data section in case
589 # it's marked as NOBITS.
590 $(objcbfs)/bootblock.raw.bin: $(objcbfs)/bootblock.elf
591 @printf " OBJCOPY $(notdir $(@))\n"
592 $(OBJCOPY_bootblock) --set-section-flags .bss=load,alloc,data --set-section-flags .data=load,alloc,data $< $<.tmp
593 $(OBJCOPY_bootblock) -O binary $<.tmp $@
595 $(objcbfs)/%.bin: $(objcbfs)/%.raw.bin
598 $(objcbfs)/%.elf: $(objcbfs)/%.debug
599 $(eval class := $(call find-class,$(@F)))
600 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
602 $(NM_$(class)) -n $@.tmp | sort > $(basename $@).map
603 $(OBJCOPY_$(class)) --strip-debug $@.tmp
604 $(OBJCOPY_$(class)) --add-gnu-debuglink=$< $@.tmp
607 ###########################################################################
608 # Build the final rom image
609 ###########################################################################
611 # extract_nth - Return a subsection of the $file string
613 # the input string looks like this:
614 # ./build/cbfs/fallback/romstage.elf|fallback/romstage|stage|none||64|--xip*-S*.car.data*-P*0x10000
617 # 1 - Path and name of file [FILENAME: Added to cbfs-files-y list variable]
618 # 2 - Name of file in cbfs [$(FILENAME)-file]
619 # 3 - File type: [$(FILENAME)-type]
620 # bootblock, cbfs header, stage, payload, optionrom, bootsplash, raw, vsa,
621 # mbi, microcode, fsp, mrc, cmos_default, cmos_layout, spd, mrc_cache,
622 # mma, efi, deleted, null
623 # 4 - Compression type [$(FILENAME)-compression]
625 # 5 - Base address [$(FILANAME)-position]
626 # 6 - Alignment [$(FILENAME)-align]
627 # 7 - cbfstool flags [$(FILENAME)-options]
630 # $(1) = Section to extract
631 # $(2) = Input string
634 # 1) replace all '|' characters with the sequence '- -' within the full string, prepended and appended with the character '-'
635 # 2) extract the specified section from the string - this gets us the section surrounded by '-' characters
636 # 3) remove the leading and trailing '-' characters
637 # 4) replace all '*' characters with spaces
638 extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-))))
640 # regions-for-file - Returns a cbfstool regions parameter
641 # $(call regions-for-file,$(filename))
642 # returns "REGION1,REGION2,..."
644 # This is the default implementation. When using a boot strategy employing
645 # multiple CBFSes in fmap regions, override it.
646 regions-for-file ?= COREBOOT
649 # $(call options-for-region,$(filename),$(region),$(options))
651 # Returns potentially modified options, depending on file and region.
652 # Default is to return it unmodified
653 options-for-region ?= $(3)
655 ifeq ($(CONFIG_CBFS_AUTOGEN_ATTRIBUTES),y)
656 cbfs-autogen-attributes=-g
659 # cbfs-add-cmd-for-region
660 # $(call cbfs-add-cmd-for-region,file in extract_nth format,region name)
661 define cbfs-add-cmd-for-region
663 add$(if $(filter stage,$(call extract_nth,3,$(1))),-stage)$(if $(filter payload,$(call extract_nth,3,$(1))),-payload) \
664 -f $(call extract_nth,1,$(1)) \
665 -n $(call extract_nth,2,$(1)) \
666 $(if $(filter-out stage,$(call extract_nth,3,$(1))),-t $(call extract_nth,3,$(1))) \
667 $(if $(call extract_nth,4,$(1)),-c $(call extract_nth,4,$(1))) \
668 $(cbfs-autogen-attributes) \
670 $(call options-for-region,$(call extract_nth,2,$(1)),$(2), \
671 $(if $(call extract_nth,6,$(1)),-a $(call extract_nth,6,$(file)), \
672 $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file)))) \
673 $(call extract_nth,7,$(1)))
676 # Empty line before endef is necessary so cbfs-add-cmd-for-region ends in a
680 # $(call cbfs-add-cmd,file in extract_nth format,non-empty if file removal requested)
682 printf " CBFS $(call extract_nth,2,$(1))\n"
683 $(if $(2),-$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null)
684 $(eval _tmp-cbfs-add-cmd-regions=$(call regions-for-file,$(call extract_nth,2,$(1)))) \
685 $(foreach region,$(subst $(comma),$(spc),$(_tmp-cbfs-add-cmd-regions)), \
686 $(call cbfs-add-cmd-for-region,$(1),$(region)))
689 cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular)
690 prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
691 prebuild-files = $(foreach file,$(cbfs-files), $(call cbfs-add-cmd,$(file),$(CONFIG_UPDATE_IMAGE)))
693 ifneq ($(CONFIG_UPDATE_IMAGE),y)
694 ifeq ($(CONFIG_FMDFILE),)
695 # For a description of the flash layout described by these variables, check
696 # the $(DEFAULT_FLASHMAP) .fmd files.
697 ifeq ($(CONFIG_ARCH_X86),y)
698 DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default-x86.fmd
700 FMAP_ROM_ADDR := $(call int-subtract, 0x100000000 $(CONFIG_ROM_SIZE))
701 FMAP_ROM_SIZE := $(CONFIG_ROM_SIZE)
702 # entire "BIOS" region (everything directly of concern to the host system)
703 # relative to ROM_BASE
704 FMAP_BIOS_BASE := $(call int-subtract, $(CONFIG_ROM_SIZE) $(CONFIG_CBFS_SIZE))
705 FMAP_BIOS_SIZE := $(shell echo $(CONFIG_CBFS_SIZE) | tr A-F a-f)
706 # position and size of flashmap, relative to BIOS_BASE
708 FMAP_FMAP_SIZE := 0x100
709 # position and size of CBFS, relative to BIOS_BASE
710 FMAP_CBFS_BASE := $(FMAP_FMAP_SIZE)
711 FMAP_CBFS_SIZE := $(call int-subtract, $(FMAP_BIOS_SIZE) $(FMAP_FMAP_SIZE))
712 else # ifeq ($(CONFIG_ARCH_X86),y)
713 DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default.fmd
716 FMAP_ROM_SIZE := $(CONFIG_ROM_SIZE)
717 # entire "BIOS" region (everything directly of concern to the host system)
718 # relative to ROM_BASE
720 FMAP_BIOS_SIZE := $(CONFIG_CBFS_SIZE)
721 # position and size of flashmap, relative to BIOS_BASE
722 FMAP_FMAP_BASE := 0x20000
723 FMAP_FMAP_SIZE := 0x100
724 # position and size of CBFS, relative to BIOS_BASE
725 FMAP_CBFS_BASE := $(call int-add,$(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE))
726 FMAP_CBFS_SIZE := $(call int-subtract,$(FMAP_BIOS_SIZE) $(FMAP_CBFS_BASE))
727 endif # ifeq ($(CONFIG_ARCH_X86),y)
729 $(obj)/fmap.fmd: $(top)/Makefile.inc $(DEFAULT_FLASHMAP) $(obj)/config.h
730 sed -e "s,##ROM_BASE##,$(FMAP_ROM_ADDR)," \
731 -e "s,##ROM_SIZE##,$(FMAP_ROM_SIZE)," \
732 -e "s,##BIOS_BASE##,$(FMAP_BIOS_BASE)," \
733 -e "s,##BIOS_SIZE##,$(FMAP_BIOS_SIZE)," \
734 -e "s,##FMAP_BASE##,$(FMAP_FMAP_BASE)," \
735 -e "s,##FMAP_SIZE##,$(FMAP_FMAP_SIZE)," \
736 -e "s,##CBFS_BASE##,$(FMAP_CBFS_BASE)," \
737 -e "s,##CBFS_SIZE##,$(FMAP_CBFS_SIZE)," \
738 $(DEFAULT_FLASHMAP) > $@.tmp
740 else # ifeq ($(CONFIG_FMDFILE),)
741 $(obj)/fmap.fmd: $(CONFIG_FMDFILE) $(obj)/config.h
743 endif # ifeq ($(CONFIG_FMDFILE),)
745 # generated at the same time as fmap.fmap
746 $(obj)/fmap.h: $(obj)/fmap.fmap
747 $(obj)/fmap.desc: $(obj)/fmap.fmap
749 $(obj)/fmap.fmap: $(obj)/fmap.fmd $(FMAPTOOL)
750 echo " FMAP $(FMAPTOOL) -h $(obj)/fmap.h $< $@"
751 $(FMAPTOOL) -h $(obj)/fmap.h -R $(obj)/fmap.desc $< $@
753 $(obj)/coreboot.pre: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(CBFSTOOL) $$(cpu_ucode_cbfs_file) $(obj)/fmap.fmap $(obj)/fmap.desc
754 $(CBFSTOOL) $@.tmp create -M $(obj)/fmap.fmap -r $(shell cat $(obj)/fmap.desc)
755 ifeq ($(CONFIG_ARCH_X86),y)
756 $(CBFSTOOL) $@.tmp add \
757 -f $(objcbfs)/bootblock.bin \
760 -b -$(call file-size,$(objcbfs)/bootblock.bin) $(cbfs-autogen-attributes)
761 else # ifeq ($(CONFIG_ARCH_X86),y)
762 # don't add bootblock to cbfs yet, it's just a waste of space
763 true $(CBFSTOOL) $@.tmp add \
764 -f $(objcbfs)/bootblock.bin \
768 $(CBFSTOOL) $@.tmp write -u \
770 -f $(objcbfs)/bootblock.bin
771 # make space for the CBFS master header pointer. "ptr_" is just
772 # arbitrary 4 bytes that will be overwritten by add-master-header.
773 printf "ptr_" > $@.tmp.2
774 $(CBFSTOOL) $@.tmp add \
776 -n "header pointer" \
780 endif # ifeq ($(CONFIG_ARCH_X86),y)
781 $(CBFSTOOL) $@.tmp add-master-header
782 $(prebuild-files) true
784 else # ifneq ($(CONFIG_UPDATE_IMAGE),y)
785 .PHONY: $(obj)/coreboot.pre
786 $(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL)
787 mv $(obj)/coreboot.rom $@.tmp || \
788 (echo "Error: You have UPDATE_IMAGE set in Kconfig, but have no existing image to update." && \
791 $(prebuild-files) true
793 endif # ifneq ($(CONFIG_UPDATE_IMAGE),y)
795 ifeq ($(CONFIG_PAYLOAD_LINUX),y)
796 ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_COMMAND_LINE))),)
797 ADDITIONAL_PAYLOAD_CONFIG+=-C $(CONFIG_LINUX_COMMAND_LINE)
799 ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_INITRD))),)
800 ADDITIONAL_PAYLOAD_CONFIG+=-I $(CONFIG_LINUX_INITRD)
804 ifeq ($(CONFIG_HAVE_REFCODE_BLOB),y)
805 REFCODE_BLOB=$(obj)/refcode.rmod
806 $(REFCODE_BLOB): $(RMODTOOL)
807 $(RMODTOOL) -i $(CONFIG_REFCODE_BLOB_FILE) -o $@
810 $(obj)/coreboot.rom: $(obj)/coreboot.pre $(objcbfs)/ramstage.elf $(CBFSTOOL) $$(INTERMEDIATE)
811 @printf " CBFS $(subst $(obj)/,,$(@))\n"
812 # The full ROM may be larger than the CBFS part, so create an empty
813 # file (filled with \377 = 0xff) and copy the CBFS image over it.
814 dd if=/dev/zero bs=$(call _toint,$(CONFIG_ROM_SIZE)) count=1 2> /dev/null | tr '\000' '\377' > $@.tmp
815 dd if=$(obj)/coreboot.pre of=$@.tmp bs=8192 conv=notrunc 2> /dev/null
816 ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),)
817 ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),0)
818 @printf " SeaBIOS Wait up to $(CONFIG_SEABIOS_PS2_TIMEOUT) ms for PS/2 keyboard controller initialization\n"
819 $(CBFSTOOL) $@.tmp add-int -i $(CONFIG_SEABIOS_PS2_TIMEOUT) -n etc/ps2-keyboard-spinup
822 ifeq ($(CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE),y)
823 ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE),y)
824 @printf " UPDATE-FIT \n"
825 $(CBFSTOOL) $@.tmp update-fit -n cpu_microcode_blob.bin -x $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES)
829 @printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n"
831 ifeq ($(CONFIG_IASL_WARNINGS_ARE_ERRORS),)
832 @printf "\n***** WARNING: IASL warnings as errors is disabled! *****\n"
833 @printf "***** Please fix the ASL for this platform. *****\n\n"
836 cbfs-files-y += $(CONFIG_CBFS_PREFIX)/romstage
837 $(CONFIG_CBFS_PREFIX)/romstage-file := $(objcbfs)/romstage.elf
838 $(CONFIG_CBFS_PREFIX)/romstage-type := stage
839 $(CONFIG_CBFS_PREFIX)/romstage-compression := none
840 ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM),y)
841 $(CONFIG_CBFS_PREFIX)/romstage-options := -b 0
843 ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
844 # Use a 64 byte alignment to provide a minimum alignment
845 # requirement for the overall romstage. While the first object within
846 # romstage could have a 4 byte minimum alignment that doesn't mean the linker
847 # won't decide the entire section should be aligned to a larger value. In the
848 # future cbfstool should add XIP files proper and honor the alignment
849 # requirements of the program segment.
851 # Make sure that segment for .car.data is ignored while adding romstage.
852 $(CONFIG_CBFS_PREFIX)/romstage-align := 64
853 $(CONFIG_CBFS_PREFIX)/romstage-options := --xip -S .car.data -P $(CONFIG_XIP_ROM_SIZE)
856 cbfs-files-y += $(CONFIG_CBFS_PREFIX)/ramstage
857 $(CONFIG_CBFS_PREFIX)/ramstage-file := $(objcbfs)/ramstage.elf
858 $(CONFIG_CBFS_PREFIX)/ramstage-type := stage
859 $(CONFIG_CBFS_PREFIX)/ramstage-compression := $(CBFS_COMPRESS_FLAG)
861 cbfs-files-y += $(CONFIG_CBFS_PREFIX)/payload
862 $(CONFIG_CBFS_PREFIX)/payload-file := $(CONFIG_PAYLOAD_FILE)
863 $(CONFIG_CBFS_PREFIX)/payload-type := payload
864 $(CONFIG_CBFS_PREFIX)/payload-compression := $(CBFS_PAYLOAD_COMPRESS_FLAG)
865 $(CONFIG_CBFS_PREFIX)/payload-options := $(ADDITIONAL_PAYLOAD_CONFIG)
867 cbfs-files-$(CONFIG_HAVE_REFCODE_BLOB) += $(CONFIG_CBFS_PREFIX)/refcode
868 $(CONFIG_CBFS_PREFIX)/refcode-file := $(REFCODE_BLOB)
869 $(CONFIG_CBFS_PREFIX)/refcode-type := stage
870 $(CONFIG_CBFS_PREFIX)/refcode-compression := $(CBFS_COMPRESS_FLAG)
872 cbfs-files-$(CONFIG_SEABIOS_VGA_COREBOOT) += vgaroms/seavgabios.bin
873 vgaroms/seavgabios.bin-file := $(CONFIG_PAYLOAD_VGABIOS_FILE)
874 vgaroms/seavgabios.bin-type := raw
876 cbfs-files-$(CONFIG_PXE_ROM) += pci$(CONFIG_PXE_ROM_ID).rom
877 pci$(CONFIG_PXE_ROM_ID).rom-file := $(CONFIG_PXE_ROM_FILE)
878 pci$(CONFIG_PXE_ROM_ID).rom-type := raw
880 cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += config
881 config-file := $(DOTCONFIG):defconfig
884 cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += revision
885 revision-file := $(obj)/build.h
888 cbfs-files-$(CONFIG_BOOTSPLASH_IMAGE) += bootsplash.jpg
889 bootsplash.jpg-file := $(call strip_quotes,$(CONFIG_BOOTSPLASH_FILE))
890 bootsplash.jpg-type := bootsplash
892 cbfs-files-$(CONFIG_BOARD_ID_MANUAL) += board_id
893 board_id-file := $(obj)/board_id
897 printf $(CONFIG_BOARD_ID_STRING) > $@
900 echo "Building $(UTIL)"
901 echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp
902 echo "<testcase classname='$(UTIL)' name='$(UTIL)'>" >> $@.tmp
903 -$(MAKE) -j $(CPUS) -C "util/$(UTIL)" clean distclean > $@.tmp.2 2>&1
904 $(MAKE) -j $(CPUS) -C "util/$(UTIL)" >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \
906 if [ "$$type" = "failure" ]; then \
907 echo "<failure type='buildFailed'>" >> $@.tmp; \
908 echo "Building $(UTIL) Failed"; \
910 echo "<$$type>" >> $@.tmp; \
911 echo "Building $(UTIL) Succeeded"; \
913 echo '<![CDATA[' >> $@.tmp; \
914 cat $@.tmp.2 >> $@.tmp; \
915 echo "]]></$$type>" >>$@.tmp
917 echo "</testcase>" >> $@.tmp
918 echo "</testsuite>" >> $@.tmp
919 mv $@.tmp "util/$(UTIL)/$@"
930 JENKINS_PAYLOAD?=none
933 util/lint/lint lint-stable --junit
934 util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml
935 util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD)
936 (cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml)
937 $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) UTIL="$(tool)" MFLAGS= MAKEFLAGS= junit.xml; )