Jacob Garber | 005fe89 | 2020-05-12 22:37:39 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: BSD-3-Clause |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 2 | |
Himanshu Sahdev | d1e18d9 | 2019-09-16 15:55:03 +0530 | [diff] [blame] | 3 | ifneq ($(words $(CURDIR)),1) |
| 4 | $(error Error: Path to the main directory cannot contain spaces) |
| 5 | endif |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 6 | top := $(CURDIR) |
| 7 | src := src |
| 8 | srck := $(top)/util/kconfig |
Vadim Bendebury | 5f7e4f0 | 2015-05-06 21:00:10 -0700 | [diff] [blame] | 9 | obj ?= build |
| 10 | override obj := $(subst $(top)/,,$(abspath $(obj))) |
Raul E Rangel | 81ff33c | 2019-07-11 10:44:21 -0600 | [diff] [blame] | 11 | xcompile ?= $(obj)/xcompile |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 12 | objutil ?= $(obj)/util |
| 13 | objk := $(objutil)/kconfig |
Vadim Bendebury | 5f7e4f0 | 2015-05-06 21:00:10 -0700 | [diff] [blame] | 14 | absobj := $(abspath $(obj)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 15 | |
Nico Huber | 10a879e | 2021-03-06 13:12:34 +0100 | [diff] [blame] | 16 | additional-dirs := |
| 17 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 18 | VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib) |
| 19 | |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 20 | COREBOOT_EXPORTS := COREBOOT_EXPORTS |
| 21 | COREBOOT_EXPORTS += top src srck obj objutil objk |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 22 | |
Alexander Couzens | be756f1 | 2019-09-13 04:22:12 +0200 | [diff] [blame] | 23 | # reproducible builds |
| 24 | LANG:=C |
| 25 | LC_ALL:=C |
| 26 | TZ:=UTC0 |
Alexander Couzens | ada431e | 2021-03-09 03:29:18 +0100 | [diff] [blame] | 27 | # don't use COREBOOT_EXPORTS to ensure build steps outside the coreboot build system |
| 28 | # are reproducible |
| 29 | export LANG LC_ALL TZ |
Alexander Couzens | be756f1 | 2019-09-13 04:22:12 +0200 | [diff] [blame] | 30 | |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 31 | DOTCONFIG ?= $(top)/.config |
| 32 | KCONFIG_CONFIG = $(DOTCONFIG) |
Nico Huber | 533bc0a | 2019-01-01 19:03:33 +0100 | [diff] [blame] | 33 | KCONFIG_AUTOADS := $(obj)/cb-config.ads |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 34 | KCONFIG_AUTOHEADER := $(obj)/config.h |
| 35 | KCONFIG_AUTOCONFIG := $(obj)/auto.conf |
| 36 | KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd |
| 37 | KCONFIG_SPLITCONFIG := $(obj)/config |
| 38 | KCONFIG_TRISTATE := $(obj)/tristate.conf |
| 39 | KCONFIG_NEGATIVES := 1 |
| 40 | KCONFIG_STRICT := 1 |
Nico Huber | 533bc0a | 2019-01-01 19:03:33 +0100 | [diff] [blame] | 41 | KCONFIG_PACKAGE := CB.Config |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 42 | |
| 43 | COREBOOT_EXPORTS += KCONFIG_CONFIG KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG |
| 44 | COREBOOT_EXPORTS += KCONFIG_DEPENDENCIES KCONFIG_SPLITCONFIG KCONFIG_TRISTATE |
| 45 | COREBOOT_EXPORTS += KCONFIG_NEGATIVES KCONFIG_STRICT |
Nico Huber | 533bc0a | 2019-01-01 19:03:33 +0100 | [diff] [blame] | 46 | COREBOOT_EXPORTS += KCONFIG_AUTOADS KCONFIG_PACKAGE |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 47 | |
Patrick Georgi | e38d0a6 | 2011-03-01 08:09:22 +0000 | [diff] [blame] | 48 | # directory containing the toplevel Makefile.inc |
| 49 | TOPLEVEL := . |
| 50 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 51 | CONFIG_SHELL := sh |
| 52 | KBUILD_DEFCONFIG := configs/defconfig |
| 53 | UNAME_RELEASE := $(shell uname -r) |
Patrick Georgi | 89ec376 | 2010-12-08 19:58:30 +0000 | [diff] [blame] | 54 | HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 55 | MAKEFLAGS += -rR --no-print-directory |
| 56 | |
| 57 | # Make is silent per default, but 'make V=1' will show all compiler calls. |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 58 | Q:=@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 59 | ifneq ($(V),1) |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 60 | ifneq ($(Q),) |
| 61 | .SILENT: |
Nico Huber | 7325ac5 | 2020-02-16 11:47:52 +0100 | [diff] [blame] | 62 | MAKEFLAGS += -s |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 63 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 64 | endif |
| 65 | |
Julius Werner | 808a429 | 2015-03-13 11:05:07 -0700 | [diff] [blame] | 66 | # Disable implicit/built-in rules to make Makefile errors fail fast. |
| 67 | .SUFFIXES: |
| 68 | |
Patrick Georgi | b3a18ac | 2012-09-13 22:13:33 +0200 | [diff] [blame] | 69 | HOSTCFLAGS := -g |
| 70 | HOSTCXXFLAGS := -g |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 71 | |
Patrick Georgi | 828e0e8 | 2015-04-04 15:50:20 +0200 | [diff] [blame] | 72 | PREPROCESS_ONLY := -E -P -x assembler-with-cpp -undef -I . |
| 73 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 74 | DOXYGEN := doxygen |
| 75 | DOXYGEN_OUTPUT_DIR := doxygen |
| 76 | |
Nico Huber | 7a1fbdb | 2017-08-23 23:48:13 +0200 | [diff] [blame] | 77 | export $(COREBOOT_EXPORTS) |
| 78 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 79 | all: real-all |
| 80 | |
Martin Roth | 4eea174 | 2015-11-25 11:50:04 -0700 | [diff] [blame] | 81 | help_coreboot help:: |
| 82 | @echo '*** coreboot platform targets ***' |
Martin Roth | 76f14b2 | 2015-11-18 13:09:23 -0700 | [diff] [blame] | 83 | @echo ' Use "make [target] V=1" for extra build debug information' |
| 84 | @echo ' all - Build coreboot' |
| 85 | @echo ' clean - Remove coreboot build artifacts' |
| 86 | @echo ' distclean - Remove build artifacts and config files' |
| 87 | @echo ' doxygen - Build doxygen documentation for coreboot' |
Martin Roth | b1574e3 | 2016-07-07 15:50:28 -0600 | [diff] [blame] | 88 | @echo ' doxyplatform - Build doxygen documentation for the current platform' |
Patrick Rudolph | f664321 | 2020-05-17 20:04:12 +0200 | [diff] [blame] | 89 | @echo ' sphinx - Build sphinx documentation for coreboot' |
| 90 | @echo ' sphinx-lint - Build sphinx documenttion for coreboot with warnings as errors' |
Martin Roth | 763e493 | 2018-01-27 16:42:43 -0700 | [diff] [blame] | 91 | @echo ' filelist - Show files used in current build' |
Martin Roth | 76f14b2 | 2015-11-18 13:09:23 -0700 | [diff] [blame] | 92 | @echo ' printall - print makefile info for debugging' |
Werner Zeh | 2de6410 | 2016-01-12 12:45:49 +0100 | [diff] [blame] | 93 | @echo ' gitconfig - set up git to submit patches to coreboot' |
Martin Roth | 76f14b2 | 2015-11-18 13:09:23 -0700 | [diff] [blame] | 94 | @echo ' ctags / ctags-project - make ctags file for all of coreboot or current board' |
| 95 | @echo ' cscope / cscope-project - make cscope.out file for coreboot or current board' |
| 96 | @echo |
| 97 | |
Patrick Georgi | e38d0a6 | 2011-03-01 08:09:22 +0000 | [diff] [blame] | 98 | # This include must come _before_ the pattern rules below! |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 99 | # Order _does_ matter for pattern rules. |
Patrick Georgi | 3e8ef10 | 2019-11-22 16:54:17 +0100 | [diff] [blame] | 100 | include $(srck)/Makefile.inc |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 101 | |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 102 | # Three cases where we don't need fully populated $(obj) lists: |
| 103 | # 1. when no .config exists |
| 104 | # 2. when make config (in any flavour) is run |
| 105 | # 3. when make distclean is run |
| 106 | # Don't waste time on reading all Makefile.incs in these cases |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 107 | ifeq ($(strip $(HAVE_DOTCONFIG)),) |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 108 | NOCOMPILE:=1 |
| 109 | endif |
| 110 | ifneq ($(MAKECMDGOALS),) |
Elyes HAOUAS | 91fb139 | 2020-01-20 15:33:11 +0100 | [diff] [blame] | 111 | ifneq ($(filter %config %clean cross% clang iasl lint% help% what-jenkins-does,$(MAKECMDGOALS)),) |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 112 | NOCOMPILE:=1 |
| 113 | endif |
Raul E Rangel | 5592cfd | 2019-07-23 11:13:40 -0600 | [diff] [blame] | 114 | ifneq ($(filter %clean lint% help% what-jenkins-does,$(MAKECMDGOALS)),) |
Zheng Bao | 0fd93d6 | 2012-10-22 16:36:03 +0800 | [diff] [blame] | 115 | NOMKDIR:=1 |
| 116 | endif |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 117 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 118 | |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 119 | ifneq ($(filter %-test %-tests,$(MAKECMDGOALS)),) |
| 120 | ifneq ($(filter-out %-test %-tests, $(MAKECMDGOALS)),) |
| 121 | $(error Cannot mix unit-tests targets with other targets) |
| 122 | endif |
| 123 | UNIT_TEST:=1 |
| 124 | NOCOMPILE:= |
| 125 | endif |
| 126 | |
Raul E Rangel | 81ff33c | 2019-07-11 10:44:21 -0600 | [diff] [blame] | 127 | $(xcompile): util/xcompile/xcompile |
Raul E Rangel | 6325ce2 | 2019-07-10 16:46:34 -0600 | [diff] [blame] | 128 | rm -f $@ |
| 129 | $< $(XGCCPATH) > $@.tmp |
| 130 | \mv -f $@.tmp $@ 2> /dev/null |
| 131 | rm -f $@.tmp |
| 132 | |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 133 | ifeq ($(NOCOMPILE),1) |
Patrick Georgi | b351875f | 2020-07-06 15:31:58 +0000 | [diff] [blame] | 134 | # We also don't use .xcompile in the no-compile situations, so |
| 135 | # provide some reasonable defaults. |
| 136 | HOSTCC ?= $(if $(shell type gcc 2>/dev/null),gcc,cc) |
| 137 | HOSTCXX ?= g++ |
| 138 | |
Patrick Georgi | e38d0a6 | 2011-03-01 08:09:22 +0000 | [diff] [blame] | 139 | include $(TOPLEVEL)/Makefile.inc |
Martin Roth | 6797557 | 2016-03-07 16:38:52 -0700 | [diff] [blame] | 140 | include $(TOPLEVEL)/payloads/Makefile.inc |
Martin Roth | e624e27 | 2017-07-31 11:52:58 -0600 | [diff] [blame] | 141 | include $(TOPLEVEL)/util/testing/Makefile.inc |
Werner Zeh | b7f1c2d | 2019-10-04 07:01:13 +0200 | [diff] [blame] | 142 | -include $(TOPLEVEL)/site-local/Makefile.inc |
Martin Roth | 20aa043 | 2017-01-26 10:51:43 -0700 | [diff] [blame] | 143 | real-all: |
| 144 | @echo "Error: Expected config file ($(DOTCONFIG)) not present." >&2 |
| 145 | @echo "Please specify a config file or run 'make menuconfig' to" >&2 |
| 146 | @echo "generate a new config file." >&2 |
| 147 | @exit 1 |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 148 | else |
| 149 | |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 150 | ifneq ($(UNIT_TEST),1) |
Paul Kocialkowski | 585c781 | 2016-07-13 11:00:41 +0200 | [diff] [blame] | 151 | include $(DOTCONFIG) |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 152 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 153 | |
Raul E Rangel | 81ff33c | 2019-07-11 10:44:21 -0600 | [diff] [blame] | 154 | # The toolchain requires xcompile to determine the ARCH_SUPPORTED, so we can't |
| 155 | # wait for make to generate the file. |
| 156 | $(if $(wildcard $(xcompile)),, $(shell \ |
| 157 | mkdir -p $(dir $(xcompile)) && \ |
| 158 | util/xcompile/xcompile $(XGCCPATH) > $(xcompile) || rm -f $(xcompile))) |
Patrick Georgi | 0ffef88 | 2017-01-19 23:20:14 +0100 | [diff] [blame] | 159 | |
Raul E Rangel | 81ff33c | 2019-07-11 10:44:21 -0600 | [diff] [blame] | 160 | include $(xcompile) |
Patrick Georgi | 6dda31d | 2015-11-19 15:15:33 +0100 | [diff] [blame] | 161 | |
| 162 | ifneq ($(XCOMPILE_COMPLETE),1) |
Raul E Rangel | 81ff33c | 2019-07-11 10:44:21 -0600 | [diff] [blame] | 163 | $(shell rm -f $(xcompile)) |
| 164 | $(error $(xcompile) deleted because it's invalid. \ |
Patrick Georgi | 6dda31d | 2015-11-19 15:15:33 +0100 | [diff] [blame] | 165 | Restarting the build should fix that, or explain the problem) |
| 166 | endif |
Patrick Georgi | 7b9762f | 2015-06-04 13:18:11 +0200 | [diff] [blame] | 167 | |
Patrick Georgi | cc84a00 | 2014-05-14 21:05:35 +0200 | [diff] [blame] | 168 | ifneq ($(CONFIG_MMX),y) |
| 169 | CFLAGS_x86_32 += -mno-mmx |
| 170 | endif |
| 171 | |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 172 | ifneq ($(UNIT_TEST),1) |
Patrick Georgi | cc84a00 | 2014-05-14 21:05:35 +0200 | [diff] [blame] | 173 | include toolchain.inc |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 174 | endif |
Patrick Georgi | cc84a00 | 2014-05-14 21:05:35 +0200 | [diff] [blame] | 175 | |
Zheng Bao | 0764892 | 2015-11-13 10:42:27 +0800 | [diff] [blame] | 176 | strip_quotes = $(strip $(subst ",,$(subst \",,$(1)))) |
Martin Roth | bbf1399 | 2016-01-25 15:59:24 -0700 | [diff] [blame] | 177 | # fix makefile syntax highlighting after strip macro \" ")) |
Patrick Georgi | a84e98b | 2010-03-16 19:01:32 +0000 | [diff] [blame] | 178 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 179 | # The primary target needs to be here before we include the |
| 180 | # other files |
| 181 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 182 | real-all: real-target |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 183 | |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 184 | # must come rather early |
| 185 | .SECONDEXPANSION: |
Raul E Rangel | cc6dc90 | 2018-08-06 16:13:32 -0600 | [diff] [blame] | 186 | .DELETE_ON_ERROR: |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 187 | |
Jonathan Neuschäfer | d2c0242 | 2018-12-11 13:06:40 +0100 | [diff] [blame] | 188 | $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) $(objutil)/kconfig/conf |
Patrick Georgi | 78a5f22 | 2017-01-30 15:29:34 +0100 | [diff] [blame] | 189 | +$(MAKE) oldconfig |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 190 | |
Nico Huber | 533bc0a | 2019-01-01 19:03:33 +0100 | [diff] [blame] | 191 | $(KCONFIG_AUTOCONFIG): $(KCONFIG_AUTOHEADER) |
| 192 | true |
| 193 | |
Nico Huber | eafc815 | 2019-10-25 12:47:14 +0200 | [diff] [blame] | 194 | $(KCONFIG_AUTOADS): $(KCONFIG_CONFIG) $(KCONFIG_AUTOHEADER) $(objutil)/kconfig/toada |
Nico Huber | 533bc0a | 2019-01-01 19:03:33 +0100 | [diff] [blame] | 195 | $(objutil)/kconfig/toada CB.Config <$< >$@ |
| 196 | |
Nico Huber | b567977 | 2019-01-01 22:06:01 +0100 | [diff] [blame] | 197 | $(obj)/%/$(notdir $(KCONFIG_AUTOADS)): $(KCONFIG_AUTOADS) |
| 198 | cp $< $@ |
| 199 | |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 200 | # Add a new class of source/object files to the build system |
| 201 | add-class= \ |
| 202 | $(eval $(1)-srcs:=) \ |
| 203 | $(eval $(1)-objs:=) \ |
| 204 | $(eval classes+=$(1)) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 205 | |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 206 | # Special classes are managed types with special behaviour |
| 207 | # On parse time, for each entry in variable $(1)-y |
| 208 | # a handler $(1)-handler is executed with the arguments: |
| 209 | # * $(1): directory the parser is in |
| 210 | # * $(2): current entry |
| 211 | add-special-class= \ |
| 212 | $(eval $(1):=) \ |
| 213 | $(eval special-classes+=$(1)) |
| 214 | |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 215 | # Converts one or more source file paths to their corresponding build/ paths. |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 216 | # Only .ads, adb, .c and .S get converted to .o, other files (like .ld) keep |
| 217 | # their name. |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 218 | # $1 stage name |
| 219 | # $2 file path (list) |
Nico Huber | 98fc426 | 2016-01-23 01:24:33 +0100 | [diff] [blame] | 220 | src-to-obj=\ |
| 221 | $(patsubst $(obj)/%,$(obj)/$(1)/%,\ |
| 222 | $(patsubst $(obj)/$(1)/%,$(obj)/%,\ |
Nico Huber | d011b6b | 2016-10-05 17:41:31 +0200 | [diff] [blame] | 223 | $(patsubst 3rdparty/%,$(obj)/%,\ |
Nico Huber | 98fc426 | 2016-01-23 01:24:33 +0100 | [diff] [blame] | 224 | $(patsubst src/%,$(obj)/%,\ |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 225 | $(patsubst %.ads,%.o,\ |
| 226 | $(patsubst %.adb,%.o,\ |
Nico Huber | 98fc426 | 2016-01-23 01:24:33 +0100 | [diff] [blame] | 227 | $(patsubst %.c,%.o,\ |
| 228 | $(patsubst %.S,%.o,\ |
Nico Huber | d011b6b | 2016-10-05 17:41:31 +0200 | [diff] [blame] | 229 | $(subst .$(1),,$(2)))))))))) |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 230 | |
| 231 | # Converts one or more source file paths to the corresponding build/ paths |
| 232 | # of their Ada library information (.ali) files. |
| 233 | # $1 stage name |
| 234 | # $2 file path (list) |
| 235 | src-to-ali=\ |
| 236 | $(patsubst $(obj)/%,$(obj)/$(1)/%,\ |
| 237 | $(patsubst $(obj)/$(1)/%,$(obj)/%,\ |
Nico Huber | d011b6b | 2016-10-05 17:41:31 +0200 | [diff] [blame] | 238 | $(patsubst 3rdparty/%,$(obj)/%,\ |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 239 | $(patsubst src/%,$(obj)/%,\ |
| 240 | $(patsubst %.ads,%.ali,\ |
| 241 | $(patsubst %.adb,%.ali,\ |
| 242 | $(subst .$(1),,\ |
Nico Huber | d011b6b | 2016-10-05 17:41:31 +0200 | [diff] [blame] | 243 | $(filter %.ads %.adb,$(2))))))))) |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 244 | |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 245 | # Clean -y variables, include Makefile.inc |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 246 | # Add paths to files in X-y to X-srcs |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 247 | # Add subdirs-y to subdirs |
| 248 | includemakefiles= \ |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 249 | $(foreach class,classes subdirs $(classes) $(special-classes), $(eval $(class)-y:=)) \ |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 250 | $(eval -include $(1)) \ |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 251 | $(foreach class,$(classes-y), $(call add-class,$(class))) \ |
Arthur Heymans | 5e5fd41 | 2019-06-04 13:16:28 +0200 | [diff] [blame] | 252 | $(foreach special,$(special-classes), \ |
| 253 | $(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \ |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 254 | $(foreach class,$(classes), \ |
| 255 | $(eval $(class)-srcs+= \ |
Vadim Bendebury | 5f7e4f0 | 2015-05-06 21:00:10 -0700 | [diff] [blame] | 256 | $$(subst $(absobj)/,$(obj)/, \ |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 257 | $$(subst $(top)/,, \ |
Vadim Bendebury | 5f7e4f0 | 2015-05-06 21:00:10 -0700 | [diff] [blame] | 258 | $$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \ |
Patrick Georgi | 64b8fba | 2017-10-28 05:26:01 -0400 | [diff] [blame] | 259 | $(eval subdirs+=$$(subst $(CURDIR)/,,$$(wildcard $$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))) |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 260 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 261 | # For each path in $(subdirs) call includemakefiles |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 262 | # Repeat until subdirs is empty |
| 263 | evaluate_subdirs= \ |
| 264 | $(eval cursubdirs:=$(subdirs)) \ |
| 265 | $(eval subdirs:=) \ |
| 266 | $(foreach dir,$(cursubdirs), \ |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 267 | $(eval $(call includemakefiles,$(dir)/Makefile.inc))) \ |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 268 | $(if $(subdirs),$(eval $(call evaluate_subdirs))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 269 | |
| 270 | # collect all object files eligible for building |
Patrick Georgi | e38d0a6 | 2011-03-01 08:09:22 +0000 | [diff] [blame] | 271 | subdirs:=$(TOPLEVEL) |
Julius Werner | e91d170 | 2017-03-20 15:32:15 -0700 | [diff] [blame] | 272 | postinclude-hooks := |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 273 | |
| 274 | # Don't iterate through Makefile.incs under src/ when building tests |
| 275 | ifneq ($(UNIT_TEST),1) |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 276 | $(eval $(call evaluate_subdirs)) |
Jan Dabros | ef1c968 | 2020-03-28 00:15:03 +0100 | [diff] [blame] | 277 | else |
| 278 | include $(TOPLEVEL)/tests/Makefile.inc |
| 279 | endif |
| 280 | |
Patrick Georgi | 70c85ea | 2013-02-16 01:06:57 +0100 | [diff] [blame] | 281 | ifeq ($(FAILBUILD),1) |
| 282 | $(error cannot continue build) |
| 283 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 284 | |
Julius Werner | e91d170 | 2017-03-20 15:32:15 -0700 | [diff] [blame] | 285 | # Run hooks registered by subdirectories that need to be evaluated after all files have been parsed |
| 286 | $(eval $(postinclude-hooks)) |
| 287 | |
Patrick Georgi | 94a4586 | 2011-10-25 14:32:21 -0700 | [diff] [blame] | 288 | # Eliminate duplicate mentions of source files in a class |
| 289 | $(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs)))) |
| 290 | |
Nico Huber | b567977 | 2019-01-01 22:06:01 +0100 | [diff] [blame] | 291 | # Build Kconfig .ads if necessary |
| 292 | ifeq ($(CONFIG_RAMSTAGE_ADA),y) |
| 293 | ramstage-srcs += $(obj)/ramstage/$(notdir $(KCONFIG_AUTOADS)) |
| 294 | endif |
| 295 | |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 296 | # To track dependencies, we need all Ada specification (.ads) files in |
| 297 | # *-srcs. Extract / filter all specification files that have a matching |
| 298 | # body (.adb) file here (specifications without a body are valid sources |
| 299 | # in Ada). |
| 300 | $(foreach class,$(classes),$(eval $(class)-extra-specs := \ |
| 301 | $(filter \ |
| 302 | $(addprefix %/,$(patsubst %.adb,%.ads,$(notdir $(filter %.adb,$($(class)-srcs))))), \ |
| 303 | $(filter %.ads,$($(class)-srcs))))) |
| 304 | $(foreach class,$(classes),$(eval $(class)-srcs := \ |
| 305 | $(filter-out $($(class)-extra-specs),$($(class)-srcs)))) |
| 306 | |
Patrick Georgi | 10f86b0 | 2015-03-27 16:56:23 +0100 | [diff] [blame] | 307 | $(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class),$($(class)-srcs)))) |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 308 | $(foreach class,$(classes),$(eval $(class)-alis:=$(call src-to-ali,$(class),$($(class)-srcs)))) |
| 309 | |
| 310 | # For Ada includes |
| 311 | $(foreach class,$(classes),$(eval $(class)-ada-dirs:=$(sort $(dir $(filter %.ads %.adb,$($(class)-srcs)) $($(class)-extra-specs))))) |
Patrick Georgi | d3428b0 | 2010-02-24 13:18:01 +0000 | [diff] [blame] | 312 | |
Nico Huber | 963bed5 | 2013-05-15 11:47:51 +0200 | [diff] [blame] | 313 | # Save all objs before processing them (for dependency inclusion) |
| 314 | originalobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var))) |
| 315 | |
Patrick Georgi | 79f9010 | 2012-11-25 14:31:08 +0100 | [diff] [blame] | 316 | # Call post-processors if they're defined |
| 317 | $(foreach class,$(classes),\ |
| 318 | $(if $(value $(class)-postprocess),$(eval $(call $(class)-postprocess,$($(class)-objs))))) |
| 319 | |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 320 | allsrcs:=$(foreach var, $(addsuffix -srcs,$(classes)), $($(var))) |
| 321 | allobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 322 | alldirs:=$(sort $(abspath $(dir $(allobjs)))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 323 | |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 324 | # Reads dependencies from an Ada library information (.ali) file |
| 325 | # Only basenames (with suffix) are preserved so we have to look the |
| 326 | # paths up in $($(stage)-srcs). |
| 327 | # $1 stage name |
| 328 | # $2 ali file |
| 329 | create_ada_deps=$$(if $(2),\ |
| 330 | gnat.adc \ |
| 331 | $$(filter \ |
| 332 | $$(addprefix %/,$$(shell sed -ne's/^D \([^\t]\+\).*$$$$/\1/p' $(2) 2>/dev/null)), \ |
| 333 | $$($(1)-srcs) $$($(1)-extra-specs))) |
| 334 | |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 335 | # macro to define template macros that are used by use_template macro |
| 336 | define create_cc_template |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 337 | # $1 obj class |
Patrick Georgi | 990e7c9 | 2015-04-03 10:47:15 +0200 | [diff] [blame] | 338 | # $2 source suffix (c, S, ld, ...) |
Marc Jones | a38ccfd | 2014-11-06 15:50:22 -0700 | [diff] [blame] | 339 | # $3 additional compiler flags |
| 340 | # $4 additional dependencies |
Patrick Georgi | b8cdd9b | 2011-02-17 20:48:45 +0000 | [diff] [blame] | 341 | ifn$(EMPTY)def $(1)-objs_$(2)_template |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 342 | de$(EMPTY)fine $(1)-objs_$(2)_template |
Nico Huber | 1850aa6 | 2017-09-03 23:42:58 +0200 | [diff] [blame] | 343 | ifn$(EMPTY)eq ($(filter ads adb,$(2)),) |
Nico Huber | b567977 | 2019-01-01 22:06:01 +0100 | [diff] [blame] | 344 | $$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $$(call create_ada_deps,$1,$$(call src-to-ali,$1,$$(1).$2)) $(4) |
Nico Huber | 1850aa6 | 2017-09-03 23:42:58 +0200 | [diff] [blame] | 345 | @printf " GCC $$$$(subst $$$$(obj)/,,$$$$(@))\n" |
| 346 | $(GCC_$(1)) \ |
| 347 | $$$$(ADAFLAGS_$(1)) $$$$(addprefix -I,$$$$($(1)-ada-dirs)) \ |
| 348 | $(3) -c -o $$$$@ $$$$< |
| 349 | el$(EMPTY)se |
| 350 | $$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $(KCONFIG_AUTOHEADER) $(4) |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 351 | @printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n" |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 352 | $(CC_$(1)) \ |
Nico Huber | 1850aa6 | 2017-09-03 23:42:58 +0200 | [diff] [blame] | 353 | -MMD $$$$(CPPFLAGS_$(1)) $$$$(CFLAGS_$(1)) -MT $$$$(@) \ |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 354 | $(3) -c -o $$$$@ $$$$< |
Nico Huber | 1850aa6 | 2017-09-03 23:42:58 +0200 | [diff] [blame] | 355 | end$(EMPTY)if |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 356 | en$(EMPTY)def |
Patrick Georgi | b8cdd9b | 2011-02-17 20:48:45 +0000 | [diff] [blame] | 357 | end$(EMPTY)if |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 358 | endef |
| 359 | |
Patrick Georgi | b8cdd9b | 2011-02-17 20:48:45 +0000 | [diff] [blame] | 360 | filetypes-of-class=$(subst .,,$(sort $(suffix $($(1)-srcs)))) |
| 361 | $(foreach class,$(classes), \ |
| 362 | $(foreach type,$(call filetypes-of-class,$(class)), \ |
Patrick Georgi | 2459aee | 2015-03-27 15:27:21 +0100 | [diff] [blame] | 363 | $(eval $(class)-$(type)-ccopts += $(generic-$(type)-ccopts) $($(class)-generic-ccopts)) \ |
Patrick Georgi | 416ab38 | 2015-04-03 10:19:38 +0200 | [diff] [blame] | 364 | $(if $(generic-objs_$(type)_template_gen),$(eval $(call generic-objs_$(type)_template_gen,$(class))),\ |
| 365 | $(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts),$($(class)-$(type)-deps)))))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 366 | |
Patrick Georgi | d69839b | 2015-04-03 10:32:17 +0200 | [diff] [blame] | 367 | foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(basename $(file))))) |
Patrick Georgi | 5826265 | 2011-02-17 20:47:49 +0000 | [diff] [blame] | 368 | $(eval $(foreach class,$(classes),$(call foreach-src,$(class)))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 369 | |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 370 | # To supported complex package initializations, we need to call the |
| 371 | # emitted code explicitly. gnatbind gathers all the calls for us |
| 372 | # and exports them as a procedure $(stage)_adainit(). Every stage that |
| 373 | # uses Ada code has to call it! |
| 374 | define gnatbind_template |
| 375 | # $1 class |
| 376 | $$(obj)/$(1)/b__$(1).adb: $$$$(filter-out $$(obj)/$(1)/b__$(1).ali,$$$$($(1)-alis)) |
| 377 | @printf " BIND $$(subst $$(obj)/,,$$@)\n" |
| 378 | # We have to give gnatbind a simple filename (without leading |
| 379 | # path components) so just cd there. |
| 380 | cd $$(dir $$@) && \ |
| 381 | $$(GNATBIND_$(1)) -a -n \ |
Nico Huber | be5492a | 2015-09-29 16:41:19 +0200 | [diff] [blame] | 382 | --RTS=$$(absobj)/libgnat-$$(ARCH-$(1)-y)/ \ |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 383 | -L$(1)_ada -o $$(notdir $$@) \ |
| 384 | $$(subst $$(dir $$@),,$$^) |
| 385 | $$(obj)/$(1)/b__$(1).o: $$(obj)/$(1)/b__$(1).adb |
Nico Huber | 1850aa6 | 2017-09-03 23:42:58 +0200 | [diff] [blame] | 386 | @printf " GCC $$(subst $$(obj)/,,$$@)\n" |
| 387 | $(GCC_$(1)) $$(ADAFLAGS_$(1)) -c -o $$@ $$< |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 388 | $(1)-objs += $$(obj)/$(1)/b__$(1).o |
Nico Huber | ddb2465 | 2016-09-19 11:50:04 +0200 | [diff] [blame] | 389 | $($(1)-alis): %.ali: %.o ; |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 390 | endef |
| 391 | |
Nico Huber | be5492a | 2015-09-29 16:41:19 +0200 | [diff] [blame] | 392 | $(eval $(foreach class,$(filter-out libgnat-%,$(classes)), \ |
Nico Huber | 2e09d2b | 2016-01-14 01:13:33 +0100 | [diff] [blame] | 393 | $(if $($(class)-alis),$(call gnatbind_template,$(class))))) |
| 394 | |
Julius Werner | f97b88b | 2014-12-05 12:32:09 -0800 | [diff] [blame] | 395 | DEPENDENCIES += $(addsuffix .d,$(basename $(allobjs))) |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 396 | -include $(DEPENDENCIES) |
| 397 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 398 | printall: |
Martin Roth | 09b6444 | 2016-06-05 10:52:43 -0600 | [diff] [blame] | 399 | @$(foreach class,$(classes), echo $(class)-objs: $($(class)-objs) | tr ' ' '\n'; echo; ) |
| 400 | @echo alldirs: $(alldirs) | tr ' ' '\n'; echo |
| 401 | @echo allsrcs: $(allsrcs) | tr ' ' '\n'; echo |
| 402 | @echo DEPENDENCIES: $(DEPENDENCIES) | tr ' ' '\n'; echo |
| 403 | @$(foreach class,$(special-classes),echo $(class):'$($(class))' | tr ' ' '\n'; echo; ) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 404 | endif |
| 405 | |
Patrick Georgi | 40ad842 | 2011-05-21 22:18:59 +0000 | [diff] [blame] | 406 | ifndef NOMKDIR |
Stefan Reinauer | de60c88 | 2015-06-29 14:44:37 -0700 | [diff] [blame] | 407 | $(shell mkdir -p $(KCONFIG_SPLITCONFIG) $(objk)/lxdialog $(additional-dirs) $(alldirs)) |
Patrick Georgi | 40ad842 | 2011-05-21 22:18:59 +0000 | [diff] [blame] | 408 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 409 | |
Martin Roth | 9b0204d | 2017-09-18 09:25:18 -0600 | [diff] [blame] | 410 | $(obj)/project_filelist.txt: |
| 411 | if [ -z "$(wildcard $(obj)/coreboot.rom)" ]; then \ |
| 412 | echo "*** Error: Project must be built before generating file list ***"; \ |
| 413 | exit 1; \ |
| 414 | fi |
Martin Roth | 8a02727 | 2017-09-26 09:53:30 -0600 | [diff] [blame] | 415 | find $(obj) -path "$(obj)/util" -prune -o -name "*.d" -exec cat {} \; | \ |
| 416 | sed "s|$(top)/||" | sed 's/[:\\]/ /g' | sed 's/ /\n/g' | sort | uniq | \ |
Martin Roth | 9c1b33e | 2015-07-29 14:55:18 -0700 | [diff] [blame] | 417 | grep -v '\.o$$' > $(obj)/project_filelist.txt |
| 418 | |
Martin Roth | 9b0204d | 2017-09-18 09:25:18 -0600 | [diff] [blame] | 419 | filelist: $(obj)/project_filelist.txt |
Martin Roth | a18353d | 2017-06-06 06:44:46 -0600 | [diff] [blame] | 420 | printf "\nFiles used in build:\n" |
| 421 | cat $(obj)/project_filelist.txt |
| 422 | |
Martin Roth | 9c1b33e | 2015-07-29 14:55:18 -0700 | [diff] [blame] | 423 | #works with either exuberant ctags or ctags.emacs |
| 424 | ctags-project: clean-ctags $(obj)/project_filelist.txt |
| 425 | cat $(obj)/project_filelist.txt | \ |
| 426 | xargs ctags -o tags |
| 427 | |
| 428 | cscope-project: clean-cscope $(obj)/project_filelist.txt |
| 429 | cat $(obj)/project_filelist.txt | xargs cscope -b |
| 430 | |
Warren Turkal | a9fc330 | 2010-09-03 08:57:32 +0000 | [diff] [blame] | 431 | cscope: |
| 432 | cscope -bR |
| 433 | |
Patrick Rudolph | f664321 | 2020-05-17 20:04:12 +0200 | [diff] [blame] | 434 | sphinx: |
| 435 | $(MAKE) -C Documentation -f Makefile.sphinx html |
| 436 | |
| 437 | sphinx-lint: |
| 438 | $(MAKE) SPHINXOPTS=-W -C Documentation -f Makefile.sphinx html |
| 439 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 440 | doxy: doxygen |
| 441 | doxygen: |
Nicky Sielicki | e08a2a5 | 2015-06-06 08:55:16 -0500 | [diff] [blame] | 442 | $(DOXYGEN) Documentation/Doxyfile.coreboot |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 443 | |
Martin Roth | d7689e4 | 2014-12-29 14:56:19 -0700 | [diff] [blame] | 444 | doxygen_simple: |
Nicky Sielicki | e08a2a5 | 2015-06-06 08:55:16 -0500 | [diff] [blame] | 445 | $(DOXYGEN) Documentation/Doxyfile.coreboot_simple |
Martin Roth | d7689e4 | 2014-12-29 14:56:19 -0700 | [diff] [blame] | 446 | |
Martin Roth | b1574e3 | 2016-07-07 15:50:28 -0600 | [diff] [blame] | 447 | doxyplatform doxygen_platform: $(obj)/project_filelist.txt |
| 448 | echo |
| 449 | echo "Building doxygen documentation for $(CONFIG_MAINBOARD_PART_NUMBER)" |
Martin Roth | 09e032e | 2020-10-25 19:44:38 -0600 | [diff] [blame] | 450 | export DOXYGEN_OUTPUT_DIR="$$( echo $(DOXYGEN_OUTPUT_DIR)/$(call strip_quotes, $(CONFIG_MAINBOARD_VENDOR))_$(call strip_quotes, $(CONFIG_MAINBOARD_PART_NUMBER)) | sed 's|[^A-Za-z0-9/]|_|g' )"; \ |
Martin Roth | b1574e3 | 2016-07-07 15:50:28 -0600 | [diff] [blame] | 451 | mkdir -p "$$DOXYGEN_OUTPUT_DIR"; \ |
| 452 | export DOXYFILES="$$(cat $(obj)/project_filelist.txt | grep -v '\.ld$$' | sed 's/\.aml/\.dsl/' | tr '\n' ' ')"; \ |
Martin Roth | 09e032e | 2020-10-25 19:44:38 -0600 | [diff] [blame] | 453 | export DOXYGEN_PLATFORM="$(call strip_quotes, $(CONFIG_MAINBOARD_DIR)) \($(call strip_quotes, $(CONFIG_MAINBOARD_PART_NUMBER))\) version $(KERNELVERSION)"; \ |
Martin Roth | b1574e3 | 2016-07-07 15:50:28 -0600 | [diff] [blame] | 454 | $(DOXYGEN) Documentation/doxygen/Doxyfile.coreboot_platform |
| 455 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 456 | doxyclean: doxygen-clean |
| 457 | doxygen-clean: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 458 | rm -rf $(DOXYGEN_OUTPUT_DIR) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 459 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 460 | clean-for-update: doxygen-clean clean-for-update-target |
Patrick Georgi | 02ae0bf | 2013-02-09 15:45:02 +0100 | [diff] [blame] | 461 | rm -rf $(obj) .xcompile |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 462 | |
Martin Roth | 20cd54f | 2017-03-26 18:49:02 -0600 | [diff] [blame] | 463 | clean: clean-for-update clean-target clean-utils |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 464 | rm -f .ccwrap |
Warren Turkal | 0e8f204 | 2010-09-27 21:14:19 +0000 | [diff] [blame] | 465 | |
Warren Turkal | a9fc330 | 2010-09-03 08:57:32 +0000 | [diff] [blame] | 466 | clean-cscope: |
| 467 | rm -f cscope.out |
| 468 | |
Martin Roth | 9c1b33e | 2015-07-29 14:55:18 -0700 | [diff] [blame] | 469 | clean-ctags: |
| 470 | rm -f tags |
| 471 | |
Martin Roth | 20cd54f | 2017-03-26 18:49:02 -0600 | [diff] [blame] | 472 | clean-utils: |
Martin Roth | 1d721ed | 2017-07-07 10:49:48 -0600 | [diff] [blame] | 473 | $(foreach tool, $(TOOLLIST), \ |
| 474 | $(MAKE) -C util/$(tool) clean MFLAGS= MAKEFLAGS= ;) |
Martin Roth | 20cd54f | 2017-03-26 18:49:02 -0600 | [diff] [blame] | 475 | |
| 476 | distclean-utils: |
Martin Roth | 1d721ed | 2017-07-07 10:49:48 -0600 | [diff] [blame] | 477 | $(foreach tool, $(TOOLLIST), \ |
| 478 | $(MAKE) -C util/$(tool) distclean MFLAGS= MAKEFLAGS= ; \ |
Martin Roth | 20cd54f | 2017-03-26 18:49:02 -0600 | [diff] [blame] | 479 | rm -f /util/$(tool)/junit.xml;) |
| 480 | |
| 481 | distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils |
Patrick Georgi | 80656af | 2017-04-26 11:58:44 +0200 | [diff] [blame] | 482 | rm -f .config .config.old ..config.tmp* .kconfig.d .tmpconfig* .ccwrap .xcompile |
Martin Roth | 20cd54f | 2017-03-26 18:49:02 -0600 | [diff] [blame] | 483 | rm -rf coreboot-builds coreboot-builds-chromeos |
| 484 | rm -f abuild*.xml junit.xml* util/lint/junit.xml |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 485 | |
Patrick Rudolph | f664321 | 2020-05-17 20:04:12 +0200 | [diff] [blame] | 486 | .PHONY: $(PHONY) clean clean-for-update clean-cscope cscope distclean doxygen doxy doxygen_simple sphinx sphinx-lint |
Martin Roth | 9c1b33e | 2015-07-29 14:55:18 -0700 | [diff] [blame] | 487 | .PHONY: ctags-project cscope-project clean-ctags |