Makefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. ## SPDX-License-Identifier: BSD-3-Clause
  2. ifneq ($(words $(CURDIR)),1)
  3. $(error Error: Path to the main directory cannot contain spaces)
  4. endif
  5. top := $(CURDIR)
  6. src := src
  7. srck := $(top)/util/kconfig
  8. obj ?= build
  9. override obj := $(subst $(top)/,,$(abspath $(obj)))
  10. xcompile ?= $(obj)/xcompile
  11. objutil ?= $(obj)/util
  12. objk := $(objutil)/kconfig
  13. absobj := $(abspath $(obj))
  14. additional-dirs :=
  15. VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib)
  16. COREBOOT_EXPORTS := COREBOOT_EXPORTS
  17. COREBOOT_EXPORTS += top src srck obj objutil objk
  18. # reproducible builds
  19. LANG:=C
  20. LC_ALL:=C
  21. TZ:=UTC0
  22. ifneq ($(NOCOMPILE),1)
  23. SOURCE_DATE_EPOCH := $(shell $(top)/util/genbuild_h/genbuild_h.sh . | sed -n 's/^.define COREBOOT_BUILD_EPOCH\>.*"\(.*\)".*/\1/p')
  24. endif
  25. # don't use COREBOOT_EXPORTS to ensure build steps outside the coreboot build system
  26. # are reproducible
  27. export LANG LC_ALL TZ SOURCE_DATE_EPOCH
  28. DOTCONFIG ?= $(top)/.config
  29. KCONFIG_CONFIG = $(DOTCONFIG)
  30. KCONFIG_AUTOADS := $(obj)/cb-config.ads
  31. KCONFIG_AUTOHEADER := $(obj)/config.h
  32. KCONFIG_AUTOCONFIG := $(obj)/auto.conf
  33. KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd
  34. KCONFIG_SPLITCONFIG := $(obj)/config/
  35. KCONFIG_TRISTATE := $(obj)/tristate.conf
  36. KCONFIG_NEGATIVES := 1
  37. KCONFIG_STRICT := 1
  38. KCONFIG_PACKAGE := CB.Config
  39. COREBOOT_EXPORTS += KCONFIG_CONFIG KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG
  40. COREBOOT_EXPORTS += KCONFIG_DEPENDENCIES KCONFIG_SPLITCONFIG KCONFIG_TRISTATE
  41. COREBOOT_EXPORTS += KCONFIG_NEGATIVES KCONFIG_STRICT
  42. COREBOOT_EXPORTS += KCONFIG_AUTOADS KCONFIG_PACKAGE
  43. # directory containing the toplevel Makefile.inc
  44. TOPLEVEL := .
  45. CONFIG_SHELL := sh
  46. KBUILD_DEFCONFIG := configs/defconfig
  47. UNAME_RELEASE := $(shell uname -r)
  48. HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG))
  49. MAKEFLAGS += -rR --no-print-directory
  50. # Make is silent per default, but 'make V=1' will show all compiler calls.
  51. Q:=@
  52. ifneq ($(V),1)
  53. ifneq ($(Q),)
  54. .SILENT:
  55. MAKEFLAGS += -s
  56. endif
  57. endif
  58. # Disable implicit/built-in rules to make Makefile errors fail fast.
  59. .SUFFIXES:
  60. HOSTCFLAGS := -g
  61. HOSTCXXFLAGS := -g
  62. PREPROCESS_ONLY := -E -P -x assembler-with-cpp -undef -I .
  63. DOXYGEN := doxygen
  64. DOXYGEN_OUTPUT_DIR := doxygen
  65. export $(COREBOOT_EXPORTS)
  66. all: real-all
  67. help_coreboot help::
  68. @echo '*** coreboot platform targets ***'
  69. @echo ' Use "make [target] V=1" for extra build debug information'
  70. @echo ' all - Build coreboot'
  71. @echo ' clean - Remove coreboot build artifacts'
  72. @echo ' distclean - Remove build artifacts and config files'
  73. @echo ' doxygen - Build doxygen documentation for coreboot'
  74. @echo ' doxyplatform - Build doxygen documentation for the current platform'
  75. @echo ' sphinx - Build sphinx documentation for coreboot'
  76. @echo ' sphinx-lint - Build sphinx documenttion for coreboot with warnings as errors'
  77. @echo ' filelist - Show files used in current build'
  78. @echo ' printall - print makefile info for debugging'
  79. @echo ' gitconfig - set up git to submit patches to coreboot'
  80. @echo ' ctags / ctags-project - make ctags file for all of coreboot or current board'
  81. @echo ' cscope / cscope-project - make cscope.out file for coreboot or current board'
  82. @echo
  83. # This include must come _before_ the pattern rules below!
  84. # Order _does_ matter for pattern rules.
  85. include $(srck)/Makefile.inc
  86. # Three cases where we don't need fully populated $(obj) lists:
  87. # 1. when no .config exists
  88. # 2. when make config (in any flavour) is run
  89. # 3. when make distclean is run
  90. # Don't waste time on reading all Makefile.incs in these cases
  91. ifeq ($(strip $(HAVE_DOTCONFIG)),)
  92. NOCOMPILE:=1
  93. endif
  94. ifneq ($(MAKECMDGOALS),)
  95. ifneq ($(filter %config %clean cross% clang iasl lint% help% what-jenkins-does,$(MAKECMDGOALS)),)
  96. NOCOMPILE:=1
  97. endif
  98. ifneq ($(filter %clean lint% help% what-jenkins-does,$(MAKECMDGOALS)),)
  99. NOMKDIR:=1
  100. UNIT_TEST:=1
  101. endif
  102. endif
  103. ifneq ($(filter help%, $(MAKECMDGOALS)), )
  104. NOCOMPILE:=1
  105. UNIT_TEST:=1
  106. else
  107. ifneq ($(filter %-test %-tests %coverage-report, $(MAKECMDGOALS)),)
  108. ifneq ($(filter-out %-test %-tests %coverage-report, $(MAKECMDGOALS)),)
  109. $(error Cannot mix unit-tests targets with other targets)
  110. endif
  111. UNIT_TEST:=1
  112. NOCOMPILE:=
  113. endif
  114. endif
  115. $(xcompile): util/xcompile/xcompile
  116. rm -f $@
  117. $< $(XGCCPATH) > $@.tmp
  118. \mv -f $@.tmp $@ 2> /dev/null
  119. rm -f $@.tmp
  120. ifeq ($(NOCOMPILE),1)
  121. # We also don't use .xcompile in the no-compile situations, so
  122. # provide some reasonable defaults.
  123. HOSTCC ?= $(if $(shell type gcc 2>/dev/null),gcc,cc)
  124. HOSTCXX ?= g++
  125. include $(TOPLEVEL)/Makefile.inc
  126. include $(TOPLEVEL)/payloads/Makefile.inc
  127. include $(TOPLEVEL)/util/testing/Makefile.inc
  128. -include $(TOPLEVEL)/site-local/Makefile.inc
  129. include $(TOPLEVEL)/tests/Makefile.inc
  130. real-all:
  131. @echo "Error: Expected config file ($(DOTCONFIG)) not present." >&2
  132. @echo "Please specify a config file or run 'make menuconfig' to" >&2
  133. @echo "generate a new config file." >&2
  134. @exit 1
  135. else
  136. ifneq ($(UNIT_TEST),1)
  137. include $(DOTCONFIG)
  138. endif
  139. # The toolchain requires xcompile to determine the ARCH_SUPPORTED, so we can't
  140. # wait for make to generate the file.
  141. $(if $(wildcard $(xcompile)),, $(shell \
  142. mkdir -p $(dir $(xcompile)) && \
  143. util/xcompile/xcompile $(XGCCPATH) > $(xcompile) || rm -f $(xcompile)))
  144. include $(xcompile)
  145. ifneq ($(XCOMPILE_COMPLETE),1)
  146. $(shell rm -f $(xcompile))
  147. $(error $(xcompile) deleted because it's invalid. \
  148. Restarting the build should fix that, or explain the problem)
  149. endif
  150. ifneq ($(CONFIG_MMX),y)
  151. CFLAGS_x86_32 += -mno-mmx
  152. endif
  153. ifneq ($(UNIT_TEST),1)
  154. include toolchain.inc
  155. endif
  156. strip_quotes = $(strip $(subst ",,$(subst \",,$(1))))
  157. # fix makefile syntax highlighting after strip macro \" "))
  158. # The primary target needs to be here before we include the
  159. # other files
  160. real-all: real-target
  161. # must come rather early
  162. .SECONDEXPANSION:
  163. .DELETE_ON_ERROR:
  164. $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) $(objutil)/kconfig/conf
  165. $(MAKE) olddefconfig
  166. $(MAKE) syncconfig
  167. $(KCONFIG_AUTOCONFIG): $(KCONFIG_AUTOHEADER)
  168. true
  169. $(KCONFIG_AUTOADS): $(KCONFIG_CONFIG) $(KCONFIG_AUTOHEADER) $(objutil)/kconfig/toada
  170. $(objutil)/kconfig/toada CB.Config <$< >$@
  171. $(obj)/%/$(notdir $(KCONFIG_AUTOADS)): $(KCONFIG_AUTOADS)
  172. cp $< $@
  173. # Add a new class of source/object files to the build system
  174. add-class= \
  175. $(eval $(1)-srcs:=) \
  176. $(eval $(1)-objs:=) \
  177. $(eval classes+=$(1))
  178. # Special classes are managed types with special behaviour
  179. # On parse time, for each entry in variable $(1)-y
  180. # a handler $(1)-handler is executed with the arguments:
  181. # * $(1): directory the parser is in
  182. # * $(2): current entry
  183. add-special-class= \
  184. $(eval $(1):=) \
  185. $(eval special-classes+=$(1))
  186. # Converts one or more source file paths to their corresponding build/ paths.
  187. # Only .ads, adb, .c and .S get converted to .o, other files (like .ld) keep
  188. # their name.
  189. # $1 stage name
  190. # $2 file path (list)
  191. src-to-obj=\
  192. $(patsubst $(obj)/%,$(obj)/$(1)/%,\
  193. $(patsubst $(obj)/$(1)/%,$(obj)/%,\
  194. $(patsubst 3rdparty/%,$(obj)/%,\
  195. $(patsubst src/%,$(obj)/%,\
  196. $(patsubst %.ads,%.o,\
  197. $(patsubst %.adb,%.o,\
  198. $(patsubst %.c,%.o,\
  199. $(patsubst %.S,%.o,\
  200. $(subst .$(1),,$(2))))))))))
  201. # Converts one or more source file paths to the corresponding build/ paths
  202. # of their Ada library information (.ali) files.
  203. # $1 stage name
  204. # $2 file path (list)
  205. src-to-ali=\
  206. $(patsubst $(obj)/%,$(obj)/$(1)/%,\
  207. $(patsubst $(obj)/$(1)/%,$(obj)/%,\
  208. $(patsubst 3rdparty/%,$(obj)/%,\
  209. $(patsubst src/%,$(obj)/%,\
  210. $(patsubst %.ads,%.ali,\
  211. $(patsubst %.adb,%.ali,\
  212. $(subst .$(1),,\
  213. $(filter %.ads %.adb,$(2)))))))))
  214. # Clean -y variables, include Makefile.inc
  215. # Add paths to files in X-y to X-srcs
  216. # Add subdirs-y to subdirs
  217. includemakefiles= \
  218. $(foreach class,classes subdirs $(classes) $(special-classes), $(eval $(class)-y:=)) \
  219. $(eval -include $(1)) \
  220. $(foreach class,$(classes-y), $(call add-class,$(class))) \
  221. $(foreach special,$(special-classes), \
  222. $(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \
  223. $(foreach class,$(classes), \
  224. $(eval $(class)-srcs+= \
  225. $$(subst $(absobj)/,$(obj)/, \
  226. $$(subst $(top)/,, \
  227. $$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \
  228. $(eval subdirs+=$$(subst $(CURDIR)/,,$$(wildcard $$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))))
  229. # For each path in $(subdirs) call includemakefiles
  230. # Repeat until subdirs is empty
  231. evaluate_subdirs= \
  232. $(eval cursubdirs:=$(subdirs)) \
  233. $(eval subdirs:=) \
  234. $(foreach dir,$(cursubdirs), \
  235. $(eval $(call includemakefiles,$(dir)/Makefile.inc))) \
  236. $(if $(subdirs),$(eval $(call evaluate_subdirs)))
  237. # collect all object files eligible for building
  238. subdirs:=$(TOPLEVEL)
  239. postinclude-hooks :=
  240. # Don't iterate through Makefile.incs under src/ when building tests
  241. ifneq ($(UNIT_TEST),1)
  242. $(eval $(call evaluate_subdirs))
  243. else
  244. include $(TOPLEVEL)/tests/Makefile.inc
  245. endif
  246. ifeq ($(FAILBUILD),1)
  247. $(error cannot continue build)
  248. endif
  249. # Run hooks registered by subdirectories that need to be evaluated after all files have been parsed
  250. $(eval $(postinclude-hooks))
  251. # Eliminate duplicate mentions of source files in a class
  252. $(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs))))
  253. # Build Kconfig .ads if necessary
  254. ifeq ($(CONFIG_RAMSTAGE_ADA),y)
  255. ramstage-srcs += $(obj)/ramstage/$(notdir $(KCONFIG_AUTOADS))
  256. endif
  257. # To track dependencies, we need all Ada specification (.ads) files in
  258. # *-srcs. Extract / filter all specification files that have a matching
  259. # body (.adb) file here (specifications without a body are valid sources
  260. # in Ada).
  261. $(foreach class,$(classes),$(eval $(class)-extra-specs := \
  262. $(filter \
  263. $(addprefix %/,$(patsubst %.adb,%.ads,$(notdir $(filter %.adb,$($(class)-srcs))))), \
  264. $(filter %.ads,$($(class)-srcs)))))
  265. $(foreach class,$(classes),$(eval $(class)-srcs := \
  266. $(filter-out $($(class)-extra-specs),$($(class)-srcs))))
  267. $(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class),$($(class)-srcs))))
  268. $(foreach class,$(classes),$(eval $(class)-alis:=$(call src-to-ali,$(class),$($(class)-srcs))))
  269. # For Ada includes
  270. $(foreach class,$(classes),$(eval $(class)-ada-dirs:=$(sort $(dir $(filter %.ads %.adb,$($(class)-srcs)) $($(class)-extra-specs)))))
  271. # Save all objs before processing them (for dependency inclusion)
  272. originalobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var)))
  273. # Call post-processors if they're defined
  274. $(foreach class,$(classes),\
  275. $(if $(value $(class)-postprocess),$(eval $(call $(class)-postprocess,$($(class)-objs)))))
  276. allsrcs:=$(foreach var, $(addsuffix -srcs,$(classes)), $($(var)))
  277. allobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var)))
  278. alldirs:=$(sort $(abspath $(dir $(allobjs))))
  279. # Reads dependencies from an Ada library information (.ali) file
  280. # Only basenames (with suffix) are preserved so we have to look the
  281. # paths up in $($(stage)-srcs).
  282. # $1 stage name
  283. # $2 ali file
  284. create_ada_deps=$$(if $(2),\
  285. gnat.adc \
  286. $$(filter \
  287. $$(addprefix %/,$$(shell sed -ne's/^D \([^\t]\+\).*$$$$/\1/p' $(2) 2>/dev/null)), \
  288. $$($(1)-srcs) $$($(1)-extra-specs)))
  289. # macro to define template macros that are used by use_template macro
  290. define create_cc_template
  291. # $1 obj class
  292. # $2 source suffix (c, S, ld, ...)
  293. # $3 additional compiler flags
  294. # $4 additional dependencies
  295. ifn$(EMPTY)def $(1)-objs_$(2)_template
  296. de$(EMPTY)fine $(1)-objs_$(2)_template
  297. ifn$(EMPTY)eq ($(filter ads adb,$(2)),)
  298. $$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $$(call create_ada_deps,$1,$$(call src-to-ali,$1,$$(1).$2)) $(4)
  299. @printf " GCC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
  300. $(GCC_$(1)) \
  301. $$$$(ADAFLAGS_$(1)) $$$$(addprefix -I,$$$$($(1)-ada-dirs)) \
  302. $(3) -c -o $$$$@ $$$$<
  303. el$(EMPTY)se
  304. $$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $(KCONFIG_AUTOHEADER) $(4)
  305. @printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
  306. $(CC_$(1)) \
  307. -MMD $$$$(CPPFLAGS_$(1)) $$$$(CFLAGS_$(1)) -MT $$$$(@) \
  308. $(3) -c -o $$$$@ $$$$<
  309. end$(EMPTY)if
  310. en$(EMPTY)def
  311. end$(EMPTY)if
  312. endef
  313. filetypes-of-class=$(subst .,,$(sort $(suffix $($(1)-srcs))))
  314. $(foreach class,$(classes), \
  315. $(foreach type,$(call filetypes-of-class,$(class)), \
  316. $(eval $(class)-$(type)-ccopts += $(generic-$(type)-ccopts) $($(class)-generic-ccopts)) \
  317. $(if $(generic-objs_$(type)_template_gen),$(eval $(call generic-objs_$(type)_template_gen,$(class))),\
  318. $(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts),$($(class)-$(type)-deps))))))
  319. foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(basename $(file)))))
  320. $(eval $(foreach class,$(classes),$(call foreach-src,$(class))))
  321. # To supported complex package initializations, we need to call the
  322. # emitted code explicitly. gnatbind gathers all the calls for us
  323. # and exports them as a procedure $(stage)_adainit(). Every stage that
  324. # uses Ada code has to call it!
  325. define gnatbind_template
  326. # $1 class
  327. $$(obj)/$(1)/b__$(1).adb: $$$$(filter-out $$(obj)/$(1)/b__$(1).ali,$$$$($(1)-alis))
  328. @printf " BIND $$(subst $$(obj)/,,$$@)\n"
  329. # We have to give gnatbind a simple filename (without leading
  330. # path components) so just cd there.
  331. cd $$(dir $$@) && \
  332. $$(GNATBIND_$(1)) -a -n \
  333. --RTS=$$(absobj)/libgnat-$$(ARCH-$(1)-y)/ \
  334. -L$(1)_ada -o $$(notdir $$@) \
  335. $$(subst $$(dir $$@),,$$^)
  336. $$(obj)/$(1)/b__$(1).o: $$(obj)/$(1)/b__$(1).adb
  337. @printf " GCC $$(subst $$(obj)/,,$$@)\n"
  338. $(GCC_$(1)) $$(ADAFLAGS_$(1)) -c -o $$@ $$<
  339. $(1)-objs += $$(obj)/$(1)/b__$(1).o
  340. $($(1)-alis): %.ali: %.o ;
  341. endef
  342. $(eval $(foreach class,$(filter-out libgnat-%,$(classes)), \
  343. $(if $($(class)-alis),$(call gnatbind_template,$(class)))))
  344. DEPENDENCIES += $(addsuffix .d,$(basename $(allobjs)))
  345. -include $(DEPENDENCIES)
  346. printall:
  347. @$(foreach class,$(classes), echo $(class)-objs: $($(class)-objs) | tr ' ' '\n'; echo; )
  348. @echo alldirs: $(alldirs) | tr ' ' '\n'; echo
  349. @echo allsrcs: $(allsrcs) | tr ' ' '\n'; echo
  350. @echo DEPENDENCIES: $(DEPENDENCIES) | tr ' ' '\n'; echo
  351. @$(foreach class,$(special-classes),echo $(class):'$($(class))' | tr ' ' '\n'; echo; )
  352. endif
  353. ifndef NOMKDIR
  354. $(shell mkdir -p $(KCONFIG_SPLITCONFIG) $(objk)/lxdialog $(additional-dirs) $(alldirs))
  355. endif
  356. $(obj)/project_filelist.txt:
  357. if [ -z "$(wildcard $(obj)/coreboot.rom)" ]; then \
  358. echo "*** Error: Project must be built before generating file list ***"; \
  359. exit 1; \
  360. fi
  361. find $(obj) -path "$(obj)/util" -prune -o -name "*.d" -exec cat {} \; | \
  362. sed "s|$(top)/||" | sed 's/[:\\]/ /g' | sed 's/ /\n/g' | sort | uniq | \
  363. grep -v '\.o$$' > $(obj)/project_filelist.txt
  364. filelist: $(obj)/project_filelist.txt
  365. printf "\nFiles used in build:\n"
  366. cat $(obj)/project_filelist.txt
  367. #works with either exuberant ctags or ctags.emacs
  368. ctags-project: clean-ctags $(obj)/project_filelist.txt
  369. cat $(obj)/project_filelist.txt | \
  370. xargs ctags -o tags
  371. cscope-project: clean-cscope $(obj)/project_filelist.txt
  372. cat $(obj)/project_filelist.txt | xargs cscope -b
  373. cscope:
  374. cscope -bR
  375. sphinx:
  376. $(MAKE) -C Documentation -f Makefile.sphinx html
  377. sphinx-lint:
  378. $(MAKE) SPHINXOPTS=-W -C Documentation -f Makefile.sphinx html
  379. doxy: doxygen
  380. doxygen:
  381. $(DOXYGEN) Documentation/Doxyfile.coreboot
  382. doxygen_simple:
  383. $(DOXYGEN) Documentation/Doxyfile.coreboot_simple
  384. doxyplatform doxygen_platform: $(obj)/project_filelist.txt
  385. echo
  386. echo "Building doxygen documentation for $(CONFIG_MAINBOARD_PART_NUMBER)"
  387. 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' )"; \
  388. mkdir -p "$$DOXYGEN_OUTPUT_DIR"; \
  389. export DOXYFILES="$$(cat $(obj)/project_filelist.txt | grep -v '\.ld$$' | sed 's/\.aml/\.dsl/' | tr '\n' ' ')"; \
  390. export DOXYGEN_PLATFORM="$(call strip_quotes, $(CONFIG_MAINBOARD_DIR)) \($(call strip_quotes, $(CONFIG_MAINBOARD_PART_NUMBER))\) version $(KERNELVERSION)"; \
  391. $(DOXYGEN) Documentation/doxygen/Doxyfile.coreboot_platform
  392. doxyclean: doxygen-clean
  393. doxygen-clean:
  394. rm -rf $(DOXYGEN_OUTPUT_DIR)
  395. clean-for-update: doxygen-clean clean-for-update-target
  396. rm -rf $(obj) .xcompile
  397. clean: clean-for-update clean-target clean-utils
  398. rm -f .ccwrap
  399. clean-cscope:
  400. rm -f cscope.out
  401. clean-ctags:
  402. rm -f tags
  403. clean-utils:
  404. $(foreach tool, $(TOOLLIST), \
  405. $(MAKE) -C util/$(tool) clean MFLAGS= MAKEFLAGS= ;)
  406. distclean-utils:
  407. $(foreach tool, $(TOOLLIST), \
  408. $(MAKE) -C util/$(tool) distclean MFLAGS= MAKEFLAGS= ; \
  409. rm -f /util/$(tool)/junit.xml;)
  410. distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils
  411. rm -f .config .config.old ..config.tmp* .kconfig.d .tmpconfig* .ccwrap .xcompile
  412. rm -rf coreboot-builds coreboot-builds-chromeos
  413. rm -f abuild*.xml junit.xml* util/lint/junit.xml
  414. .PHONY: $(PHONY) clean clean-for-update clean-cscope cscope distclean doxygen doxy doxygen_simple sphinx sphinx-lint
  415. .PHONY: ctags-project cscope-project clean-ctags