Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 1 | ## |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 2 | ## |
| 3 | ## Copyright (C) 2008 Advanced Micro Devices, Inc. |
Uwe Hermann | e55b32a | 2008-08-08 07:56:07 +0000 | [diff] [blame] | 4 | ## Copyright (C) 2008 Uwe Hermann <uwe@hermann-uwe.de> |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 5 | ## Copyright (C) 2009-2010 coresystems GmbH |
| 6 | ## Copyright (C) 2011 secunet Security Networks AG |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 7 | ## |
| 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 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 32 | ifeq ($(INNER_SCANBUILD),y) |
| 33 | CC_real:=$(CC) |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 34 | endif |
| 35 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 36 | export top := $(CURDIR) |
| 37 | export src := src |
Stefan Reinauer | 2551f59 | 2015-06-29 14:28:25 -0700 | [diff] [blame] | 38 | export srck := $(abspath $(top)/../../util/kconfig) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 39 | export obj ?= build |
| 40 | export objutil ?= $(obj)/util |
Nico Huber | 08c7018 | 2014-10-14 23:27:50 +0200 | [diff] [blame] | 41 | export objk := $(objutil)/lp_kconfig |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 42 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 43 | export KCONFIG_AUTOHEADER := $(obj)/config.h |
| 44 | export KCONFIG_AUTOCONFIG := $(obj)/auto.conf |
Stefan Reinauer | ed56499 | 2015-06-11 14:57:36 -0700 | [diff] [blame] | 45 | export KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd |
| 46 | export KCONFIG_SPLITCONFIG := $(obj)/config |
| 47 | export KCONFIG_TRISTATE := $(obj)/tristate.conf |
| 48 | export KCONFIG_NEGATIVES := 1 |
| 49 | export Kconfig := Kconfig |
| 50 | export CONFIG_ := CONFIG_LP_ |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 51 | |
| 52 | # directory containing the toplevel Makefile.inc |
| 53 | TOPLEVEL := . |
| 54 | |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 55 | CONFIG_LP_SHELL := sh |
Paul Kocialkowski | db0c0c4 | 2015-08-03 14:05:33 +0200 | [diff] [blame] | 56 | KBUILD_DEFCONFIG ?= configs/defconfig |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 57 | UNAME_RELEASE := $(shell uname -r) |
| 58 | DOTCONFIG ?= .config |
| 59 | KCONFIG_CONFIG = $(DOTCONFIG) |
| 60 | export KCONFIG_CONFIG |
| 61 | HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG)) |
| 62 | MAKEFLAGS += -rR --no-print-directory |
| 63 | |
| 64 | # Make is silent per default, but 'make V=1' will show all compiler calls. |
| 65 | Q:=@ |
| 66 | ifneq ($(V),1) |
| 67 | ifneq ($(Q),) |
| 68 | .SILENT: |
| 69 | endif |
| 70 | endif |
| 71 | |
| 72 | CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E |
Uwe Hermann | e55b32a | 2008-08-08 07:56:07 +0000 | [diff] [blame] | 73 | HOSTCC = gcc |
| 74 | HOSTCXX = g++ |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 75 | HOSTCFLAGS := -I$(srck) -I$(objk) -g |
| 76 | HOSTCXXFLAGS := -I$(srck) -I$(objk) |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 77 | |
Uwe Hermann | 3b64129 | 2008-08-27 12:53:47 +0000 | [diff] [blame] | 78 | DOXYGEN := doxygen |
| 79 | DOXYGEN_OUTPUT_DIR := doxygen |
| 80 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 81 | all: real-all |
Jordan Crouse | c3e728f | 2008-04-09 23:05:59 +0000 | [diff] [blame] | 82 | |
Stefan Reinauer | f53dbfa | 2015-07-09 00:26:49 +0200 | [diff] [blame] | 83 | ifeq ($(INNER_SCANBUILD),y) |
| 84 | CC:=$(CC_real) |
| 85 | HOSTCC:=$(CC_real) --hostcc |
| 86 | HOSTCXX:=$(CC_real) --hostcxx |
| 87 | endif |
| 88 | |
Uwe Hermann | ea87245 | 2008-10-22 15:49:20 +0000 | [diff] [blame] | 89 | # This include must come _before_ the pattern rules below! |
| 90 | # Order _does_ matter for pattern rules. |
Stefan Reinauer | 2551f59 | 2015-06-29 14:28:25 -0700 | [diff] [blame] | 91 | include $(srck)/Makefile |
Uwe Hermann | ea87245 | 2008-10-22 15:49:20 +0000 | [diff] [blame] | 92 | |
Stefan Reinauer | 8af0d03 | 2012-12-14 13:05:21 -0800 | [diff] [blame] | 93 | include $(HAVE_DOTCONFIG) |
| 94 | |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 95 | ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm |
Furquan Shaikh | 8c8c377 | 2014-02-19 11:35:30 -0800 | [diff] [blame] | 96 | ARCHDIR-$(CONFIG_LP_ARCH_ARM64) := arm64 |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 97 | ARCHDIR-$(CONFIG_LP_ARCH_X86) := x86 |
Stefan Reinauer | 8af0d03 | 2012-12-14 13:05:21 -0800 | [diff] [blame] | 98 | |
| 99 | ARCH-y := $(ARCHDIR-y) |
| 100 | |
Patrick Georgi | 21fc58b | 2015-07-06 09:07:11 +0000 | [diff] [blame] | 101 | # If architecture folder name is different from xcompile architecture name, |
Stefan Reinauer | 8af0d03 | 2012-12-14 13:05:21 -0800 | [diff] [blame] | 102 | # override here. |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 103 | ARCH-$(CONFIG_LP_ARCH_ARM) := arm |
Furquan Shaikh | 8c8c377 | 2014-02-19 11:35:30 -0800 | [diff] [blame] | 104 | ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64 |
Patrick Georgi | 21fc58b | 2015-07-06 09:07:11 +0000 | [diff] [blame] | 105 | ARCH-$(CONFIG_LP_ARCH_X86) := x86_32 |
Stefan Reinauer | 8af0d03 | 2012-12-14 13:05:21 -0800 | [diff] [blame] | 106 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 107 | # Three cases where we don't need fully populated $(obj) lists: |
| 108 | # 1. when no .config exists |
| 109 | # 2. when make config (in any flavour) is run |
| 110 | # 3. when make distclean is run |
| 111 | # Don't waste time on reading all Makefile.incs in these cases |
Uwe Hermann | ea87245 | 2008-10-22 15:49:20 +0000 | [diff] [blame] | 112 | ifeq ($(strip $(HAVE_DOTCONFIG)),) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 113 | NOCOMPILE:=1 |
| 114 | endif |
| 115 | ifneq ($(MAKECMDGOALS),) |
Patrick Georgi | 0ffef88 | 2017-01-19 23:20:14 +0100 | [diff] [blame] | 116 | ifneq ($(filter %config %clean,$(MAKECMDGOALS)),) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 117 | NOCOMPILE:=1 |
| 118 | endif |
| 119 | endif |
| 120 | |
Nico Huber | 1823d53 | 2020-11-16 22:50:49 +0100 | [diff] [blame] | 121 | xcompile ?= $(obj)/xcompile |
| 122 | $(xcompile): $(top)/../../util/xcompile/xcompile |
| 123 | $< $(XGCCPATH) > $@.tmp |
| 124 | \mv -f $@.tmp $@ 2> /dev/null |
| 125 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 126 | ifeq ($(NOCOMPILE),1) |
| 127 | include $(TOPLEVEL)/Makefile.inc |
| 128 | real-all: config |
| 129 | |
Uwe Hermann | ea87245 | 2008-10-22 15:49:20 +0000 | [diff] [blame] | 130 | else |
| 131 | |
Patrick Georgi | 0ffef88 | 2017-01-19 23:20:14 +0100 | [diff] [blame] | 132 | # in addition to the dependency below, create the file if it doesn't exist |
| 133 | # to silence stupid warnings about a file that would be generated anyway. |
Nico Huber | 1823d53 | 2020-11-16 22:50:49 +0100 | [diff] [blame] | 134 | $(if $(wildcard $(xcompile)),,$(shell \ |
| 135 | mkdir -p $(dir $(xcompile)) && \ |
| 136 | $(top)/../../util/xcompile/xcompile $(XGCCPATH) > $(xcompile) || rm -f $(xcompile))) |
Patrick Georgi | 0ffef88 | 2017-01-19 23:20:14 +0100 | [diff] [blame] | 137 | |
Nico Huber | 1823d53 | 2020-11-16 22:50:49 +0100 | [diff] [blame] | 138 | include $(xcompile) |
Patrick Georgi | 0ffef88 | 2017-01-19 23:20:14 +0100 | [diff] [blame] | 139 | |
Nico Huber | 1823d53 | 2020-11-16 22:50:49 +0100 | [diff] [blame] | 140 | ifneq ($(XCOMPILE_COMPLETE),1) |
| 141 | $(shell rm -f $(xcompile)) |
| 142 | $(error $(xcompile) deleted because it's invalid. \ |
| 143 | Restarting the build should fix that, or explain the problem) |
| 144 | endif |
Patrick Georgi | 0ffef88 | 2017-01-19 23:20:14 +0100 | [diff] [blame] | 145 | |
Patrick Georgi | b144a34 | 2017-01-25 14:21:12 +0100 | [diff] [blame] | 146 | CC := $(CC_$(ARCH-y)) |
| 147 | AS := $(AS_$(ARCH-y)) |
| 148 | LD := $(LD_$(ARCH-y)) |
| 149 | NM := $(NM_$(ARCH-y)) |
| 150 | OBJCOPY := $(OBJCOPY_$(ARCH-y)) |
| 151 | OBJDUMP := $(OBJDUMP_$(ARCH-y)) |
| 152 | READELF := $(READELF_$(ARCH-y)) |
| 153 | STRIP := $(STRIP_$(ARCH-y)) |
| 154 | AR := $(AR_$(ARCH-y)) |
| 155 | |
Raul E Rangel | 50a2a86 | 2018-07-13 15:16:58 -0600 | [diff] [blame] | 156 | CFLAGS += -std=gnu11 $(CFLAGS_$(ARCH-y)) |
Patrick Georgi | b144a34 | 2017-01-25 14:21:12 +0100 | [diff] [blame] | 157 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 158 | ifneq ($(INNER_SCANBUILD),y) |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 159 | ifeq ($(CONFIG_LP_COMPILER_LLVM_CLANG),y) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 160 | CC:=clang -m32 |
| 161 | HOSTCC:=clang |
| 162 | endif |
| 163 | endif |
| 164 | |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 165 | ifeq ($(CONFIG_LP_CCACHE),y) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 166 | CCACHE:=$(word 1,$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH))))) |
| 167 | ifeq ($(CCACHE),) |
| 168 | $(error ccache selected, but not found in PATH) |
| 169 | endif |
| 170 | CCACHE:=CCACHE_COMPILERCHECK=content CCACHE_BASEDIR=$(top) $(CCACHE) |
| 171 | CC := $(CCACHE) $(CC) |
| 172 | HOSTCC := $(CCACHE) $(HOSTCC) |
| 173 | HOSTCXX := $(CCACHE) $(HOSTCXX) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 174 | endif |
| 175 | |
| 176 | strip_quotes = $(subst ",,$(subst \",,$(1))) |
| 177 | |
| 178 | # The primary target needs to be here before we include the |
| 179 | # other files |
| 180 | |
| 181 | ifeq ($(INNER_SCANBUILD),y) |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 182 | CONFIG_LP_SCANBUILD_ENABLE:= |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 183 | endif |
| 184 | |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 185 | ifeq ($(CONFIG_LP_SCANBUILD_ENABLE),y) |
| 186 | ifneq ($(CONFIG_LP_SCANBUILD_REPORT_LOCATION),) |
| 187 | CONFIG_LP_SCANBUILD_REPORT_LOCATION:=-o $(CONFIG_LP_SCANBUILD_REPORT_LOCATION) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 188 | endif |
| 189 | real-all: |
| 190 | echo '#!/bin/sh' > .ccwrap |
| 191 | echo 'CC="$(CC)"' >> .ccwrap |
| 192 | echo 'if [ "$$1" = "--hostcc" ]; then shift; CC="$(HOSTCC)"; fi' >> .ccwrap |
| 193 | echo 'if [ "$$1" = "--hostcxx" ]; then shift; CC="$(HOSTCXX)"; fi' >> .ccwrap |
| 194 | echo 'eval $$CC $$*' >> .ccwrap |
| 195 | chmod +x .ccwrap |
Gabe Black | 1ee2c6d | 2013-08-09 04:27:35 -0700 | [diff] [blame] | 196 | scan-build $(CONFIG_LP_SCANBUILD_REPORT_LOCATION) -analyze-headers --use-cc=$(top)/.ccwrap --use-c++=$(top)/.ccwrap $(MAKE) INNER_SCANBUILD=y |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 197 | else |
| 198 | real-all: real-target |
| 199 | endif |
| 200 | |
| 201 | # must come rather early |
| 202 | .SECONDEXPANSION: |
| 203 | |
Nico Huber | 602a82a | 2015-09-09 13:02:51 +0200 | [diff] [blame] | 204 | $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 205 | $(MAKE) oldconfig |
| 206 | |
| 207 | # Add a new class of source/object files to the build system |
| 208 | add-class= \ |
| 209 | $(eval $(1)-srcs:=) \ |
| 210 | $(eval $(1)-objs:=) \ |
| 211 | $(eval classes+=$(1)) |
| 212 | |
| 213 | # Special classes are managed types with special behaviour |
| 214 | # On parse time, for each entry in variable $(1)-y |
| 215 | # a handler $(1)-handler is executed with the arguments: |
| 216 | # * $(1): directory the parser is in |
| 217 | # * $(2): current entry |
| 218 | add-special-class= \ |
| 219 | $(eval $(1):=) \ |
| 220 | $(eval special-classes+=$(1)) |
| 221 | |
| 222 | # Clean -y variables, include Makefile.inc |
| 223 | # Add paths to files in X-y to X-srcs |
| 224 | # Add subdirs-y to subdirs |
| 225 | includemakefiles= \ |
| 226 | $(foreach class,classes subdirs $(classes) $(special-classes), $(eval $(class)-y:=)) \ |
| 227 | $(eval -include $(1)) \ |
| 228 | $(foreach class,$(classes-y), $(call add-class,$(class))) \ |
Arthur Heymans | 6c2324a | 2019-10-29 18:36:46 +0100 | [diff] [blame] | 229 | $(foreach special,$(special-classes), \ |
| 230 | $(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \ |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 231 | $(foreach class,$(classes), \ |
| 232 | $(eval $(class)-srcs+= \ |
| 233 | $$(subst $(top)/,, \ |
| 234 | $$(abspath $$(addprefix $(dir $(1)),$$($(class)-y)))))) \ |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 235 | $(eval subdirs+=$$(subst $(CURDIR)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))) |
| 236 | |
| 237 | # For each path in $(subdirs) call includemakefiles |
| 238 | # Repeat until subdirs is empty |
| 239 | evaluate_subdirs= \ |
| 240 | $(eval cursubdirs:=$(subdirs)) \ |
| 241 | $(eval subdirs:=) \ |
| 242 | $(foreach dir,$(cursubdirs), \ |
| 243 | $(eval $(call includemakefiles,$(dir)/Makefile.inc))) \ |
| 244 | $(if $(subdirs),$(eval $(call evaluate_subdirs))) |
| 245 | |
| 246 | # collect all object files eligible for building |
| 247 | subdirs:=$(TOPLEVEL) |
| 248 | $(eval $(call evaluate_subdirs)) |
| 249 | |
| 250 | src-to-obj=$(addsuffix .$(1).o, $(basename $(addprefix $(obj)/, $($(1)-srcs)))) |
| 251 | $(foreach class,$(classes),$(eval $(class)-objs:=$(call src-to-obj,$(class)))) |
| 252 | |
| 253 | allsrcs:=$(foreach var, $(addsuffix -srcs,$(classes)), $($(var))) |
| 254 | allobjs:=$(foreach var, $(addsuffix -objs,$(classes)), $($(var))) |
| 255 | alldirs:=$(sort $(abspath $(dir $(allobjs)))) |
| 256 | |
| 257 | # macro to define template macros that are used by use_template macro |
| 258 | define create_cc_template |
| 259 | # $1 obj class |
| 260 | # $2 source suffix (c, S) |
| 261 | # $3 additional compiler flags |
| 262 | # $4 additional dependencies |
| 263 | ifn$(EMPTY)def $(1)-objs_$(2)_template |
| 264 | de$(EMPTY)fine $(1)-objs_$(2)_template |
Gabe Black | f06111a | 2013-03-12 15:50:08 -0700 | [diff] [blame] | 265 | $(obj)/$$(1).$(1).o: $$(1).$(2) $(obj)/libpayload-config.h $(4) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 266 | @printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n" |
| 267 | $(CC) $(3) -MMD $$$$(CFLAGS) -c -o $$$$@ $$$$< |
| 268 | en$(EMPTY)def |
| 269 | end$(EMPTY)if |
| 270 | endef |
| 271 | |
| 272 | filetypes-of-class=$(subst .,,$(sort $(suffix $($(1)-srcs)))) |
| 273 | $(foreach class,$(classes), \ |
| 274 | $(foreach type,$(call filetypes-of-class,$(class)), \ |
| 275 | $(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts),$($(class)-$(type)-deps))))) |
| 276 | |
| 277 | foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(basename $(file))))) |
| 278 | $(eval $(foreach class,$(classes),$(call foreach-src,$(class)))) |
| 279 | |
| 280 | DEPENDENCIES = $(allobjs:.o=.d) |
| 281 | -include $(DEPENDENCIES) |
| 282 | |
| 283 | printall: |
| 284 | @$(foreach class,$(classes),echo $(class)-objs:=$($(class)-objs); ) |
| 285 | @echo alldirs:=$(alldirs) |
| 286 | @echo allsrcs=$(allsrcs) |
| 287 | @echo DEPENDENCIES=$(DEPENDENCIES) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 288 | @$(foreach class,$(special-classes),echo $(class):='$($(class))'; ) |
Uwe Hermann | ea87245 | 2008-10-22 15:49:20 +0000 | [diff] [blame] | 289 | |
| 290 | endif |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 291 | |
Stefan Reinauer | ed56499 | 2015-06-11 14:57:36 -0700 | [diff] [blame] | 292 | $(shell mkdir -p $(KCONFIG_SPLITCONFIG) $(obj) $(objk)/lxdialog $(additional-dirs) $(alldirs)) |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 293 | |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 294 | cscope: |
| 295 | cscope -bR |
| 296 | |
| 297 | doxy: doxygen |
| 298 | doxygen: |
| 299 | $(DOXYGEN) Doxyfile |
| 300 | |
| 301 | doxyclean: doxygen-clean |
| 302 | doxygen-clean: |
| 303 | rm -rf $(DOXYGEN_OUTPUT_DIR) |
| 304 | |
| 305 | clean-for-update: doxygen-clean clean-for-update-target |
Nico Huber | 1823d53 | 2020-11-16 22:50:49 +0100 | [diff] [blame] | 306 | rm -f $(allobjs) $(xcompile) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 307 | rm -f $(DEPENDENCIES) |
| 308 | rmdir -p $(alldirs) 2>/dev/null >/dev/null || true |
| 309 | |
| 310 | clean: clean-for-update clean-target |
Martin Roth | 6959f5c | 2016-03-23 16:07:54 -0600 | [diff] [blame] | 311 | rm -f .ccwrap junit_config junit_config.old |
Patrick Georgi | b144a34 | 2017-01-25 14:21:12 +0100 | [diff] [blame] | 312 | rm -rf $(obj) |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 313 | |
| 314 | clean-cscope: |
| 315 | rm -f cscope.out |
| 316 | |
Patrick Georgi | b144a34 | 2017-01-25 14:21:12 +0100 | [diff] [blame] | 317 | distclean: clean-cscope clean |
Martin Roth | 6959f5c | 2016-03-23 16:07:54 -0600 | [diff] [blame] | 318 | rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile junit.xml |
Patrick Georgi | b3db79e | 2011-04-21 18:48:50 +0200 | [diff] [blame] | 319 | |
Paul Kocialkowski | 5d5fcdd | 2015-08-03 16:44:01 +0200 | [diff] [blame] | 320 | .PHONY: $(PHONY) clean clean-cscope cscope distclean doxygen doxy |