-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
600 lines (473 loc) · 17.9 KB
/
Makefile
File metadata and controls
600 lines (473 loc) · 17.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 0
EXTRAVERSION = -alpha9
NAME = Get the ball rolling!
# put scripts' path into searchpath and don't print "Entering directory"
# be or not to be verbose (V=1 be)
ifdef V
ifeq ("$(origin V)","command line")
KBUILD_VERBOSE = $(V)
endif
endif
ifndef KBUILD_VERBOSE
KBUILD_VERBOSE = 0
endif
# Build external stuff
ifeq ("$(origin M)", "command line")
KBUILD_EXTMOD := $(M)
endif
export KBUILD_EXTMOD
# default goal when none is given on the command line
PHONY := __all
__all:
# Cancel implicit rules on top Makefile
$(CURDIR)/Makefile Makefile: ;
# prepare build environment
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
objtree := $(CURDIR)
src := $(srctree)
obj := $(objtree)
VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
export srctree objtree VPATH
MAKE ?= make
# no built-in implicit rules variables
# Do not print "Entering directory..."
MAKEFLAGS += -rR --no-print-directory
AS = $(CROSS_COMPILE)as
AR = $(CROSS_COMPILE)ar
LD = $(CROSS_COMPILE)ld
CXX = $(CROSS_COMPILE)g++
CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
NM = $(CROSS_COMPILE)nm
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
RANLIB = $(CROSS_COMPILE)ranlib
READELF = $(CROSS_COMPILE)readelf
OBJCOPY = $(CROSS_COMPILE)objcopy
PERL = perl
# SUBARCH tells the usermode build what the underlying arch is. That is set
# first, and if a usermode build is happening, the "ARCH=um" on the command
# line overrides the setting of ARCH below. If a native build is happening,
# then ARCH is assigned, getting whatever value it gets normally, and
# SUBARCH is subsequently ignored.
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/sh.*/sh/ )
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.
# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)
SRCARCH := $(ARCH)
# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
SRCARCH := x86
endif
# Where to locate arch specific headers
hdr-arch := $(SRCARCH)
# Where to locate arch specific libraries
lib-arch := arch/$(SRCARCH)/lib
export lib-arch hdr-arch
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(strip $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION))
export KERNELRELEASE KERNELVERSION
KBUILD_CPPFLAGS := -D__ARCH__=$(SRCARCH) -D__KERNELVERSION__=$(KERNELVERSION) \
-D__SRCROOT__=$(srctree)
# general build options for asm
# Note: Even if there is __ASSEMBLER__ symbol defined by gcc with define our own.
# The __ASSEMBLY__ is prefered for now.
KBUILD_AFLAGS := -D__ASSEMBLY__
# general build options for c
KBUILD_CFLAGS := -Wall -Wstrict-prototypes -fno-builtin -nostdinc -fno-exceptions \
-ffreestanding
# general build options for c++
KBUILD_CXXFLAGS := -fno-builtin -fno-rtti -nostdinc++ \
-fno-exceptions -Wall
# common linker flags
LDFLAGS := -nostdlib
KBUILD_ARFLAGS := rcs
# includes only common headers files for all architectures,
# specific architecture headers are done by macros
NUCLEOSINCLUDE := -Iinclude \
-Iarch/$(hdr-arch)/include \
-include include/nucleos/autoconf.h
# shell used by build system
CONFIG_SHELL := $(shell if [ -x "$BASH" ]; then echo $BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
HOSTAR = ar
HOSTCC = gcc
HOSTAS = $(HOSTCC)
HOSTCXX = g++
HOSTCPP = $(HOSTCC) -E
HOSTLD = gcc
HOSTNM = nm
HOSTOBJCOPY = objcopy
HOSTOBJDUMP = objdump
HOSTRANLIB = ranlib
export HOSTAR HOSTAR HOSTCC HOSTAS HOSTCXX HOSTCPP HOSTLD \
HOSTNM HOSTOBJCOPY HOSTOBJDUMP HOSTRANLIB
export UTS_MACHINE
HOST_CFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
HOST_PPFLAGS := -D__HOST__ -D__SRCROOT__=$(srctree)
export HOST_CFLAGS HOST_PPFLAGS
# variables to export
export AR ARCH AS AS16 AS64 KBUILD_AFLAGS CC CC16 CC64 CONFIG_SHELL CPP \
CXX CXX16 CXX64 CXXFLAGS EXTRA_CFLAGS INSTALL_PATH LD LDFLAGS \
MAKE NUCLEOSINCLUDE OBJCOPY PERL RANLIB READELF SRCARCH
export KBUILD_ARFLAGS KBUILD_CFLAGS KBUILD_CPPFLAGS NOSTDINC_FLAGS
# Files to ignore in find ... statements
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
### Configuration
ifeq ($(KBUILD_VERBOSE),1)
quiet =
Q =
else
quiet = quiet_
Q = @
endif
ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet = silent_
endif
export quiet Q KBUILD_VERBOSE
# Makefiles relative to root
MAKEFLAGS += --include-dir=$(srctree)
# Include some helper functions (dont try to remake the file)
$(srctree)/scripts/mk/Kbuild.include: ;
include $(srctree)/scripts/mk/Kbuild.include
### Preparation for build (common for all architecture)
KCONFIG_CONFIG ?= .config
ifeq ($(KBUILD_EXTMOD),)
PHONY += scripts_basic
scripts_basic:
$(Q)$(MAKE) -f scripts/mk/Makefile.build obj=scripts/basic
# To avoid any implicit rule to kick in, define an empty command.
scripts/basic/%: scripts_basic ;
scripts_tools:
$(Q)$(MAKE) -f scripts/mk/Makefile.build obj=scripts/tools
endif
# goals that don't need .config
no-dot-config-targets := clean distclean help mrproper tools \
include/nucleos/version.h headers_%
# possible %config goals
config-goals := config %_defconfig defconfig menuconfig xconfig gconfig \
randconfig allyesconfig allnoconfig silentoldconfig
config-targets := 0
mixed-targets := 0
dot-config := 1
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
dot-config := 0
endif
endif
ifeq ($(KBUILD_EXTMOD),)
ifneq ($(filter $(config-goals),$(MAKECMDGOALS)),)
config-targets := 1
ifneq ($(filter-out $(config-goals),$(MAKECMDGOALS)),)
mixed-targets := 1
endif
endif
endif
ifeq ($(mixed-targets),1)
# ===========================================================================
# We're called with mixed targets (*config and build targets).
# Handle them one by one.
$(MAKECMDGOALS): FORCE
$(Q)$(MAKE) -f $(srctree)/Makefile $@
else
ifeq ($(config-targets),1)
# include architecture goals, vars,...
# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
# KBUILD_DEFCONFIG may point out an alternative default configuration
# used for 'make defconfig'
include $(srctree)/arch/$(SRCARCH)/Makefile
export KBUILD_DEFCONFIG KBUILD_KCONFIG
config: scripts_basic FORCE
$(Q)mkdir -p include/nucleos include/config
$(Q)$(MAKE) -f scripts/mk/Makefile.build obj=scripts/kconfig $@
%config: scripts_basic FORCE
$(Q)mkdir -p include/nucleos include/config
$(Q)$(MAKE) -f scripts/mk/Makefile.build obj=scripts/kconfig $@
else # $(config-targets) == 1
# ===========================================================================
# Build targets only. In general all targets except *config targets.
ifeq ($(KBUILD_EXTMOD),)
# directories we have to visit
drivers-y := drivers/
servers-y := servers/
core-y := kernel/ init/
libs-y := lib/
endif
# we need .config
ifeq ($(dot-config),1)
# Read in config
-include include/config/auto.conf
ifeq ($(KBUILD_EXTMOD),)
# Read in dependencies to all Kconfig* files, make sure to run
# oldconfig if changes are detected.
-include include/config/auto.conf.cmd
# To avoid any implicit rule to kick in, define an empty command
$(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
# If .config is newer than include/config/auto.conf, someone tinkered
# with it and forgot to run make oldconfig.
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
else
# external modules needs include/nucleos/autoconf.h and include/config/auto.conf
# but do not care if they are up-to-date. Use auto.conf to trigger the test
PHONY += include/config/auto.conf
include/config/auto.conf:
$(Q)test -e include/nucleos/autoconf.h -a -e $@ || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/nucleos/autoconf.h or $@ are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
endif # KBUILD_EXTMOD
else # $(dot-config) == 0
# Dummy target needed, because used as prerequisite
include/config/auto.conf: ;
endif # $(dot-config)
ifdef CONFIG_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
# for .cc files
KBUILD_CXXFLAGS += -Os
else
KBUILD_CFLAGS += -O2
# for .cc files
KBUILD_CXXFLAGS += -O2
endif
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
KBUILD_CXXFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
KBUILD_CFLAGS += -fomit-frame-pointer
KBUILD_CXXFLAGS += -fomit-frame-pointer
endif
ifneq ($(CONFIG_FRAME_WARN),0)
KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
endif
# arch Makefile may override CC so keep this after arch Makefile is included
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
CHECKFLAGS += $(NOSTDINC_FLAGS)
ifeq ($(KBUILD_EXTMOD),)
# Generate some files
# ---------------------------------------------------------------------------
# KERNELRELEASE can change from a few different places, meaning version.h
# needs to be updated, so this check is forced on all builds
localver = $(subst $(space),, $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
kernelrelease = $(KERNELVERSION)$(localver)
include/config/kernel.release: include/config/auto.conf FORCE
$(Q)rm -f $@
$(Q)echo $(kernelrelease) > $@
uts_len := 64
define filechk_utsrelease.h
if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi; \
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
endef
define filechk_version.h
(echo \#define NUCLEOS_VERSION_CODE $(shell \
expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef
# for drivers
include/nucleos/version.h: $(srctree)/Makefile FORCE
$(call filechk,version.h)
include/nucleos/utsrelease.h: include/config/kernel.release FORCE
$(call filechk,utsrelease.h)
# ---------------------------------------------------------------------------
# Things we need to do before we recursively start building the kernel
# or the modules are listed in "prepare".
# A multi level approach is used. prepareN is processed before prepareN-1.
# archprepare is used in arch Makefiles and when processed asm symlink,
# version.h and scripts_basic is processed / created.
# Listed in order dependency
PHONY += prepare prepare0 prepare1 prepare2
prepare2: include/config/kernel.release
prepare1: prepare2 include/nucleos/version.h include/nucleos/utsrelease.h \
include/config/auto.conf
archprepare: prepare1 scripts_basic
prepare0: archprepare FORCE
# All the preparing
prepare: prepare0
else # KBUILD_EXTMOD
# dummy targets
prepare: ;
scripts_tools: ;
endif
# default goal (build everything)
__all: __build
# include architecture goals, vars,...
# expand others if needed
include arch/$(SRCARCH)/Makefile
# compiler directories (includes & libs)
cc-install-dir = $(__cc-install-dir)
cc-include-dir = $(__cc-include-dir)
cc-lib-dir = $(__cc-lib-dir)
cc-version = $(__cc-version)
cc-version-str = $(__cc-version-str)
# export these values
export cc-install-dir cc-include-dir \
cc-lib-dir cc-version cc-version-str
#! compiler directories (includes & libs)
ifeq ($(KBUILD_EXTMOD),)
# Here we have setup in this Makefile plus expanded in arch Makefile
# @klenovic: keep the libs as first for now
nucleos-dirs := $(patsubst %/,%,$(libs-y) $(drivers-y) $(servers-y) $(core-y))
nucleos-alldirs := $(patsubst %/,%,$(libs-y) $(drivers-y) $(servers-y) $(core-y) \
$(libs-) $(drivers-) $(servers-) $(core-))
# build object files
__build: $(nucleos-dirs)
# create kernel image
image: __all
# explicit goal to create tools
# Note that we must compile the `fixdep' too
tools: scripts_basic scripts_tools
# dirs to build
PHONY += $(nucleos-dirs)
$(nucleos-dirs): prepare scripts_tools
$(Q)$(MAKE) -f scripts/mk/Makefile.build obj=$@
# ---------------------------------------------------------------------------
# Kernel headers
#Default location for installed headers
export INSTALL_HDR_PATH = $(objtree)/usr
hdr-inst := -rR -f $(srctree)/scripts/mk/Makefile.headersinst obj
# Find out where the Kbuild file is located to support
# arch/$(ARCH)/include/asm
hdr-dir = $(strip \
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \
arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch)))
# If we do an all arch process set dst to asm-$(hdr-arch)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
PHONY += __headers
__headers: include/nucleos/version.h scripts_basic FORCE
$(Q)$(MAKE) $(build)=scripts/unifdef scripts/unifdef/unifdef
PHONY += headers_install_all
headers_install_all:
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install
PHONY += headers_install
headers_install: __headers
$(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \
$(error Headers not exportable for the $(SRCARCH) architecture))
$(Q)$(MAKE) $(hdr-inst)=include
$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst)
PHONY += headers_check_all
headers_check_all: headers_install_all
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check
PHONY += headers_check
headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1
# ---------------------------------------------------------------------------
###
# Cleaning is done on three levels.
# make clean Delete most generated files
# Leave enough to build external modules
# make mrproper Delete the current configuration, and all generated files
# make distclean Remove editor backup files, patch leftover files and the like
# Directories & files removed with 'make clean'
CLEAN_DIRS +=
CLEAN_FILES +=
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config usr/include
MRPROPER_FILES += .config .config.old include/asm .version .old_version \
include/nucleos/autoconf.h include/nucleos/version.h \
include/nucleos/utsrelease.h cscope*
# clean - Delete most, but leave enough to build external modules
#
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
clean-dirs := $(addprefix _clean_,$(patsubst %/,%,$(srctree) $(nucleos-alldirs)))
PHONY += $(clean-dirs) clean archclean
$(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
clean: archclean $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find . $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' \
-o -name '.tmp.*' -o -name '*.mri' \) \
-type f -print | xargs rm -f
# mrproper - Delete all generated files, including .config
#
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
mrproper-dirs := $(addprefix _mrproper_, scripts)
PHONY += $(mrproper-dirs) mrproper archmrproper
$(mrproper-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
mrproper: clean archmrproper $(mrproper-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
# distclean
#
PHONY += distclean
distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -size 0 \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f
else # KBUILD_EXTMOD
module-dirs := $(KBUILD_EXTMOD)
__build: $(module-dirs)
PHONY += $(module-dirs)
$(module-dirs):
$(Q)$(MAKE) -f scripts/mk/Makefile.build obj=$@
clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))
PHONY += $(clean-dirs) clean
$(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
clean: rm-dirs :=
clean: rm-files :=
clean: $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '.tmp.*' \) \
-type f -print | xargs rm -f
endif # KBUILD_EXTMOD
endif # ifeq ($(config-targets),1)
endif # ifeq ($(mixed-targets),1)
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/mk/Makefile.clean obj
quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
cmd_rmdirs = rm -rf $(rm-dirs)
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
cmd_rmfiles = rm -f $(rm-files)
PHONY += FORCE
FORCE:
.PHONY: $(PHONY)