blob: 0104a11fbc1cb8a56679ce19e2a134c95f59f647 [file] [log] [blame]
Jordan Crousef6145c32008-03-19 23:56:58 +00001##
Jordan Crousef6145c32008-03-19 23:56:58 +00002##
3## Copyright (C) 2008 Advanced Micro Devices, Inc.
Uwe Hermanne55b32a2008-08-08 07:56:07 +00004## Copyright (C) 2008 Uwe Hermann <uwe@hermann-uwe.de>
Patrick Georgib3db79e2011-04-21 18:48:50 +02005## Copyright (C) 2009-2010 coresystems GmbH
6## Copyright (C) 2011 secunet Security Networks AG
Jordan Crousef6145c32008-03-19 23:56:58 +00007##
8## Redistribution and use in source and binary forms, with or without
9## modification, are permitted provided that the following conditions
10## are met:
11## 1. Redistributions of source code must retain the above copyright
12## notice, this list of conditions and the following disclaimer.
13## 2. Redistributions in binary form must reproduce the above copyright
14## notice, this list of conditions and the following disclaimer in the
15## documentation and/or other materials provided with the distribution.
16## 3. The name of the author may not be used to endorse or promote products
17## derived from this software without specific prior written permission.
18##
19## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29## SUCH DAMAGE.
30##
31
Jakub Czapiga289e2f62021-12-02 15:29:18 +000032ifneq ($(words $(CURDIR)),1)
33 $(error ERROR: Path to the main directory cannot contain spaces)
34endif
35
Patrick Georgib3db79e2011-04-21 18:48:50 +020036ifeq ($(INNER_SCANBUILD),y)
37CC_real:=$(CC)
Jordan Crousef6145c32008-03-19 23:56:58 +000038endif
39
Patrick Georgib3db79e2011-04-21 18:48:50 +020040export top := $(CURDIR)
Jakub Czapiga39b2e7a2021-11-23 09:21:30 +000041export coreboottop ?= $(abspath $(top)/../../)
Patrick Georgib3db79e2011-04-21 18:48:50 +020042export src := src
Stefan Reinauer2551f592015-06-29 14:28:25 -070043export srck := $(abspath $(top)/../../util/kconfig)
Patrick Georgib3db79e2011-04-21 18:48:50 +020044export obj ?= build
45export objutil ?= $(obj)/util
Nico Huber08c70182014-10-14 23:27:50 +020046export objk := $(objutil)/lp_kconfig
Jakub Czapiga289e2f62021-12-02 15:29:18 +000047export absobj := $(abspath $(obj))
Jakub Czapiga395f5b32022-01-12 09:59:39 +000048VBOOT_SOURCE ?= $(coreboottop)/3rdparty/vboot
Patrick Georgib3db79e2011-04-21 18:48:50 +020049
Patrick Georgib3db79e2011-04-21 18:48:50 +020050export KCONFIG_AUTOHEADER := $(obj)/config.h
51export KCONFIG_AUTOCONFIG := $(obj)/auto.conf
Stefan Reinauered564992015-06-11 14:57:36 -070052export KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd
Patrick Georgi53ea1d42019-11-22 16:55:58 +010053export KCONFIG_SPLITCONFIG := $(obj)/config/
Stefan Reinauered564992015-06-11 14:57:36 -070054export KCONFIG_TRISTATE := $(obj)/tristate.conf
55export KCONFIG_NEGATIVES := 1
Patrick Georgi53ea1d42019-11-22 16:55:58 +010056export KBUILD_KCONFIG := Kconfig
Stefan Reinauered564992015-06-11 14:57:36 -070057export CONFIG_ := CONFIG_LP_
Patrick Georgib3db79e2011-04-21 18:48:50 +020058
59# directory containing the toplevel Makefile.inc
60TOPLEVEL := .
61
Gabe Black1ee2c6d2013-08-09 04:27:35 -070062CONFIG_LP_SHELL := sh
Paul Kocialkowskidb0c0c42015-08-03 14:05:33 +020063KBUILD_DEFCONFIG ?= configs/defconfig
Patrick Georgib3db79e2011-04-21 18:48:50 +020064UNAME_RELEASE := $(shell uname -r)
65DOTCONFIG ?= .config
66KCONFIG_CONFIG = $(DOTCONFIG)
67export KCONFIG_CONFIG
68HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG))
69MAKEFLAGS += -rR --no-print-directory
70
71# Make is silent per default, but 'make V=1' will show all compiler calls.
72Q:=@
73ifneq ($(V),1)
74ifneq ($(Q),)
75.SILENT:
76endif
77endif
78
79CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E
Uwe Hermanne55b32a2008-08-08 07:56:07 +000080HOSTCC = gcc
81HOSTCXX = g++
Patrick Georgib3db79e2011-04-21 18:48:50 +020082HOSTCFLAGS := -I$(srck) -I$(objk) -g
83HOSTCXXFLAGS := -I$(srck) -I$(objk)
Jakub Czapiga3d91b472021-09-15 14:52:45 +020084HOSTAS ?= as
85HOSTLD ?= ld
86HOSTNM ?= nm
87HOSTOBJCOPY ?= objcopy
88HOSTOBJDUMP ?= objdump
89HOSTREADELF ?= readelf
90HOSTSTRIP ?= strip
91HOSTAR ?= ar
Jordan Crousef6145c32008-03-19 23:56:58 +000092
Uwe Hermann3b641292008-08-27 12:53:47 +000093DOXYGEN := doxygen
94DOXYGEN_OUTPUT_DIR := doxygen
95
Patrick Georgib3db79e2011-04-21 18:48:50 +020096all: real-all
Jordan Crousec3e728f2008-04-09 23:05:59 +000097
Stefan Reinauerf53dbfa2015-07-09 00:26:49 +020098ifeq ($(INNER_SCANBUILD),y)
99CC:=$(CC_real)
100HOSTCC:=$(CC_real) --hostcc
101HOSTCXX:=$(CC_real) --hostcxx
102endif
103
Uwe Hermannea872452008-10-22 15:49:20 +0000104# This include must come _before_ the pattern rules below!
105# Order _does_ matter for pattern rules.
Patrick Georgi53ea1d42019-11-22 16:55:58 +0100106include $(srck)/Makefile.inc
Uwe Hermannea872452008-10-22 15:49:20 +0000107
Stefan Reinauer8af0d032012-12-14 13:05:21 -0800108include $(HAVE_DOTCONFIG)
109
Gabe Black51edd542013-09-30 23:00:33 -0700110ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm
Furquan Shaikh8c8c3772014-02-19 11:35:30 -0800111ARCHDIR-$(CONFIG_LP_ARCH_ARM64) := arm64
Gabe Black1ee2c6d2013-08-09 04:27:35 -0700112ARCHDIR-$(CONFIG_LP_ARCH_X86) := x86
Jakub Czapiga3d91b472021-09-15 14:52:45 +0200113ARCHDIR-$(CONFIG_LP_ARCH_MOCK) := mock
Stefan Reinauer8af0d032012-12-14 13:05:21 -0800114
115ARCH-y := $(ARCHDIR-y)
116
Patrick Georgi21fc58b2015-07-06 09:07:11 +0000117# If architecture folder name is different from xcompile architecture name,
Stefan Reinauer8af0d032012-12-14 13:05:21 -0800118# override here.
Gabe Black51edd542013-09-30 23:00:33 -0700119ARCH-$(CONFIG_LP_ARCH_ARM) := arm
Furquan Shaikh8c8c3772014-02-19 11:35:30 -0800120ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64
Patrick Georgi21fc58b2015-07-06 09:07:11 +0000121ARCH-$(CONFIG_LP_ARCH_X86) := x86_32
Jakub Czapiga3d91b472021-09-15 14:52:45 +0200122ARCH-$(CONFIG_LP_ARCH_MOCK) := mock
Stefan Reinauer8af0d032012-12-14 13:05:21 -0800123
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000124# Five cases where we don't need fully populated $(obj) lists:
Patrick Georgib3db79e2011-04-21 18:48:50 +0200125# 1. when no .config exists
126# 2. when make config (in any flavour) is run
127# 3. when make distclean is run
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000128# 4. when make help% or make clean% is run
129# 5. when make %-test or make %-tests or make %coverage-report is run
Patrick Georgib3db79e2011-04-21 18:48:50 +0200130# Don't waste time on reading all Makefile.incs in these cases
Uwe Hermannea872452008-10-22 15:49:20 +0000131ifeq ($(strip $(HAVE_DOTCONFIG)),)
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000132NOCOMPILE := 1
Patrick Georgib3db79e2011-04-21 18:48:50 +0200133endif
134ifneq ($(MAKECMDGOALS),)
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000135ifneq ($(filter %config %clean clean-% help%,$(MAKECMDGOALS)),)
136NOCOMPILE := 1
137endif
138ifneq ($(filter %clean help% clean%, $(MAKECMDGOALS)),)
139UNIT_TEST := 1
140endif
141endif
142
143ifneq ($(filter help%, $(MAKECMDGOALS)),)
144NOCOMPILE := 1
145UNIT_TEST := 1
146else
147ifneq ($(filter %-test %-tests %coverage-report, $(MAKECMDGOALS)),)
148ifneq ($(filter-out %-test %-tests %coverage-report, $(MAKECMDGOALS)),)
149$(error Cannot mix unit-tests targets with other targets)
150endif
151NOCOMPILE :=
152UNIT_TEST := 1
Patrick Georgib3db79e2011-04-21 18:48:50 +0200153endif
154endif
155
Nico Huber1823d532020-11-16 22:50:49 +0100156xcompile ?= $(obj)/xcompile
157$(xcompile): $(top)/../../util/xcompile/xcompile
158 $< $(XGCCPATH) > $@.tmp
159 \mv -f $@.tmp $@ 2> /dev/null
160
Patrick Georgib3db79e2011-04-21 18:48:50 +0200161ifeq ($(NOCOMPILE),1)
162include $(TOPLEVEL)/Makefile.inc
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000163include $(TOPLEVEL)/tests/Makefile.inc
Patrick Georgib3db79e2011-04-21 18:48:50 +0200164real-all: config
165
Uwe Hermannea872452008-10-22 15:49:20 +0000166else
167
Jakub Czapiga3d91b472021-09-15 14:52:45 +0200168ifeq ($(CONFIG_LP_ARCH_MOCK),y)
169
170# Create empty xcompile to satisfy install script
171$(shell echo '' > $(xcompile))
172
173CC := $(HOSTCC)
174CC-mock := $(HOSTCC)
175AS := $(HOSTAS)
176AS-mock := $(HOSTAS)
177LD := $(HOSTLD)
178LD-mock := $(HOSTLD)
179NM := $(HOSTNM)
180NM-mock := $(HOSTNM)
181OBJCOPY := $(HOSTOBJCOPY)
182OBJCOPY-mock := $(HOSTOBJCOPY)
183OBJDUMP := $(HOSTOBJDUMP)
184OBJDUMP-mock := $(HOSTOBJDUMP)
185READELF := $(HOSTREADELF)
186READELF-mock := $(HOSTEADELF)
187STRIP := $(HOSTSTRIP)
188STRIP-mock := $(HOSTSTRIP)
189AR := $(HOSTAR)
190AR-mock := $(HOSTAR)
191else
192
Patrick Georgi0ffef882017-01-19 23:20:14 +0100193# in addition to the dependency below, create the file if it doesn't exist
194# to silence stupid warnings about a file that would be generated anyway.
Nico Huber1823d532020-11-16 22:50:49 +0100195$(if $(wildcard $(xcompile)),,$(shell \
196 mkdir -p $(dir $(xcompile)) && \
197 $(top)/../../util/xcompile/xcompile $(XGCCPATH) > $(xcompile) || rm -f $(xcompile)))
Patrick Georgi0ffef882017-01-19 23:20:14 +0100198
Nico Huber1823d532020-11-16 22:50:49 +0100199include $(xcompile)
Patrick Georgi0ffef882017-01-19 23:20:14 +0100200
Nico Huber1823d532020-11-16 22:50:49 +0100201ifneq ($(XCOMPILE_COMPLETE),1)
202$(shell rm -f $(xcompile))
203$(error $(xcompile) deleted because it's invalid. \
204 Restarting the build should fix that, or explain the problem)
205endif
Patrick Georgi0ffef882017-01-19 23:20:14 +0100206
Patrick Georgib144a342017-01-25 14:21:12 +0100207CC := $(CC_$(ARCH-y))
208AS := $(AS_$(ARCH-y))
209LD := $(LD_$(ARCH-y))
210NM := $(NM_$(ARCH-y))
211OBJCOPY := $(OBJCOPY_$(ARCH-y))
212OBJDUMP := $(OBJDUMP_$(ARCH-y))
213READELF := $(READELF_$(ARCH-y))
214STRIP := $(STRIP_$(ARCH-y))
215AR := $(AR_$(ARCH-y))
Jakub Czapiga3d91b472021-09-15 14:52:45 +0200216endif
Patrick Georgib144a342017-01-25 14:21:12 +0100217
Raul E Rangel50a2a862018-07-13 15:16:58 -0600218CFLAGS += -std=gnu11 $(CFLAGS_$(ARCH-y))
Patrick Georgib144a342017-01-25 14:21:12 +0100219
Patrick Georgib3db79e2011-04-21 18:48:50 +0200220ifneq ($(INNER_SCANBUILD),y)
Gabe Black1ee2c6d2013-08-09 04:27:35 -0700221ifeq ($(CONFIG_LP_COMPILER_LLVM_CLANG),y)
Jakub Czapiga3d91b472021-09-15 14:52:45 +0200222CC:=clang
223ifneq ($(CONFIG_LP_ARCH_MOCK),y)
224CC += -m32
225endif
Patrick Georgib3db79e2011-04-21 18:48:50 +0200226HOSTCC:=clang
227endif
228endif
229
Gabe Black1ee2c6d2013-08-09 04:27:35 -0700230ifeq ($(CONFIG_LP_CCACHE),y)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200231CCACHE:=$(word 1,$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH)))))
232ifeq ($(CCACHE),)
233$(error ccache selected, but not found in PATH)
234endif
235CCACHE:=CCACHE_COMPILERCHECK=content CCACHE_BASEDIR=$(top) $(CCACHE)
236CC := $(CCACHE) $(CC)
237HOSTCC := $(CCACHE) $(HOSTCC)
238HOSTCXX := $(CCACHE) $(HOSTCXX)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200239endif
240
241strip_quotes = $(subst ",,$(subst \",,$(1)))
242
243# The primary target needs to be here before we include the
244# other files
245
246ifeq ($(INNER_SCANBUILD),y)
Gabe Black1ee2c6d2013-08-09 04:27:35 -0700247CONFIG_LP_SCANBUILD_ENABLE:=
Patrick Georgib3db79e2011-04-21 18:48:50 +0200248endif
249
Gabe Black1ee2c6d2013-08-09 04:27:35 -0700250ifeq ($(CONFIG_LP_SCANBUILD_ENABLE),y)
251ifneq ($(CONFIG_LP_SCANBUILD_REPORT_LOCATION),)
252CONFIG_LP_SCANBUILD_REPORT_LOCATION:=-o $(CONFIG_LP_SCANBUILD_REPORT_LOCATION)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200253endif
254real-all:
255 echo '#!/bin/sh' > .ccwrap
256 echo 'CC="$(CC)"' >> .ccwrap
257 echo 'if [ "$$1" = "--hostcc" ]; then shift; CC="$(HOSTCC)"; fi' >> .ccwrap
258 echo 'if [ "$$1" = "--hostcxx" ]; then shift; CC="$(HOSTCXX)"; fi' >> .ccwrap
259 echo 'eval $$CC $$*' >> .ccwrap
260 chmod +x .ccwrap
Gabe Black1ee2c6d2013-08-09 04:27:35 -0700261 scan-build $(CONFIG_LP_SCANBUILD_REPORT_LOCATION) -analyze-headers --use-cc=$(top)/.ccwrap --use-c++=$(top)/.ccwrap $(MAKE) INNER_SCANBUILD=y
Patrick Georgib3db79e2011-04-21 18:48:50 +0200262else
263real-all: real-target
264endif
265
266# must come rather early
267.SECONDEXPANSION:
268
Nico Huber602a82a2015-09-09 13:02:51 +0200269$(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG)
Patrick Georgi53ea1d42019-11-22 16:55:58 +0100270 $(MAKE) CONFIG_=CONFIG_LP_ olddefconfig
271 $(MAKE) CONFIG_=CONFIG_LP_ syncconfig
Patrick Georgib3db79e2011-04-21 18:48:50 +0200272
273# Add a new class of source/object files to the build system
274add-class= \
275 $(eval $(1)-srcs:=) \
276 $(eval $(1)-objs:=) \
277 $(eval classes+=$(1))
278
279# Special classes are managed types with special behaviour
280# On parse time, for each entry in variable $(1)-y
281# a handler $(1)-handler is executed with the arguments:
282# * $(1): directory the parser is in
283# * $(2): current entry
284add-special-class= \
285 $(eval $(1):=) \
286 $(eval special-classes+=$(1))
287
288# Clean -y variables, include Makefile.inc
289# Add paths to files in X-y to X-srcs
290# Add subdirs-y to subdirs
291includemakefiles= \
292 $(foreach class,classes subdirs $(classes) $(special-classes), $(eval $(class)-y:=)) \
293 $(eval -include $(1)) \
294 $(foreach class,$(classes-y), $(call add-class,$(class))) \
Arthur Heymans6c2324a2019-10-29 18:36:46 +0100295 $(foreach special,$(special-classes), \
296 $(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \
Patrick Georgib3db79e2011-04-21 18:48:50 +0200297 $(foreach class,$(classes), \
298 $(eval $(class)-srcs+= \
Jakub Czapiga289e2f62021-12-02 15:29:18 +0000299 $$(subst $(absobj)/,$(obj)/, \
Patrick Georgib3db79e2011-04-21 18:48:50 +0200300 $$(subst $(top)/,, \
Jakub Czapiga289e2f62021-12-02 15:29:18 +0000301 $$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \
302 $(eval subdirs+=$$(subst $(CURDIR)/,,$$(wildcard $$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))))
303
Patrick Georgib3db79e2011-04-21 18:48:50 +0200304
305# For each path in $(subdirs) call includemakefiles
306# Repeat until subdirs is empty
307evaluate_subdirs= \
308 $(eval cursubdirs:=$(subdirs)) \
309 $(eval subdirs:=) \
310 $(foreach dir,$(cursubdirs), \
311 $(eval $(call includemakefiles,$(dir)/Makefile.inc))) \
312 $(if $(subdirs),$(eval $(call evaluate_subdirs)))
313
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000314# collect all object files eligible for building or run unit-tests
315ifneq ($(UNIT_TEST),1)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200316subdirs:=$(TOPLEVEL)
317$(eval $(call evaluate_subdirs))
Jakub Czapiga12ae8502021-10-08 09:57:14 +0000318else
319include $(TOPLEVEL)/tests/Makefile.inc
320endif
Patrick Georgib3db79e2011-04-21 18:48:50 +0200321
Jakub Czapiga289e2f62021-12-02 15:29:18 +0000322# Converts one or more source file paths to the corresponding build/ paths.
323# $1 lib name
324# $2 file path (list)
325src-to-obj=\
326 $(addsuffix .$(1).o,\
327 $(basename \
328 $(addprefix $(obj)/,\
329 $(subst $(coreboottop)/,coreboot/,$(2)))))
Jakub Czapiga1fa3da42021-12-06 09:01:50 +0000330$(foreach class,$(classes),$(eval $(class)-objs+=$(call src-to-obj,$(class),$($(class)-srcs))))
Patrick Georgib3db79e2011-04-21 18:48:50 +0200331
332allsrcs:=$(foreach var, $(addsuffix -srcs,$(classes)), $($(var)))
333allobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var)))
334alldirs:=$(sort $(abspath $(dir $(allobjs))))
335
336# macro to define template macros that are used by use_template macro
337define create_cc_template
338# $1 obj class
339# $2 source suffix (c, S)
340# $3 additional compiler flags
341# $4 additional dependencies
342ifn$(EMPTY)def $(1)-objs_$(2)_template
343de$(EMPTY)fine $(1)-objs_$(2)_template
Jakub Czapiga289e2f62021-12-02 15:29:18 +0000344$$(call src-to-obj,$(1), $$(1).$(2)): $$(1).$(2) $(obj)/libpayload-config.h $(4)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200345 @printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
Jakub Czapigac35659d2021-08-26 14:35:10 +0200346 $(CC) $(3) -MMD $$$$(CFLAGS) $(EXTRA_CFLAGS) -c -o $$$$@ $$$$<
Patrick Georgib3db79e2011-04-21 18:48:50 +0200347en$(EMPTY)def
348end$(EMPTY)if
349endef
350
351filetypes-of-class=$(subst .,,$(sort $(suffix $($(1)-srcs))))
352$(foreach class,$(classes), \
353 $(foreach type,$(call filetypes-of-class,$(class)), \
354 $(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts),$($(class)-$(type)-deps)))))
355
356foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(basename $(file)))))
357$(eval $(foreach class,$(classes),$(call foreach-src,$(class))))
358
Jakub Czapiga1fa3da42021-12-06 09:01:50 +0000359DEPENDENCIES = $($(filter %.o,%(allobjs)):.o=.d)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200360-include $(DEPENDENCIES)
361
362printall:
363 @$(foreach class,$(classes),echo $(class)-objs:=$($(class)-objs); )
364 @echo alldirs:=$(alldirs)
365 @echo allsrcs=$(allsrcs)
366 @echo DEPENDENCIES=$(DEPENDENCIES)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200367 @$(foreach class,$(special-classes),echo $(class):='$($(class))'; )
Uwe Hermannea872452008-10-22 15:49:20 +0000368
369endif
Jordan Crousef6145c32008-03-19 23:56:58 +0000370
Stefan Reinauered564992015-06-11 14:57:36 -0700371$(shell mkdir -p $(KCONFIG_SPLITCONFIG) $(obj) $(objk)/lxdialog $(additional-dirs) $(alldirs))
Jordan Crousef6145c32008-03-19 23:56:58 +0000372
Patrick Georgib3db79e2011-04-21 18:48:50 +0200373cscope:
374 cscope -bR
375
376doxy: doxygen
377doxygen:
378 $(DOXYGEN) Doxyfile
379
380doxyclean: doxygen-clean
381doxygen-clean:
382 rm -rf $(DOXYGEN_OUTPUT_DIR)
383
384clean-for-update: doxygen-clean clean-for-update-target
Nico Huber1823d532020-11-16 22:50:49 +0100385 rm -f $(allobjs) $(xcompile)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200386 rm -f $(DEPENDENCIES)
387 rmdir -p $(alldirs) 2>/dev/null >/dev/null || true
388
389clean: clean-for-update clean-target
Martin Roth6959f5c2016-03-23 16:07:54 -0600390 rm -f .ccwrap junit_config junit_config.old
Patrick Georgib144a342017-01-25 14:21:12 +0100391 rm -rf $(obj)
Patrick Georgib3db79e2011-04-21 18:48:50 +0200392
393clean-cscope:
394 rm -f cscope.out
395
Patrick Georgib144a342017-01-25 14:21:12 +0100396distclean: clean-cscope clean
Martin Roth6959f5c2016-03-23 16:07:54 -0600397 rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile junit.xml
Patrick Georgib3db79e2011-04-21 18:48:50 +0200398
Paul Kocialkowski5d5fcdd2015-08-03 16:44:01 +0200399.PHONY: $(PHONY) clean clean-cscope cscope distclean doxygen doxy