Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## Copyright (C) 2011 secunet Security Networks AG |
| 5 | ## |
| 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. |
| 9 | ## |
| 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. |
| 14 | ## |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 15 | |
Patrick Georgi | c0e394b | 2015-03-04 15:02:03 +0100 | [diff] [blame] | 16 | GIT:=$(shell [ -d "$(top)/.git" ] && command -v git) |
| 17 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 18 | ####################################################################### |
Patrick Georgi | 6dc8570 | 2015-11-30 22:44:53 +0100 | [diff] [blame] | 19 | # normalize Kconfig variables in a central place |
| 20 | CONFIG_CBFS_PREFIX:=$(call strip_quotes,$(CONFIG_CBFS_PREFIX)) |
Patrick Georgi | 8a3592e | 2015-09-16 18:10:52 +0200 | [diff] [blame] | 21 | CONFIG_FMDFILE:=$(call strip_quotes,$(CONFIG_FMDFILE)) |
Patrick Georgi | 6dc8570 | 2015-11-30 22:44:53 +0100 | [diff] [blame] | 22 | |
| 23 | ####################################################################### |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 24 | # misleadingly named, this is the coreboot version |
Patrick Georgi | c0e394b | 2015-03-04 15:02:03 +0100 | [diff] [blame] | 25 | export KERNELVERSION := $(strip $(if $(GIT),\ |
| 26 | $(shell git describe --dirty --always || git describe),\ |
Patrick Georgi | 492a075 | 2015-07-13 20:43:28 +0200 | [diff] [blame] | 27 | $(if $(wildcard $(top)/.coreboot-version),\ |
| 28 | $(shell cat $(top)/.coreboot-version),\ |
| 29 | coreboot-unknown$(KERNELREVISION)))) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 30 | |
| 31 | ####################################################################### |
| 32 | # Basic component discovery |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 33 | MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR)) |
| 34 | export MAINBOARDDIR |
| 35 | |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 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 |
Patrick Georgi | 6dc8570 | 2015-11-30 22:44:53 +0100 | [diff] [blame] | 39 | export objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX) |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 40 | |
| 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 |
| 46 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 47 | ####################################################################### |
| 48 | # root rule to resolve if in build mode (ie. configuration exists) |
| 49 | real-target: $(obj)/config.h coreboot |
Patrick Georgi | 533c119 | 2014-07-10 09:42:03 +0200 | [diff] [blame] | 50 | coreboot: build-dirs $(obj)/coreboot.rom $(obj)/cbfstool $(obj)/rmodtool |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 51 | |
| 52 | ####################################################################### |
| 53 | # our phony targets |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 54 | PHONY+= clean-abuild coreboot lint lint-stable build-dirs |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 55 | |
| 56 | ####################################################################### |
| 57 | # root source directories of coreboot |
Aaron Durbin | dc9f5cd | 2015-09-08 13:34:43 -0500 | [diff] [blame] | 58 | subdirs-y := src/lib src/commonlib/ src/console src/device src/acpi |
Stefan Reinauer | 77c04e9 | 2015-04-27 14:03:47 -0700 | [diff] [blame] | 59 | subdirs-y += src/ec/acpi $(wildcard src/ec/*/*) $(wildcard src/southbridge/*/*) |
Stefan Reinauer | e1133b7 | 2015-04-27 14:04:38 -0700 | [diff] [blame] | 60 | subdirs-y += $(wildcard src/soc/*/*) $(wildcard src/northbridge/*/*) |
Stefan Reinauer | 1d7b9de | 2015-04-19 12:48:25 -0700 | [diff] [blame] | 61 | subdirs-y += src/superio $(wildcard src/drivers/*) src/cpu src/vendorcode |
Daisuke Nojiri | e1741c5 | 2015-02-09 18:15:17 -0800 | [diff] [blame] | 62 | subdirs-y += util/cbfstool util/sconfig util/nvramtool util/broadcom |
Stefan Reinauer | 13e4182 | 2015-04-27 14:02:36 -0700 | [diff] [blame] | 63 | subdirs-y += $(wildcard src/arch/*) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 64 | subdirs-y += src/mainboard/$(MAINBOARDDIR) |
Stefan Reinauer | 0fa5d8f | 2015-06-30 17:09:17 -0700 | [diff] [blame] | 65 | subdirs-y += payloads/external |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 66 | |
Patrick Georgi | a25828d | 2011-09-02 09:57:01 +0200 | [diff] [blame] | 67 | subdirs-y += site-local |
| 68 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 69 | ####################################################################### |
| 70 | # Add source classes and their build options |
Aaron Durbin | 8c8e2b7 | 2015-10-14 10:08:10 -0500 | [diff] [blame] | 71 | classes-y := ramstage romstage bootblock smm smmstub cpu_microcode libverstage verstage |
Furquan Shaikh | 133096b | 2014-07-31 09:28:55 -0700 | [diff] [blame] | 72 | |
| 73 | # Add dynamic classes for rmodules |
| 74 | $(foreach supported_arch,$(ARCH_SUPPORTED), \ |
| 75 | $(eval $(call define_class,rmodules_$(supported_arch),$(supported_arch)))) |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 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__)) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 79 | |
Patrick Georgi | f33e395 | 2012-11-25 17:10:47 +0100 | [diff] [blame] | 80 | ####################################################################### |
Martin Roth | 47abc54 | 2015-07-03 12:54:14 -0600 | [diff] [blame] | 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 |
Patrick Georgi | 3eefeea | 2014-11-12 19:11:50 +0100 | [diff] [blame] | 84 | # |
Martin Roth | 47abc54 | 2015-07-03 12:54:14 -0600 | [diff] [blame] | 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 |
Patrick Georgi | 3eefeea | 2014-11-12 19:11:50 +0100 | [diff] [blame] | 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))) |
Martin Roth | 47abc54 | 2015-07-03 12:54:14 -0600 | [diff] [blame] | 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)))) |
Patrick Georgi | a234f45 | 2014-12-03 11:20:51 +0100 | [diff] [blame] | 106 | int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) ) |
Patrick Georgi | 3eefeea | 2014-11-12 19:11:50 +0100 | [diff] [blame] | 107 | file-size=$(shell cat $1 | wc -c) |
| 108 | |
| 109 | ####################################################################### |
Patrick Georgi | f33e395 | 2012-11-25 17:10:47 +0100 | [diff] [blame] | 110 | # Helper functions for ramstage postprocess |
| 111 | spc := |
| 112 | spc += |
| 113 | $(spc) := |
| 114 | $(spc) += |
| 115 | |
| 116 | # files-in-dir-recursive,dir,files |
| 117 | files-in-dir-recursive=$(filter $(1)%,$(2)) |
| 118 | |
| 119 | # parent-dir,dir/ |
Patrick Georgi | 1f94670 | 2014-05-21 22:36:13 +0200 | [diff] [blame] | 120 | parent-dir=$(dir $(if $(patsubst /%,,$(1)),,/)$(subst $( ),/,$(strip $(subst /, ,$(1))))) |
Patrick Georgi | f33e395 | 2012-11-25 17:10:47 +0100 | [diff] [blame] | 121 | |
| 122 | # filters out exactly the directory specified |
| 123 | # filter-out-dir,dir_to_keep,dirs |
| 124 | filter-out-dir=$(filter-out $(1),$(2)) |
| 125 | |
| 126 | # filters out dir_to_keep and all its parents |
| 127 | # filter-out-dirs,dir_to_keep,dirs |
Patrick Georgi | 1f94670 | 2014-05-21 22:36:13 +0200 | [diff] [blame] | 128 | 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))) |
Patrick Georgi | f33e395 | 2012-11-25 17:10:47 +0100 | [diff] [blame] | 129 | |
| 130 | # dir-wildcards,dirs |
| 131 | dir-wildcards=$(addsuffix %,$(1)) |
| 132 | |
| 133 | # files-in-dir,dir,files |
Patrick Georgi | 1f94670 | 2014-05-21 22:36:13 +0200 | [diff] [blame] | 134 | files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(sort $(dir $(2))))),$(call files-in-dir-recursive,$(1),$(2))) |
Patrick Georgi | f33e395 | 2012-11-25 17:10:47 +0100 | [diff] [blame] | 135 | |
| 136 | ####################################################################### |
| 137 | # reduce command line length by linking the objects of each |
| 138 | # directory into an intermediate file |
Julius Werner | f97b88b | 2014-12-05 12:32:09 -0800 | [diff] [blame] | 139 | ramstage-postprocess=$$(eval DEPENDENCIES+=$$(addsuffix .d,$$(basename $(1)))) \ |
| 140 | $(foreach d,$(sort $(dir $(filter-out %.ld,$(1)))), \ |
Patrick Georgi | eec8dfb | 2015-05-07 22:24:41 +0200 | [diff] [blame] | 141 | $(eval $(d)ramstage.a: $(call files-in-dir,$(d),$(filter-out %.ld,$(1))); rm -f $$@ && $(AR_ramstage) rcsT $$@ $$^ ) \ |
| 142 | $(eval ramstage-objs:=$(d)ramstage.a $(filter-out $(filter-out %.ld, $(call files-in-dir,$(d),$(1))),$(ramstage-objs)))) |
Patrick Georgi | f33e395 | 2012-11-25 17:10:47 +0100 | [diff] [blame] | 143 | |
Julius Werner | 015f0ae | 2014-09-15 22:10:33 -0700 | [diff] [blame] | 144 | bootblock-generic-ccopts += -D__PRE_RAM__ -D__BOOTBLOCK__ |
| 145 | romstage-generic-ccopts += -D__PRE_RAM__ -D__ROMSTAGE__ |
| 146 | ramstage-generic-ccopts += -D__RAMSTAGE__ |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 147 | ifeq ($(CONFIG_TRACE),y) |
Julius Werner | 015f0ae | 2014-09-15 22:10:33 -0700 | [diff] [blame] | 148 | ramstage-c-ccopts += -finstrument-functions |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 149 | endif |
Stefan Reinauer | d37ab45 | 2012-12-18 16:23:28 -0800 | [diff] [blame] | 150 | ifeq ($(CONFIG_COVERAGE),y) |
Julius Werner | 015f0ae | 2014-09-15 22:10:33 -0700 | [diff] [blame] | 151 | ramstage-c-ccopts += -fprofile-arcs -ftest-coverage |
Stefan Reinauer | d37ab45 | 2012-12-18 16:23:28 -0800 | [diff] [blame] | 152 | endif |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 153 | |
Martin Roth | 90105d5 | 2015-02-12 19:34:11 -0700 | [diff] [blame] | 154 | # try to fetch non-optional submodules if the source is under git |
Patrick Georgi | c0e394b | 2015-03-04 15:02:03 +0100 | [diff] [blame] | 155 | forgetthis:=$(if $(GIT),$(shell git submodule update --init)) |
Patrick Georgi | 7e9b9d8 | 2012-04-30 21:06:10 +0200 | [diff] [blame] | 156 | ifeq ($(CONFIG_USE_BLOBS),y) |
Patrick Georgi | 26e24cc | 2015-05-05 22:27:25 +0200 | [diff] [blame] | 157 | # this is necessary because 3rdparty/blobs is update=none, and so is ignored |
Patrick Georgi | 8888316 | 2014-10-29 15:50:32 +0100 | [diff] [blame] | 158 | # unless explicitly requested and enabled through --checkout |
Patrick Georgi | 26e24cc | 2015-05-05 22:27:25 +0200 | [diff] [blame] | 159 | forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs)) |
Patrick Georgi | 7e9b9d8 | 2012-04-30 21:06:10 +0200 | [diff] [blame] | 160 | endif |
| 161 | |
Patrick Georgi | 57205c7 | 2011-03-08 20:49:18 +0000 | [diff] [blame] | 162 | ramstage-c-deps:=$$(OPTION_TABLE_H) |
| 163 | romstage-c-deps:=$$(OPTION_TABLE_H) |
Patrick Georgi | 27ef602 | 2015-04-30 14:25:14 +0200 | [diff] [blame] | 164 | libverstage-c-deps:=$$(OPTION_TABLE_H) |
Stefan Reinauer | 77b1655 | 2015-01-14 19:51:47 +0100 | [diff] [blame] | 165 | verstage-c-deps:=$$(OPTION_TABLE_H) |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 166 | bootblock-c-deps:=$$(OPTION_TABLE_H) |
Patrick Georgi | 57205c7 | 2011-03-08 20:49:18 +0000 | [diff] [blame] | 167 | |
Patrick Georgi | 990e7c9 | 2015-04-03 10:47:15 +0200 | [diff] [blame] | 168 | # Add handler to copy linker scripts |
| 169 | define generic-objs_ld_template_gen |
| 170 | de$(EMPTY)fine $(1)-objs_ld_template |
Patrick Georgi | 828e0e8 | 2015-04-04 15:50:20 +0200 | [diff] [blame] | 171 | $$(call src-to-obj,$1,$$(1).ld): $$(1).ld $(obj)/config.h |
Patrick Georgi | 990e7c9 | 2015-04-03 10:47:15 +0200 | [diff] [blame] | 172 | @printf " CP $$$$(subst $$$$(obj)/,,$$$$(@))\n" |
Julius Werner | c19f876 | 2015-09-29 16:41:11 -0700 | [diff] [blame] | 173 | $$(CC_$(1)) -MMD $$(CPPFLAGS_$(1)) $$($(1)-ld-ccopts) $(PREPROCESS_ONLY) -include $(obj)/config.h -MT $$$$@ -o $$$$@ $$$$< |
Patrick Georgi | 990e7c9 | 2015-04-03 10:47:15 +0200 | [diff] [blame] | 174 | en$(EMPTY)def |
| 175 | endef |
| 176 | |
Patrick Georgi | ef345c2 | 2015-04-27 18:01:12 +0200 | [diff] [blame] | 177 | # Add handler to deal with archives |
| 178 | define generic-objs_a_template_gen |
| 179 | de$(EMPTY)fine $(1)-objs_a_template |
| 180 | $$(call src-to-obj,$1,$$(1).a): $$(1).a |
| 181 | @printf " CP $$$$(subst $$$$(obj)/,,$$$$(@))\n" |
| 182 | cp $$$$< $$$$@.tmp |
| 183 | mv $$$$@.tmp $$$$@ |
| 184 | en$(EMPTY)def |
| 185 | endef |
| 186 | |
Patrick Georgi | f430546 | 2015-04-03 10:39:05 +0200 | [diff] [blame] | 187 | # Add handler to add no rules for manual files |
| 188 | define generic-objs_manual_template_gen |
| 189 | # do nothing |
| 190 | endef |
| 191 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 192 | ####################################################################### |
| 193 | # Add handler to compile ACPI's ASL |
Aaron Durbin | ab454c6 | 2015-07-30 12:44:58 -0500 | [diff] [blame] | 194 | # arg1: base file name |
| 195 | # arg2: y or n for including in cbfs. defaults to y |
Vladimir Serbinenko | 36f8d27 | 2015-05-31 12:31:59 +0200 | [diff] [blame] | 196 | define asl_template |
Patrick Georgi | 6dc8570 | 2015-11-30 22:44:53 +0100 | [diff] [blame] | 197 | $(CONFIG_CBFS_PREFIX)/$(1).aml-file = $(obj)/$(1).aml |
| 198 | $(CONFIG_CBFS_PREFIX)/$(1).aml-type = raw |
| 199 | $(CONFIG_CBFS_PREFIX)/$(1).aml-compression = none |
| 200 | cbfs-files-$(if $(2),$(2),y) += $(CONFIG_CBFS_PREFIX)/$(1).aml |
Martin Roth | 92898b4 | 2015-12-09 13:05:00 -0700 | [diff] [blame] | 201 | -include $(obj)/$(1).d |
Vladimir Serbinenko | 36f8d27 | 2015-05-31 12:31:59 +0200 | [diff] [blame] | 202 | $(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 203 | @printf " IASL $$(subst $(top)/,,$$(@))\n" |
Patrick Georgi | 26de112 | 2015-04-07 17:40:42 +0200 | [diff] [blame] | 204 | $(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 $$@ |
Martin Roth | 77c67b3 | 2015-06-25 09:36:27 -0600 | [diff] [blame] | 205 | ifeq ($(CONFIG_IASL_WARNINGS_ARE_ERRORS),y) |
| 206 | cd $$(dir $$@); $(IASL) -we -p $$(notdir $$@) $$(notdir $$@) |
| 207 | else |
Vladimir Serbinenko | 36f8d27 | 2015-05-31 12:31:59 +0200 | [diff] [blame] | 208 | cd $$(dir $$@); $(IASL) -p $$(notdir $$@) $$(notdir $$@) |
Martin Roth | 77c67b3 | 2015-06-25 09:36:27 -0600 | [diff] [blame] | 209 | endif |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 210 | endef |
| 211 | |
| 212 | ####################################################################### |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 213 | # Parse plaintext cmos defaults into binary format |
| 214 | # arg1: source file |
| 215 | # arg2: binary file name |
| 216 | cbfs-files-processor-nvramtool= \ |
| 217 | $(eval $(2): $(1) $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout | $(objutil)/nvramtool/nvramtool ; \ |
Patrick Georgi | 10420cc | 2015-11-25 19:17:42 +0100 | [diff] [blame] | 218 | printf " CREATE $(2) (from $(1))\n"; \ |
| 219 | $(objutil)/nvramtool/nvramtool -y $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout -D $(2).tmp -p $(1) && \ |
| 220 | mv $(2).tmp $(2)) |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 221 | |
| 222 | ####################################################################### |
Patrick Georgi | 843005c | 2012-04-30 23:15:17 +0200 | [diff] [blame] | 223 | # Link VSA binary to ELF-ish stage |
| 224 | # arg1: source file |
| 225 | # arg2: binary file name |
| 226 | cbfs-files-processor-vsa= \ |
| 227 | $(eval $(2): $(1) ; \ |
Patrick Georgi | 10420cc | 2015-11-25 19:17:42 +0100 | [diff] [blame] | 228 | printf " CREATE $(2) (from $(1))\n"; \ |
| 229 | $(OBJCOPY_ramstage) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(1) $(2).tmp && \ |
| 230 | $(LD_ramstage) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(2).tmp -o $(2)) |
Patrick Georgi | 843005c | 2012-04-30 23:15:17 +0200 | [diff] [blame] | 231 | |
| 232 | ####################################################################### |
Patrick Georgi | 551b383 | 2015-11-25 18:47:56 +0100 | [diff] [blame] | 233 | # Reduce a .config file to its minimal representation |
| 234 | # arg1: input |
| 235 | # arg2: output |
| 236 | cbfs-files-processor-defconfig= \ |
Patrick Georgi | a91402f | 2015-11-27 12:36:28 +0100 | [diff] [blame] | 237 | $(eval $(2): $(1) $(obj)/build.h; \ |
Patrick Georgi | 551b383 | 2015-11-25 18:47:56 +0100 | [diff] [blame] | 238 | printf " CREATE $(2) (from $(1))\n"; \ |
Patrick Georgi | a91402f | 2015-11-27 12:36:28 +0100 | [diff] [blame] | 239 | printf "\# This image was built using coreboot " > $(2).tmp && \ |
| 240 | grep "\<COREBOOT_VERSION\>" $(obj)/build.h |cut -d\" -f2 >> $(2).tmp && \ |
| 241 | $(MAKE) DOTCONFIG=$(1) DEFCONFIG=$(2).tmp2 savedefconfig && \ |
| 242 | cat $(2).tmp2 >> $(2).tmp && \ |
| 243 | rm -f $(2).tmp2 && \ |
Patrick Georgi | 551b383 | 2015-11-25 18:47:56 +0100 | [diff] [blame] | 244 | \mv -f $(2).tmp $(2)) |
| 245 | |
| 246 | ####################################################################### |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 247 | # Add handler for arbitrary files in CBFS |
| 248 | $(call add-special-class,cbfs-files) |
| 249 | cbfs-files-handler= \ |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 250 | $(eval tmp-cbfs-method:=$(word 2, $(subst :, ,$($(2)-file)))) \ |
Patrick Georgi | 1fc2bda | 2012-11-15 14:51:54 +0100 | [diff] [blame] | 251 | $(eval $(2)-file:=$(call strip_quotes,$(word 1, $(subst :, ,$($(2)-file))))) \ |
Patrick Georgi | 1eee076 | 2015-11-25 18:59:54 +0100 | [diff] [blame] | 252 | $(eval tmp-cbfs-file:= ) \ |
| 253 | $(if $($(2)-file), \ |
| 254 | $(if $(wildcard $(1)$($(2)-file)), \ |
| 255 | $(eval tmp-cbfs-file:= $(wildcard $(1)$($(2)-file))), \ |
| 256 | $(eval tmp-cbfs-file:= $($(2)-file)))) \ |
Patrick Georgi | 70c85ea | 2013-02-16 01:06:57 +0100 | [diff] [blame] | 257 | $(if $(strip $($(2)-required)), \ |
| 258 | $(if $(wildcard $(tmp-cbfs-file)),, \ |
| 259 | $(info This build configuration requires $($(2)-required)) \ |
| 260 | $(eval FAILBUILD:=1) \ |
| 261 | )) \ |
Patrick Georgi | 5839635 | 2014-12-09 12:49:21 +0100 | [diff] [blame] | 262 | $(if $(strip $($(2)-align)), \ |
| 263 | $(if $(strip $($(2)-position)), \ |
| 264 | $(info ERROR: It is not allowed to specify both alignment and position for $($(2)-file)) \ |
| 265 | $(eval FAILBUILD:=1) \ |
| 266 | )) \ |
Patrick Georgi | 9b5b536 | 2015-11-25 17:04:17 +0100 | [diff] [blame] | 267 | $(eval _cbfs-bucket:=regular ) \ |
| 268 | $(if $(strip $($(2)-position)), \ |
| 269 | $(eval _cbfs-bucket:=fixed)) \ |
| 270 | $(if $(strip $($(2)-align)), \ |
| 271 | $(eval _cbfs-bucket:=aligned)) \ |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 272 | $(if $(tmp-cbfs-method), \ |
| 273 | $(eval tmp-old-cbfs-file:=$(tmp-cbfs-file)) \ |
Patrick Georgi | 16c7ad7 | 2012-09-21 18:11:59 +0200 | [diff] [blame] | 274 | $(eval tmp-cbfs-file:=$(shell mkdir -p $(obj)/mainboard/$(MAINBOARDDIR); mktemp $(obj)/mainboard/$(MAINBOARDDIR)/cbfs-file.XXXXXX).out) \ |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 275 | $(call cbfs-files-processor-$(tmp-cbfs-method),$(tmp-old-cbfs-file),$(tmp-cbfs-file))) \ |
Patrick Georgi | 1eee076 | 2015-11-25 18:59:54 +0100 | [diff] [blame] | 276 | $(if $(tmp-cbfs-file), \ |
Patrick Georgi | 67cb6aa | 2015-11-26 17:17:28 +0100 | [diff] [blame] | 277 | $(eval cbfs-files-$(_cbfs-bucket) += $(subst $(spc),*,$(tmp-cbfs-file)|$(2)|$($(2)-type)|$($(2)-compression)|$(strip $($(2)-position))|$($(2)-align)|$($(2)-options)))) \ |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 278 | $(eval $(2)-name:=) \ |
| 279 | $(eval $(2)-type:=) \ |
Dave Frodin | 0013bbf | 2012-08-14 11:01:53 -0600 | [diff] [blame] | 280 | $(eval $(2)-compression:=) \ |
Patrick Georgi | 70c85ea | 2013-02-16 01:06:57 +0100 | [diff] [blame] | 281 | $(eval $(2)-position:=) \ |
Patrick Georgi | 5839635 | 2014-12-09 12:49:21 +0100 | [diff] [blame] | 282 | $(eval $(2)-required:=) \ |
Patrick Georgi | 99ae578 | 2015-11-26 16:37:45 +0100 | [diff] [blame] | 283 | $(eval $(2)-options:=) \ |
Patrick Georgi | 5839635 | 2014-12-09 12:49:21 +0100 | [diff] [blame] | 284 | $(eval $(2)-align:=) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 285 | |
| 286 | ####################################################################### |
| 287 | # a variety of flags for our build |
Stefan Reinauer | 6321758 | 2012-10-29 16:52:36 -0700 | [diff] [blame] | 288 | CBFS_COMPRESS_FLAG:=none |
Sven Schnelle | 8eee19d | 2011-05-02 19:53:04 +0000 | [diff] [blame] | 289 | ifeq ($(CONFIG_COMPRESS_RAMSTAGE),y) |
Stefan Reinauer | 6321758 | 2012-10-29 16:52:36 -0700 | [diff] [blame] | 290 | CBFS_COMPRESS_FLAG:=LZMA |
Sven Schnelle | 8eee19d | 2011-05-02 19:53:04 +0000 | [diff] [blame] | 291 | endif |
| 292 | |
Stefan Reinauer | 6321758 | 2012-10-29 16:52:36 -0700 | [diff] [blame] | 293 | CBFS_PAYLOAD_COMPRESS_FLAG:=none |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 294 | ifeq ($(CONFIG_COMPRESSED_PAYLOAD_LZMA),y) |
Stefan Reinauer | 6321758 | 2012-10-29 16:52:36 -0700 | [diff] [blame] | 295 | CBFS_PAYLOAD_COMPRESS_FLAG:=LZMA |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 296 | endif |
| 297 | |
| 298 | ifneq ($(CONFIG_LOCALVERSION),"") |
Martin Roth | e236204 | 2015-02-12 19:32:41 -0700 | [diff] [blame] | 299 | export COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION)) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 300 | endif |
| 301 | |
Aaron Durbin | dc9f5cd | 2015-09-08 13:34:43 -0500 | [diff] [blame] | 302 | CPPFLAGS_common := -Isrc -Isrc/include -Isrc/commonlib/include -I$(obj) |
Patrick Georgi | 58f73a6 | 2014-05-17 14:00:12 +0200 | [diff] [blame] | 303 | CPPFLAGS_common += -Isrc/device/oprom/include |
Aaron Durbin | cbb6c75 | 2015-12-15 15:57:11 -0600 | [diff] [blame] | 304 | VB_SOURCE ?= 3rdparty/vboot |
| 305 | CPPFLAGS_common += -I$(VB_SOURCE)/firmware/include |
Patrick Georgi | 58f73a6 | 2014-05-17 14:00:12 +0200 | [diff] [blame] | 306 | CPPFLAGS_common += -include $(src)/include/kconfig.h |
Jimmy Huang | b87bb29 | 2015-11-30 18:16:42 +0800 | [diff] [blame] | 307 | CPPFLAGS_common += -I3rdparty |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 308 | |
Vadim Bendebury | 55cdc16 | 2014-04-22 17:06:43 -0700 | [diff] [blame] | 309 | CFLAGS_common += -pipe -g -nostdinc |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 310 | CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes |
| 311 | CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs |
Paul Menzel | 23b4e4c | 2015-04-08 10:53:39 +0200 | [diff] [blame] | 312 | CFLAGS_common += -Wstrict-aliasing -Wshadow |
Stefan Reinauer | d146ac6 | 2015-07-31 13:50:03 -0700 | [diff] [blame] | 313 | CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer |
| 314 | CFLAGS_common += -ffunction-sections -fdata-sections |
Paul Menzel | 23b4e4c | 2015-04-08 10:53:39 +0200 | [diff] [blame] | 315 | |
Aaron Durbin | d4dd44c | 2015-09-06 10:15:17 -0500 | [diff] [blame] | 316 | LDFLAGS_common := --gc-sections -nostdlib -nostartfiles -static --emit-relocs |
| 317 | |
Paul Menzel | 23b4e4c | 2015-04-08 10:53:39 +0200 | [diff] [blame] | 318 | ifeq ($(CONFIG_COMPILER_GCC),y) |
| 319 | # cf. commit f69a99db (coreboot: x86: enable gc-sections) |
| 320 | CFLAGS_common += -Wno-unused-but-set-variable |
| 321 | endif |
| 322 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 323 | ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y) |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 324 | CFLAGS_common += -Werror |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 325 | endif |
Vadim Bendebury | 55cdc16 | 2014-04-22 17:06:43 -0700 | [diff] [blame] | 326 | ifneq ($(GDB_DEBUG),) |
Stefan Reinauer | 87200e2 | 2015-03-15 00:21:17 +0100 | [diff] [blame] | 327 | CFLAGS_common += -Og |
Vadim Bendebury | 55cdc16 | 2014-04-22 17:06:43 -0700 | [diff] [blame] | 328 | else |
| 329 | CFLAGS_common += -Os |
| 330 | endif |
| 331 | |
Nico Huber | a15cd66 | 2013-06-19 16:16:05 +0200 | [diff] [blame] | 332 | additional-dirs := $(objutil)/cbfstool $(objutil)/romcc $(objutil)/ifdtool \ |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 333 | $(objutil)/ifdfake $(objutil)/options $(objutil)/amdfwtool \ |
Paul Burton | b1688ca | 2014-06-14 00:09:49 +0100 | [diff] [blame] | 334 | $(objutil)/cbootimage $(objutil)/bimgtool |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 335 | |
| 336 | ####################################################################### |
| 337 | # generate build support files |
| 338 | $(obj)/build.h: .xcompile |
| 339 | @printf " GEN build.h\n" |
| 340 | rm -f $(obj)/build.h |
Martin Roth | e236204 | 2015-02-12 19:32:41 -0700 | [diff] [blame] | 341 | util/genbuild_h/genbuild_h.sh > $(obj)/build.ht |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 342 | mv $(obj)/build.ht $(obj)/build.h |
| 343 | |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 344 | build-dirs: |
| 345 | mkdir -p $(objcbfs) $(objgenerated) |
| 346 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 347 | ####################################################################### |
| 348 | # Build the tools |
Patrick Georgi | 533c119 | 2014-07-10 09:42:03 +0200 | [diff] [blame] | 349 | CBFSTOOL:=$(objutil)/cbfstool/cbfstool |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 350 | FMAPTOOL:=$(objutil)/cbfstool/fmaptool |
Patrick Georgi | 533c119 | 2014-07-10 09:42:03 +0200 | [diff] [blame] | 351 | RMODTOOL:=$(objutil)/cbfstool/rmodtool |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 352 | |
Patrick Georgi | 533c119 | 2014-07-10 09:42:03 +0200 | [diff] [blame] | 353 | $(obj)/cbfstool: $(CBFSTOOL) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 354 | cp $< $@ |
| 355 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 356 | $(obj)/fmaptool: $(FMAPTOOL) |
| 357 | cp $< $@ |
| 358 | |
Patrick Georgi | 533c119 | 2014-07-10 09:42:03 +0200 | [diff] [blame] | 359 | $(obj)/rmodtool: $(RMODTOOL) |
Aaron Durbin | 3eb8eb7 | 2014-03-10 16:13:58 -0500 | [diff] [blame] | 360 | cp $< $@ |
| 361 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 362 | _WINCHECK=$(shell uname -o 2> /dev/null) |
| 363 | STACK= |
| 364 | ifeq ($(_WINCHECK),Msys) |
| 365 | STACK=-Wl,--stack,16384000 |
| 366 | endif |
| 367 | ifeq ($(_WINCHECK),Cygwin) |
| 368 | STACK=-Wl,--stack,16384000 |
| 369 | endif |
| 370 | |
Patrick Georgi | e24a119 | 2014-05-17 19:05:56 +0200 | [diff] [blame] | 371 | # this allows ccache to prepend itself |
| 372 | # (ccache handling happens first) |
| 373 | ROMCC_BIN= $(objutil)/romcc/romcc |
| 374 | ROMCC?=$(ROMCC_BIN) |
| 375 | $(ROMCC_BIN): $(top)/util/romcc/romcc.c |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 376 | @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n" |
| 377 | @# Note: Adding -O2 here might cause problems. For details see: |
| 378 | @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html |
| 379 | $(HOSTCC) -g $(STACK) -Wall -o $@ $< |
| 380 | |
Stefan Reinauer | 5b63579 | 2012-08-16 14:05:42 -0700 | [diff] [blame] | 381 | IFDTOOL:=$(objutil)/ifdtool/ifdtool |
| 382 | $(IFDTOOL): $(top)/util/ifdtool/ifdtool.c |
| 383 | @printf " HOSTCC $(subst $(obj)/,,$(@))\n" |
| 384 | $(HOSTCC) $(HOSTCFLAGS) -o $@ $< |
| 385 | |
Nico Huber | a15cd66 | 2013-06-19 16:16:05 +0200 | [diff] [blame] | 386 | IFDFAKE:=$(objutil)/ifdfake/ifdfake |
| 387 | $(IFDFAKE): $(top)/util/ifdfake/ifdfake.c |
| 388 | @printf " HOSTCC $(subst $(obj)/,,$(@))\n" |
| 389 | $(HOSTCC) $(HOSTCFLAGS) -o $@ $< |
| 390 | |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 391 | AMDFWTOOL:=$(objutil)/amdfwtool/amdfwtool |
| 392 | $(AMDFWTOOL): $(top)/util/amdfwtool/amdfwtool.c |
Bruce Griffith | 1a59039 | 2014-08-10 17:09:15 -0600 | [diff] [blame] | 393 | @printf " HOSTCC $(subst $(obj)/,,$(@))\n" |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 394 | $(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $< |
Bruce Griffith | 1a59039 | 2014-08-10 17:09:15 -0600 | [diff] [blame] | 395 | |
Isaac Christensen | 3a92be7 | 2014-09-08 15:28:17 -0600 | [diff] [blame] | 396 | CBOOTIMAGE:=$(objutil)/cbootimage/cbootimage |
| 397 | |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 398 | subdirs-y += util/nvidia |
Isaac Christensen | 3a92be7 | 2014-09-08 15:28:17 -0600 | [diff] [blame] | 399 | |
Paul Burton | b1688ca | 2014-06-14 00:09:49 +0100 | [diff] [blame] | 400 | BIMGTOOL:=$(objutil)/bimgtool/bimgtool |
| 401 | $(BIMGTOOL): $(top)/util/bimgtool/bimgtool.c |
| 402 | @printf " HOSTCC $(subst $(obj)/,,$(@))\n" |
| 403 | $(HOSTCC) $(HOSTCFLAGS) -o $@ $< |
| 404 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 405 | ####################################################################### |
| 406 | # needed objects that every mainboard uses |
| 407 | # Creation of these is architecture and mainboard independent |
| 408 | $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(objutil)/sconfig/sconfig |
| 409 | @printf " SCONFIG $(subst $(src)/,,$(<))\n" |
| 410 | mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) |
| 411 | $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR) |
| 412 | |
| 413 | ramstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c |
Stefan Reinauer | 57879c9 | 2012-07-31 16:47:25 -0700 | [diff] [blame] | 414 | romstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c |
Aaron Durbin | 75c51d9 | 2015-09-29 16:31:20 -0500 | [diff] [blame] | 415 | verstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 416 | |
Patrick Georgi | 64ccc3b8 | 2011-05-20 23:08:12 +0000 | [diff] [blame] | 417 | $(obj)/%.ramstage.o $(abspath $(obj))/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 418 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Marc Jones | a38ccfd | 2014-11-06 15:50:22 -0700 | [diff] [blame] | 419 | $(CC_ramstage) -MMD $(CFLAGS_ramstage) $(CPPFLAGS_ramstage) $(ramstage-c-ccopts) -c -o $@ $< |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 420 | |
Stefan Reinauer | 57879c9 | 2012-07-31 16:47:25 -0700 | [diff] [blame] | 421 | $(obj)/%.romstage.o $(abspath $(obj))/%.romstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H) |
| 422 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Marc Jones | a38ccfd | 2014-11-06 15:50:22 -0700 | [diff] [blame] | 423 | $(CC_romstage) -MMD $(CFLAGS_romstage) $(CPPFLAGS_romstage) $(romstage-c-ccopts) -c -o $@ $< |
Stefan Reinauer | 57879c9 | 2012-07-31 16:47:25 -0700 | [diff] [blame] | 424 | |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 425 | $(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H) |
| 426 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Marc Jones | a38ccfd | 2014-11-06 15:50:22 -0700 | [diff] [blame] | 427 | $(CC_bootblock) -MMD $(CFLAGS_bootblock) $(CPPFLAGS_bootblock) $(bootblock-c-ccopts) -c -o $@ $< |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 428 | |
Patrick Georgi | 27ef602 | 2015-04-30 14:25:14 +0200 | [diff] [blame] | 429 | $(objgenerated)/libverstage.a: $$(libverstage-objs) |
Patrick Georgi | ba80887 | 2015-04-27 18:09:22 +0200 | [diff] [blame] | 430 | rm -f $@ |
Patrick Georgi | b11be32 | 2015-05-07 22:27:01 +0200 | [diff] [blame] | 431 | $(AR_libverstage) rcsT $@ $^ |
Patrick Georgi | ba80887 | 2015-04-27 18:09:22 +0200 | [diff] [blame] | 432 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 433 | ####################################################################### |
| 434 | # Clean up rules |
| 435 | clean-abuild: |
| 436 | rm -rf coreboot-builds |
| 437 | |
| 438 | clean-for-update-target: |
Furquan Shaikh | 20f25dd | 2014-04-22 10:41:05 -0700 | [diff] [blame] | 439 | rm -f $(obj)/ramstage* $(obj)/coreboot.romstage $(obj)/coreboot.pre* $(obj)/coreboot.bootblock $(obj)/coreboot.a |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 440 | rm -rf $(obj)/bootblock* $(obj)/romstage* $(obj)/location.* |
| 441 | rm -f $(obj)/option_table.* $(obj)/crt0.S $(obj)/ldscript |
| 442 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot |
| 443 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm |
| 444 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc |
Martin Roth | 4fdd803 | 2016-01-04 10:44:13 -0700 | [diff] [blame] | 445 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.* $(obj)/dsdt.* |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 446 | rm -f $(obj)/cpu/x86/smm/smm_bin.c $(obj)/cpu/x86/smm/smm.* $(obj)/cpu/x86/smm/smm |
Martin Roth | 501005f | 2015-06-24 20:03:08 -0600 | [diff] [blame] | 447 | $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 448 | |
| 449 | clean-target: |
| 450 | rm -f $(obj)/coreboot* |
| 451 | |
| 452 | ####################################################################### |
| 453 | # Development utilities |
| 454 | printcrt0s: |
| 455 | @echo crt0s=$(crt0s) |
| 456 | @echo ldscripts=$(ldscripts) |
| 457 | |
| 458 | update: |
| 459 | dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF |
| 460 | |
Patrick Georgi | cb02cb7 | 2012-02-25 19:42:59 +0100 | [diff] [blame] | 461 | lint lint-stable: |
Martin Roth | e4fc407 | 2015-10-13 13:40:59 -0600 | [diff] [blame] | 462 | util/lint/lint $@ |
Patrick Georgi | 6c44550 | 2011-05-16 15:32:28 +0000 | [diff] [blame] | 463 | |
Patrick Georgi | bb60528 | 2011-06-05 15:15:49 +0200 | [diff] [blame] | 464 | gitconfig: |
Patrick Georgi | 1b770fb | 2015-03-04 15:03:05 +0100 | [diff] [blame] | 465 | [ -d .git ] |
Zheng Bao | 50ad095 | 2012-10-22 16:29:37 +0800 | [diff] [blame] | 466 | mkdir -p .git/hooks |
zbao | f2c3254 | 2012-08-10 15:44:02 +0800 | [diff] [blame] | 467 | for hook in commit-msg pre-commit ; do \ |
| 468 | if [ util/gitconfig/$$hook -nt .git/hooks/$$hook -o \ |
| 469 | ! -x .git/hooks/$$hook ]; then \ |
Patrick Georgi | f394715 | 2015-04-28 21:36:11 +0200 | [diff] [blame] | 470 | sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/$$hook > .git/hooks/$$hook; \ |
zbao | f2c3254 | 2012-08-10 15:44:02 +0800 | [diff] [blame] | 471 | chmod +x .git/hooks/$$hook; \ |
| 472 | fi; \ |
| 473 | done |
Stefan Reinauer | 11186dd | 2015-06-13 10:45:40 +0200 | [diff] [blame] | 474 | # Now set up thehooks for 3rdparty/blobs |
Patrick Georgi | 11ac97b | 2015-07-06 09:31:42 +0000 | [diff] [blame] | 475 | if [ -d .git/modules/3rdparty -a \ |
| 476 | \( util/gitconfig/commit-msg -nt .git/modules/3rdparty/hooks/commit-msg -o \ |
| 477 | ! -x .git/modules/3rdparty/hooks/commit-msg \) ]; then \ |
| 478 | sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/commit-msg > .git/modules/3rdparty/hooks/commit-msg; \ |
| 479 | chmod +x .git/modules/3rdparty/hooks/commit-msg; \ |
Stefan Reinauer | 11186dd | 2015-06-13 10:45:40 +0200 | [diff] [blame] | 480 | fi |
| 481 | [ -d 3rdparty/blobs ] && cd 3rdparty/blobs && git config remote.origin.push HEAD:refs/for/master |
Ronald G. Minnich | 64b364d | 2013-01-03 08:26:09 -0800 | [diff] [blame] | 482 | git config remote.origin.push HEAD:refs/for/master |
Patrick Georgi | bb60528 | 2011-06-05 15:15:49 +0200 | [diff] [blame] | 483 | (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) |
| 484 | |
Martin Roth | c24f3d6 | 2015-11-25 12:50:25 -0700 | [diff] [blame] | 485 | help_toolchain help:: |
| 486 | @echo '*** Toolchain targets ***' |
Martin Roth | 76f14b2 | 2015-11-18 13:09:23 -0700 | [diff] [blame] | 487 | @echo ' crossgcc - Build coreboot cross-compilers for all platforms' |
| 488 | @echo ' crosstools - Build coreboot cross-compiler and GDB for all platforms' |
| 489 | @echo ' crossgcc-clean - Remove all built coreboot cross-compilers' |
Martin Roth | 4eea174 | 2015-11-25 11:50:04 -0700 | [diff] [blame] | 490 | @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)' |
| 491 | @echo ' clang - Build coreboot clang compiler' |
Martin Roth | aede3fc | 2016-01-05 16:07:42 -0700 | [diff] [blame] | 492 | @echo ' test-toolchain - Reports if toolchain components are out of date' |
Martin Roth | 76f14b2 | 2015-11-18 13:09:23 -0700 | [diff] [blame] | 493 | @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture' |
| 494 | @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture' |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 495 | @echo ' ARCH can be "i386", "x64", "arm", "aarch64", "mips", "riscv", or "power8"' |
Martin Roth | 76f14b2 | 2015-11-18 13:09:23 -0700 | [diff] [blame] | 496 | @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores' |
| 497 | @echo |
| 498 | |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 499 | # For the toolchain builds, use CPUS=x to use multiple processors to build |
| 500 | # use BUILDGCC_OPTIONS= to set any crossgcc command line options |
| 501 | # Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build |
Martin Roth | 317b582 | 2015-11-29 11:28:26 -0700 | [diff] [blame] | 502 | crossgcc: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 503 | $(MAKE) -C util/crossgcc all_without_gdb SKIP_CLANG=1 |
Peter Stuge | 0b6b4d6 | 2011-06-09 05:06:25 +0200 | [diff] [blame] | 504 | |
Martin Roth | 4eea174 | 2015-11-25 11:50:04 -0700 | [diff] [blame] | 505 | .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \ |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 506 | crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \ |
| 507 | clang tools crosstools-i386 crosstools-x64 crosstools-arm \ |
| 508 | crosstools-aarch64 crosstools-mips crosstools-riscv crosstools-power8 |
Martin Roth | 4eea174 | 2015-11-25 11:50:04 -0700 | [diff] [blame] | 509 | |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 510 | crossgcc-i386: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 511 | $(MAKE) -C util/crossgcc build-i386 SKIP_GDB=1 |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 512 | |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 513 | crossgcc-x64: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 514 | $(MAKE) -C util/crossgcc build-x64 SKIP_GDB=1 |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 515 | |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 516 | crossgcc-arm: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 517 | $(MAKE) -C util/crossgcc build-armv7a SKIP_GDB=1 |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 518 | |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 519 | crossgcc-aarch64: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 520 | $(MAKE) -C util/crossgcc build-aarch64 SKIP_GDB=1 |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 521 | |
Patrick Georgi | a9330e0 | 2015-02-27 23:41:15 +0100 | [diff] [blame] | 522 | crossgcc-mips: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 523 | $(MAKE) -C util/crossgcc build-mips SKIP_GDB=1 |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 524 | |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 525 | crossgcc-riscv: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 526 | $(MAKE) -C util/crossgcc build-riscv SKIP_GDB=1 |
Patrick Georgi | a9330e0 | 2015-02-27 23:41:15 +0100 | [diff] [blame] | 527 | |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 528 | crossgcc-power8: clean-for-update |
| 529 | $(MAKE) -C util/crossgcc build-power8 SKIP_GDB=1 |
| 530 | |
Martin Roth | 317b582 | 2015-11-29 11:28:26 -0700 | [diff] [blame] | 531 | crosstools: clean-for-update |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 532 | $(MAKE) -C util/crossgcc all_with_gdb SKIP_CLANG=1 |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 533 | |
Martin Roth | 317b582 | 2015-11-29 11:28:26 -0700 | [diff] [blame] | 534 | iasl: clean-for-update |
Martin Roth | 4eea174 | 2015-11-25 11:50:04 -0700 | [diff] [blame] | 535 | $(MAKE) -C util/crossgcc build_iasl |
| 536 | |
Martin Roth | 317b582 | 2015-11-29 11:28:26 -0700 | [diff] [blame] | 537 | clang: clean-for-update |
Martin Roth | 4eea174 | 2015-11-25 11:50:04 -0700 | [diff] [blame] | 538 | $(MAKE) -C util/crossgcc build_clang |
| 539 | |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 540 | crosstools-i386: clean-for-update |
| 541 | $(MAKE) -C util/crossgcc build-i386 |
| 542 | |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 543 | crosstools-x64: clean-for-update |
| 544 | $(MAKE) -C util/crossgcc build-x64 |
| 545 | |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 546 | crosstools-arm: clean-for-update |
| 547 | $(MAKE) -C util/crossgcc build-armv7a |
Patrick Georgi | 6c44550 | 2011-05-16 15:32:28 +0000 | [diff] [blame] | 548 | |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 549 | crosstools-aarch64: clean-for-update |
| 550 | $(MAKE) -C util/crossgcc build-aarch64 |
| 551 | |
Patrick Georgi | a9330e0 | 2015-02-27 23:41:15 +0100 | [diff] [blame] | 552 | crosstools-mips: clean-for-update |
| 553 | $(MAKE) -C util/crossgcc build-mips |
| 554 | |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 555 | crosstools-riscv: clean-for-update |
| 556 | $(MAKE) -C util/crossgcc build-riscv |
| 557 | |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 558 | crosstools-power8: clean-for-update |
| 559 | $(MAKE) -C util/crossgcc build-power8 |
| 560 | |
Patrick Georgi | 6c44550 | 2011-05-16 15:32:28 +0000 | [diff] [blame] | 561 | crossgcc-clean: clean-for-update |
| 562 | $(MAKE) -C util/crossgcc clean |
| 563 | |
Martin Roth | 9c940ae | 2015-12-04 13:11:35 -0700 | [diff] [blame] | 564 | tools: $(objutil)/kconfig/conf $(CBFSTOOL) $(FMAPTOOL) $(RMODTOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(IFDFAKE) $(CBOOTIMAGE) $(AMDFWTOOL) |
Patrick Georgi | 43105d6 | 2011-11-05 14:44:41 +0100 | [diff] [blame] | 565 | |
Martin Roth | aede3fc | 2016-01-05 16:07:42 -0700 | [diff] [blame] | 566 | test-toolchain: |
| 567 | ifeq ($(COMPILER_OUT_OF_DATE),1) |
| 568 | echo "The coreboot toolchain is not the current version." |
| 569 | $(error ) |
| 570 | else |
| 571 | echo "The coreboot toolchain is the current version." |
| 572 | endif # ifeq ($(COMPILER_OUT_OF_DATE),1) |
| 573 | |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 574 | ########################################################################### |
| 575 | # Common recipes for all stages |
| 576 | ########################################################################### |
| 577 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 578 | # loadaddr can determine the load address of a stage, which may be needed for |
| 579 | # platform-specific image headers (only works *after* the stage has been built) |
| 580 | loadaddr = $(shell $(OBJDUMP_$(1)) -p $(objcbfs)/$(1).debug | \ |
| 581 | sed -ne '/LOAD/s/^.*vaddr 0x\([0-9a-fA-F]\{8\}\).*$$/0x\1/p') |
| 582 | |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 583 | # find-substr is required for stages like romstage_null and romstage_xip to |
| 584 | # eliminate the _* part of the string |
| 585 | find-substr = $(word 1,$(subst _, ,$(1))) |
| 586 | |
| 587 | # find-class is used to identify the class from the name of the stage |
| 588 | # The input to this macro can be something like romstage.x or romstage.x.y |
| 589 | # find-class recursively strips off the suffixes to extract the exact class name |
| 590 | # e.g.: if romstage.x is provided to find-class, it will remove .x and return romstage |
| 591 | # if romstage.x.y is provided, it will first remove .y, call find-class with romstage.x |
| 592 | # and remove .x the next time and finally return romstage |
| 593 | find-class = $(if $(filter $(1),$(basename $(1))),$(if $(CC_$(1)), $(1), $(call find-substr,$(1))),$(call find-class,$(basename $(1)))) |
| 594 | |
Aaron Durbin | d972f78 | 2015-09-17 17:02:53 -0500 | [diff] [blame] | 595 | # Bootblocks are not CBFS stages. coreboot is currently expecting the bss to |
| 596 | # be cleared by the loader of the stage. For ARM SoCs that means one needs to |
| 597 | # include the bss section in the binary so the BootROM clears the bss on |
| 598 | # loading of the bootblock stage. Achieve this by marking the bss section |
| 599 | # loadable,allocatable, and data. Do the same for the .data section in case |
| 600 | # it's marked as NOBITS. |
| 601 | $(objcbfs)/bootblock.raw.bin: $(objcbfs)/bootblock.elf |
| 602 | @printf " OBJCOPY $(notdir $(@))\n" |
| 603 | $(OBJCOPY_bootblock) --set-section-flags .bss=load,alloc,data --set-section-flags .data=load,alloc,data $< $<.tmp |
| 604 | $(OBJCOPY_bootblock) -O binary $<.tmp $@ |
| 605 | |
| 606 | $(objcbfs)/%.bin: $(objcbfs)/%.raw.bin |
| 607 | cp $< $@ |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 608 | |
| 609 | $(objcbfs)/%.elf: $(objcbfs)/%.debug |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 610 | $(eval class := $(call find-class,$(@F))) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 611 | @printf " OBJCOPY $(subst $(obj)/,,$(@))\n" |
| 612 | cp $< $@.tmp |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 613 | $(NM_$(class)) -n $@.tmp | sort > $(basename $@).map |
| 614 | $(OBJCOPY_$(class)) --strip-debug $@.tmp |
| 615 | $(OBJCOPY_$(class)) --add-gnu-debuglink=$< $@.tmp |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 616 | mv $@.tmp $@ |
| 617 | |
| 618 | ########################################################################### |
| 619 | # Build the final rom image |
| 620 | ########################################################################### |
| 621 | |
Martin Roth | fdaf9cc | 2015-12-11 11:40:06 -0700 | [diff] [blame] | 622 | # extract_nth - Return a subsection of the $file string |
| 623 | # |
| 624 | # the input string looks like this: |
| 625 | # ./build/cbfs/fallback/romstage.elf|fallback/romstage|stage|none||64|--xip*-S*.car.data*-P*0x10000 |
| 626 | # |
| 627 | # Sections: |
| 628 | # 1 - Path and name of file [FILENAME: Added to cbfs-files-y list variable] |
| 629 | # 2 - Name of file in cbfs [$(FILENAME)-file] |
| 630 | # 3 - File type: [$(FILENAME)-type] |
| 631 | # bootblock, cbfs header, stage, payload, optionrom, bootsplash, raw, vsa, |
| 632 | # mbi, microcode, fsp, mrc, cmos_default, cmos_layout, spd, mrc_cache, |
| 633 | # mma, efi, deleted, null |
| 634 | # 4 - Compression type [$(FILENAME)-compression] |
| 635 | # none, LZMA |
| 636 | # 5 - Base address [$(FILANAME)-position] |
| 637 | # 6 - Alignment [$(FILENAME)-align] |
| 638 | # 7 - cbfstool flags [$(FILENAME)-options] |
| 639 | # |
| 640 | # Input: |
| 641 | # $(1) = Section to extract |
| 642 | # $(2) = Input string |
| 643 | # |
| 644 | # Steps: |
| 645 | # 1) replace all '|' characters with the sequence '- -' within the full string, prepended and appended with the character '-' |
| 646 | # 2) extract the specified section from the string - this gets us the section surrounded by '-' characters |
| 647 | # 3) remove the leading and trailing '-' characters |
| 648 | # 4) replace all '*' characters with spaces |
Patrick Georgi | 67cb6aa | 2015-11-26 17:17:28 +0100 | [diff] [blame] | 649 | extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-)))) |
Patrick Georgi | 5839635 | 2014-12-09 12:49:21 +0100 | [diff] [blame] | 650 | |
| 651 | cbfs-add-cmd = \ |
Patrick Georgi | 8cf590f | 2015-11-26 18:26:15 +0100 | [diff] [blame] | 652 | printf " CBFS $(call extract_nth,2,$(file))\n"; \ |
Patrick Georgi | 5839635 | 2014-12-09 12:49:21 +0100 | [diff] [blame] | 653 | $(CBFSTOOL) $@.tmp \ |
| 654 | add$(if $(filter stage,$(call extract_nth,3,$(file))),-stage)$(if $(filter payload,$(call extract_nth,3,$(file))),-payload) \ |
| 655 | -f $(call extract_nth,1,$(file)) \ |
Daisuke Nojiri | bf84cf9 | 2015-09-22 15:21:36 -0700 | [diff] [blame] | 656 | -n $(call extract_nth,2,$(file)) \ |
| 657 | $(if $(filter-out stage,$(call extract_nth,3,$(file))),-t $(call extract_nth,3,$(file))) \ |
Patrick Georgi | 99ae578 | 2015-11-26 16:37:45 +0100 | [diff] [blame] | 658 | $(if $(call extract_nth,4,$(file)),-c $(call extract_nth,4,$(file))) \ |
| 659 | $(call extract_nth,7,$(file)) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 660 | |
Patrick Georgi | 9b5b536 | 2015-11-25 17:04:17 +0100 | [diff] [blame] | 661 | cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 662 | ifneq ($(CONFIG_UPDATE_IMAGE),y) |
| 663 | prebuild-files = \ |
| 664 | $(foreach file,$(cbfs-files), \ |
Aaron Durbin | 9b9d4b3 | 2015-09-15 21:30:58 -0500 | [diff] [blame] | 665 | $(if $(call extract_nth,6,$(file)),$(cbfs-add-cmd) -a $(call extract_nth,6,$(file)) &&, \ |
Patrick Georgi | 5839635 | 2014-12-09 12:49:21 +0100 | [diff] [blame] | 666 | $(cbfs-add-cmd) $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))) &&)) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 667 | prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file))) |
| 668 | |
Patrick Georgi | 8a3592e | 2015-09-16 18:10:52 +0200 | [diff] [blame] | 669 | ifeq ($(CONFIG_FMDFILE),) |
| 670 | # For a description of the flash layout described by these variables, check |
| 671 | # the $(DEFAULT_FLASHMAP) .fmd files. |
| 672 | ifeq ($(CONFIG_ARCH_X86),y) |
| 673 | DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default-x86.fmd |
| 674 | # entire flash |
| 675 | FMAP_ROM_ADDR := $(call int-subtract, 0x100000000 $(CONFIG_ROM_SIZE)) |
| 676 | FMAP_ROM_SIZE := $(CONFIG_ROM_SIZE) |
| 677 | # entire "BIOS" region (everything directly of concern to the host system) |
| 678 | # relative to ROM_BASE |
| 679 | FMAP_BIOS_BASE := $(call int-subtract, $(CONFIG_ROM_SIZE) $(CONFIG_CBFS_SIZE)) |
Martin Roth | acc94a7 | 2015-12-26 17:02:41 -0700 | [diff] [blame] | 680 | FMAP_BIOS_SIZE := $(shell echo $(CONFIG_CBFS_SIZE) | tr A-F a-f) |
Patrick Georgi | 8a3592e | 2015-09-16 18:10:52 +0200 | [diff] [blame] | 681 | # position and size of flashmap, relative to BIOS_BASE |
| 682 | FMAP_FMAP_BASE := 0 |
| 683 | FMAP_FMAP_SIZE := 0x100 |
| 684 | # position and size of CBFS, relative to BIOS_BASE |
| 685 | FMAP_CBFS_BASE := $(FMAP_FMAP_SIZE) |
| 686 | FMAP_CBFS_SIZE := $(call int-subtract, $(FMAP_BIOS_SIZE) $(FMAP_FMAP_SIZE)) |
| 687 | else |
| 688 | DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default.fmd |
| 689 | # entire flash |
| 690 | FMAP_ROM_ADDR := 0 |
| 691 | FMAP_ROM_SIZE := $(CONFIG_ROM_SIZE) |
| 692 | # entire "BIOS" region (everything directly of concern to the host system) |
| 693 | # relative to ROM_BASE |
| 694 | FMAP_BIOS_BASE := 0 |
| 695 | FMAP_BIOS_SIZE := $(CONFIG_CBFS_SIZE) |
| 696 | # position and size of flashmap, relative to BIOS_BASE |
| 697 | FMAP_FMAP_BASE := 0x20000 |
| 698 | FMAP_FMAP_SIZE := 0x100 |
| 699 | # position and size of CBFS, relative to BIOS_BASE |
| 700 | FMAP_CBFS_BASE := $(call int-add,$(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE)) |
| 701 | FMAP_CBFS_SIZE := $(call int-subtract,$(FMAP_BIOS_SIZE) $(FMAP_CBFS_BASE)) |
| 702 | endif |
| 703 | |
Martin Roth | acc94a7 | 2015-12-26 17:02:41 -0700 | [diff] [blame] | 704 | $(obj)/fmap.fmd: $(top)/Makefile.inc $(DEFAULT_FLASHMAP) $(obj)/config.h |
Patrick Georgi | 8a3592e | 2015-09-16 18:10:52 +0200 | [diff] [blame] | 705 | sed -e "s,##ROM_BASE##,$(FMAP_ROM_ADDR)," \ |
| 706 | -e "s,##ROM_SIZE##,$(FMAP_ROM_SIZE)," \ |
| 707 | -e "s,##BIOS_BASE##,$(FMAP_BIOS_BASE)," \ |
| 708 | -e "s,##BIOS_SIZE##,$(FMAP_BIOS_SIZE)," \ |
| 709 | -e "s,##FMAP_BASE##,$(FMAP_FMAP_BASE)," \ |
| 710 | -e "s,##FMAP_SIZE##,$(FMAP_FMAP_SIZE)," \ |
| 711 | -e "s,##CBFS_BASE##,$(FMAP_CBFS_BASE)," \ |
| 712 | -e "s,##CBFS_SIZE##,$(FMAP_CBFS_SIZE)," \ |
| 713 | $(DEFAULT_FLASHMAP) > $@.tmp |
| 714 | mv $@.tmp $@ |
| 715 | else |
Martin Roth | acc94a7 | 2015-12-26 17:02:41 -0700 | [diff] [blame] | 716 | $(obj)/fmap.fmd: $(CONFIG_FMDFILE) $(obj)/config.h |
Patrick Georgi | 8a3592e | 2015-09-16 18:10:52 +0200 | [diff] [blame] | 717 | cp $< $@ |
| 718 | endif |
| 719 | |
| 720 | # generated at the same time as fmap.fmap |
| 721 | $(obj)/fmap.h: $(obj)/fmap.fmap |
| 722 | |
| 723 | $(obj)/fmap.fmap: $(obj)/fmap.fmd $(FMAPTOOL) |
Martin Roth | acc94a7 | 2015-12-26 17:02:41 -0700 | [diff] [blame] | 724 | echo " FMAP $(FMAPTOOL) -h $(obj)/fmap.h $< $@" |
Patrick Georgi | 8a3592e | 2015-09-16 18:10:52 +0200 | [diff] [blame] | 725 | $(FMAPTOOL) -h $(obj)/fmap.h $< $@ |
| 726 | |
| 727 | $(obj)/coreboot.pre: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(CBFSTOOL) $$(cpu_ucode_cbfs_file) $(obj)/fmap.fmap |
| 728 | $(CBFSTOOL) $@.tmp create -M $(obj)/fmap.fmap |
| 729 | ifeq ($(CONFIG_ARCH_X86),y) |
| 730 | $(CBFSTOOL) $@.tmp add \ |
| 731 | -f $(objcbfs)/bootblock.bin \ |
| 732 | -n bootblock \ |
| 733 | -t bootblock \ |
| 734 | -b -$(call file-size,$(objcbfs)/bootblock.bin) |
| 735 | else |
| 736 | # don't add bootblock to cbfs yet, it's just a waste of space |
| 737 | true $(CBFSTOOL) $@.tmp add \ |
| 738 | -f $(objcbfs)/bootblock.bin \ |
| 739 | -n bootblock \ |
| 740 | -t bootblock \ |
| 741 | -b 0 |
| 742 | $(CBFSTOOL) $@.tmp write -u \ |
| 743 | -r BOOTBLOCK \ |
| 744 | -f $(objcbfs)/bootblock.bin |
| 745 | # make space for the CBFS master header pointer. "ptr_" is just |
| 746 | # arbitrary 4 bytes that will be overwritten by add-master-header. |
| 747 | printf "ptr_" > $@.tmp.2 |
| 748 | $(CBFSTOOL) $@.tmp add \ |
| 749 | -f $@.tmp.2 \ |
| 750 | -n "header pointer" \ |
| 751 | -t "cbfs header" \ |
| 752 | -b -4 |
| 753 | rm -f $@.tmp.2 |
| 754 | endif |
| 755 | $(CBFSTOOL) $@.tmp add-master-header |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 756 | $(prebuild-files) true |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 757 | mv $@.tmp $@ |
| 758 | else |
Aaron Durbin | 999ed64 | 2015-06-03 11:54:59 -0500 | [diff] [blame] | 759 | prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file))) |
| 760 | # Add all cbfs files to image of the form: CONFIG_CBFS_PREFIX/<filename> |
| 761 | prebuild-files = \ |
| 762 | $(foreach file,$(cbfs-files), \ |
Patrick Georgi | 89b4abd | 2015-12-01 18:34:42 +0100 | [diff] [blame] | 763 | $(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null ; \ |
Aaron Durbin | 9b9d4b3 | 2015-09-15 21:30:58 -0500 | [diff] [blame] | 764 | $(if $(call extract_nth,6,$(file)),$(cbfs-add-cmd) -a $(call extract_nth,6,$(file)) &&,\ |
Patrick Georgi | 89b4abd | 2015-12-01 18:34:42 +0100 | [diff] [blame] | 765 | $(cbfs-add-cmd) $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))) &&)) |
Aaron Durbin | 999ed64 | 2015-06-03 11:54:59 -0500 | [diff] [blame] | 766 | |
Patrick Georgi | 708226e | 2015-11-26 17:22:38 +0100 | [diff] [blame] | 767 | .PHONY: $(obj)/coreboot.pre |
| 768 | $(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL) |
Aaron Durbin | 999ed64 | 2015-06-03 11:54:59 -0500 | [diff] [blame] | 769 | mv $(obj)/coreboot.rom $@.tmp |
| 770 | $(prebuild-files) true |
| 771 | mv $@.tmp $@ |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 772 | endif |
| 773 | |
| 774 | ifeq ($(CONFIG_PAYLOAD_LINUX),y) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 775 | ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_COMMAND_LINE))),) |
Patrick Georgi | c2a0b7d | 2014-05-17 14:11:57 +0200 | [diff] [blame] | 776 | ADDITIONAL_PAYLOAD_CONFIG+=-C $(CONFIG_LINUX_COMMAND_LINE) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 777 | endif |
| 778 | ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_INITRD))),) |
Patrick Georgi | c2a0b7d | 2014-05-17 14:11:57 +0200 | [diff] [blame] | 779 | ADDITIONAL_PAYLOAD_CONFIG+=-I $(CONFIG_LINUX_INITRD) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 780 | endif |
| 781 | endif |
| 782 | |
| 783 | ifeq ($(CONFIG_HAVE_REFCODE_BLOB),y) |
| 784 | REFCODE_BLOB=$(obj)/refcode.rmod |
| 785 | $(REFCODE_BLOB): $(RMODTOOL) |
| 786 | $(RMODTOOL) -i $(CONFIG_REFCODE_BLOB_FILE) -o $@ |
| 787 | endif |
| 788 | |
Patrick Georgi | ec90adb | 2015-12-04 17:45:19 +0100 | [diff] [blame] | 789 | $(obj)/coreboot.rom: $(obj)/coreboot.pre $(objcbfs)/ramstage.elf $(CBFSTOOL) $$(INTERMEDIATE) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 790 | @printf " CBFS $(subst $(obj)/,,$(@))\n" |
Julius Werner | f780c40 | 2014-11-10 13:11:50 -0800 | [diff] [blame] | 791 | # The full ROM may be larger than the CBFS part, so create an empty |
| 792 | # file (filled with \377 = 0xff) and copy the CBFS image over it. |
WANG Siyuan | de8c780 | 2015-04-22 15:22:00 +0800 | [diff] [blame] | 793 | dd if=/dev/zero bs=$(call _toint,$(CONFIG_ROM_SIZE)) count=1 2> /dev/null | tr '\000' '\377' > $@.tmp |
Julius Werner | f780c40 | 2014-11-10 13:11:50 -0800 | [diff] [blame] | 794 | dd if=$(obj)/coreboot.pre of=$@.tmp bs=8192 conv=notrunc 2> /dev/null |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 795 | ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),) |
| 796 | ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),0) |
| 797 | @printf " SeaBIOS Wait up to $(CONFIG_SEABIOS_PS2_TIMEOUT) ms for PS/2 keyboard controller initialization\n" |
| 798 | $(CBFSTOOL) $@.tmp add-int -i $(CONFIG_SEABIOS_PS2_TIMEOUT) -n etc/ps2-keyboard-spinup |
| 799 | endif |
| 800 | endif |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 801 | ifeq ($(CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE),y) |
Timothy Pearson | 855fc1f | 2015-10-14 15:41:49 -0500 | [diff] [blame] | 802 | ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE),y) |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 803 | @printf " UPDATE-FIT \n" |
| 804 | $(CBFSTOOL) $@.tmp update-fit -n cpu_microcode_blob.bin -x $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) |
| 805 | endif |
| 806 | endif |
| 807 | mv $@.tmp $@ |
| 808 | @printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n" |
| 809 | $(CBFSTOOL) $@ print |
Martin Roth | 77c67b3 | 2015-06-25 09:36:27 -0600 | [diff] [blame] | 810 | ifeq ($(CONFIG_IASL_WARNINGS_ARE_ERRORS),) |
| 811 | @printf "\n***** WARNING: IASL warnings as errors is disabled! *****\n" |
| 812 | @printf "***** Please fix the ASL for this platform. *****\n\n" |
| 813 | endif |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 814 | |
Patrick Georgi | 1cab012 | 2015-11-26 16:39:23 +0100 | [diff] [blame] | 815 | cbfs-files-y += $(CONFIG_CBFS_PREFIX)/romstage |
| 816 | $(CONFIG_CBFS_PREFIX)/romstage-file := $(objcbfs)/romstage.elf |
| 817 | $(CONFIG_CBFS_PREFIX)/romstage-type := stage |
| 818 | $(CONFIG_CBFS_PREFIX)/romstage-compression := none |
| 819 | ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM),y) |
| 820 | $(CONFIG_CBFS_PREFIX)/romstage-options := -b 0 |
| 821 | endif |
| 822 | ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y) |
| 823 | # Use a 64 byte alignment to provide a minimum alignment |
| 824 | # requirement for the overall romstage. While the first object within |
| 825 | # romstage could have a 4 byte minimum alignment that doesn't mean the linker |
| 826 | # won't decide the entire section should be aligned to a larger value. In the |
| 827 | # future cbfstool should add XIP files proper and honor the alignment |
| 828 | # requirements of the program segment. |
| 829 | # |
| 830 | # Make sure that segment for .car.data is ignored while adding romstage. |
| 831 | $(CONFIG_CBFS_PREFIX)/romstage-align := 64 |
| 832 | $(CONFIG_CBFS_PREFIX)/romstage-options := --xip -S .car.data -P $(CONFIG_XIP_ROM_SIZE) |
| 833 | endif |
| 834 | |
Patrick Georgi | c35bd54 | 2015-11-25 18:21:53 +0100 | [diff] [blame] | 835 | cbfs-files-y += $(CONFIG_CBFS_PREFIX)/ramstage |
| 836 | $(CONFIG_CBFS_PREFIX)/ramstage-file := $(objcbfs)/ramstage.elf |
| 837 | $(CONFIG_CBFS_PREFIX)/ramstage-type := stage |
| 838 | $(CONFIG_CBFS_PREFIX)/ramstage-compression := $(CBFS_COMPRESS_FLAG) |
| 839 | |
Patrick Georgi | 1cab012 | 2015-11-26 16:39:23 +0100 | [diff] [blame] | 840 | cbfs-files-y += $(CONFIG_CBFS_PREFIX)/payload |
| 841 | $(CONFIG_CBFS_PREFIX)/payload-file := $(CONFIG_PAYLOAD_FILE) |
| 842 | $(CONFIG_CBFS_PREFIX)/payload-type := payload |
| 843 | $(CONFIG_CBFS_PREFIX)/payload-compression := $(CBFS_PAYLOAD_COMPRESS_FLAG) |
| 844 | $(CONFIG_CBFS_PREFIX)/payload-options := $(ADDITIONAL_PAYLOAD_CONFIG) |
| 845 | |
Patrick Georgi | c35bd54 | 2015-11-25 18:21:53 +0100 | [diff] [blame] | 846 | cbfs-files-$(CONFIG_HAVE_REFCODE_BLOB) += $(CONFIG_CBFS_PREFIX)/refcode |
| 847 | $(CONFIG_CBFS_PREFIX)/refcode-file := $(REFCODE_BLOB) |
| 848 | $(CONFIG_CBFS_PREFIX)/refcode-type := stage |
| 849 | $(CONFIG_CBFS_PREFIX)/refcode-compression := $(CBFS_COMPRESS_FLAG) |
| 850 | |
| 851 | cbfs-files-$(CONFIG_SEABIOS_VGA_COREBOOT) += vgaroms/seavgabios.bin |
| 852 | vgaroms/seavgabios.bin-file := $(CONFIG_PAYLOAD_VGABIOS_FILE) |
| 853 | vgaroms/seavgabios.bin-type := raw |
| 854 | |
| 855 | cbfs-files-$(CONFIG_PXE_ROM) += pci$(CONFIG_PXE_ROM_ID).rom |
| 856 | pci$(CONFIG_PXE_ROM_ID).rom-file := $(CONFIG_PXE_ROM_FILE) |
| 857 | pci$(CONFIG_PXE_ROM_ID).rom-type := raw |
| 858 | |
Patrick Georgi | 551b383 | 2015-11-25 18:47:56 +0100 | [diff] [blame] | 859 | cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += config |
| 860 | config-file := $(DOTCONFIG):defconfig |
| 861 | config-type := raw |
| 862 | |
| 863 | cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += revision |
| 864 | revision-file := $(obj)/build.h |
| 865 | revision-type := raw |
| 866 | |
Konstantin Aladyshev | 6544cb3 | 2015-01-24 18:52:10 +0400 | [diff] [blame] | 867 | cbfs-files-$(CONFIG_BOOTSPLASH_IMAGE) += bootsplash.jpg |
Furquan Shaikh | 88ca81a | 2014-04-22 16:33:22 -0700 | [diff] [blame] | 868 | bootsplash.jpg-file := $(call strip_quotes,$(CONFIG_BOOTSPLASH_FILE)) |
| 869 | bootsplash.jpg-type := bootsplash |
| 870 | |
Stefan Reinauer | d06258c | 2015-03-26 16:29:00 -0700 | [diff] [blame] | 871 | cbfs-files-$(CONFIG_BOARD_ID_MANUAL) += board_id |
| 872 | board_id-file := $(obj)/board_id |
| 873 | board_id-type := raw |
| 874 | |
| 875 | $(obj)/board_id: |
Vladimir Serbinenko | 93af2f2 | 2015-05-30 23:13:48 +0200 | [diff] [blame] | 876 | printf $(CONFIG_BOARD_ID_STRING) > $@ |
Stefan Reinauer | d06258c | 2015-03-26 16:29:00 -0700 | [diff] [blame] | 877 | |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 878 | junit.xml: |
Martin Roth | 917acb5 | 2015-10-21 15:28:21 -0600 | [diff] [blame] | 879 | echo "Building $(UTIL)" |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 880 | echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 881 | echo "<testcase classname='$(UTIL)' name='$(UTIL)'>" >> $@.tmp |
Martin Roth | 917acb5 | 2015-10-21 15:28:21 -0600 | [diff] [blame] | 882 | -$(MAKE) -j $(CPUS) -C "util/$(UTIL)" clean distclean > $@.tmp.2 2>&1 |
| 883 | $(MAKE) -j $(CPUS) -C "util/$(UTIL)" >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \ |
| 884 | cat $@.tmp.2; \ |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 885 | if [ "$$type" = "failure" ]; then \ |
| 886 | echo "<failure type='buildFailed'>" >> $@.tmp; \ |
Martin Roth | 917acb5 | 2015-10-21 15:28:21 -0600 | [diff] [blame] | 887 | echo "Building $(UTIL) Failed"; \ |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 888 | else \ |
| 889 | echo "<$$type>" >> $@.tmp; \ |
Martin Roth | 917acb5 | 2015-10-21 15:28:21 -0600 | [diff] [blame] | 890 | echo "Building $(UTIL) Succeeded"; \ |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 891 | fi; \ |
| 892 | echo '<![CDATA[' >> $@.tmp; \ |
| 893 | cat $@.tmp.2 >> $@.tmp; \ |
| 894 | echo "]]></$$type>" >>$@.tmp |
| 895 | rm -f $@.tmp.2 |
| 896 | echo "</testcase>" >> $@.tmp |
| 897 | echo "</testsuite>" >> $@.tmp |
| 898 | mv $@.tmp "util/$(UTIL)/$@" |
Martin Roth | 917acb5 | 2015-10-21 15:28:21 -0600 | [diff] [blame] | 899 | echo |
Martin Roth | de9adeb | 2015-10-15 14:33:31 -0600 | [diff] [blame] | 900 | |
Paul Menzel | d98471c | 2015-10-18 11:45:52 +0200 | [diff] [blame] | 901 | TOOLLIST= \ |
| 902 | cbmem \ |
Martin Roth | 1fec04b | 2015-10-21 15:29:13 -0600 | [diff] [blame] | 903 | ectool \ |
Paul Menzel | d98471c | 2015-10-18 11:45:52 +0200 | [diff] [blame] | 904 | inteltool \ |
Paul Menzel | 28a45d4 | 2015-10-18 11:47:45 +0200 | [diff] [blame] | 905 | intelvbttool \ |
Martin Roth | 1fec04b | 2015-10-21 15:29:13 -0600 | [diff] [blame] | 906 | nvramtool \ |
| 907 | superiotool \ |
| 908 | viatool |
Patrick Georgi | e151407 | 2015-07-31 16:54:12 +0200 | [diff] [blame] | 909 | JENKINS_PAYLOAD?=none |
Patrick Georgi | c6a4aae | 2015-07-31 16:54:44 +0200 | [diff] [blame] | 910 | CPUS?=4 |
Patrick Georgi | 062e408 | 2014-08-29 20:10:38 +0200 | [diff] [blame] | 911 | what-jenkins-does: |
Martin Roth | 8d226f2 | 2015-10-13 15:08:01 -0600 | [diff] [blame] | 912 | util/lint/lint lint-stable --junit |
Martin Roth | 615f69e | 2015-10-13 12:29:19 -0600 | [diff] [blame] | 913 | util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml |
Patrick Georgi | c6a4aae | 2015-07-31 16:54:44 +0200 | [diff] [blame] | 914 | util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) |
Patrick Georgi | b551d8b | 2015-07-31 16:39:06 +0200 | [diff] [blame] | 915 | (cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml) |
Martin Roth | 917acb5 | 2015-10-21 15:28:21 -0600 | [diff] [blame] | 916 | $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) UTIL="$(tool)" MFLAGS= MAKEFLAGS= junit.xml; ) |