[PATCH] x86-64 Bootloader updates
[linux-2.6/history.git] / Rules.make
blobaffdf72286aeab5188a560398a03584f8b17ad3c
2 # This file contains rules which are shared between multiple Makefiles.
5 # Some standard vars
7 comma := ,
8 empty :=
9 space := $(empty) $(empty)
11 # Some bug traps
12 # ---------------------------------------------------------------------------
14 ifdef O_TARGET
15 $(error kbuild: $(obj)/Makefile - Usage of O_TARGET := $(O_TARGET) is obsolete in 2.5. Please fix!)
16 endif
18 ifdef L_TARGET
19 ifneq ($(L_TARGET),lib.a)
20 $(warning kbuild: $(obj)/Makefile - L_TARGET := $(L_TARGET) target shall be renamed to lib.a. Please fix!)
21 endif
22 endif
24 ifdef list-multi
25 $(warning kbuild: $(obj)/Makefile - list-multi := $(list-multi) is obsolete in 2.5. Please fix!)
26 endif
28 # Some paths for the Makefiles to use
29 # ---------------------------------------------------------------------------
31 # FIXME. For now, we leave it possible to use make -C or make -f
32 # to do work in subdirs.
34 ifndef obj
35 obj = .
36 CFLAGS := $(patsubst -I%,-I$(TOPDIR)/%,$(patsubst -I$(TOPDIR)/%,-I%,$(CFLAGS)))
37 AFLAGS := $(patsubst -I%,-I$(TOPDIR)/%,$(patsubst -I$(TOPDIR)/%,-I%,$(AFLAGS)))
38 endif
40 # For use in the quiet output
41 echo_target = $@
43 # Usage:
45 # $(obj)/target.o : target.o in the build dir
46 # $(src)/target.c : target.c in the source dir
47 # $(objtree)/include/linux/version.h : Some file relative to the build
48 # dir root
49 # $(srctree)/include/linux/module.h : Some file relative to the source
50 # dir root
52 # $(obj) and $(src) can only be used in the section after
53 # include $(TOPDIR)/Rules.make, i.e for generated files and the like.
54 # Intentionally.
56 # We don't support separate source / object yet, so these are just
57 # placeholders for now
59 src := $(obj)
61 # Figure out what we need to build from the various variables
62 # ===========================================================================
64 # When an object is listed to be built compiled-in and modular,
65 # only build the compiled-in version
67 obj-m := $(filter-out $(obj-y),$(obj-m))
69 # Handle objects in subdirs
70 # ---------------------------------------------------------------------------
71 # o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o
72 # and add the directory to the list of dirs to descend into: $(subdir-y)
73 # o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
74 # and add the directory to the list of dirs to descend into: $(subdir-m)
76 __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
77 subdir-y += $(__subdir-y)
78 __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
79 subdir-m += $(__subdir-m)
80 __subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n)))
81 subdir-n += $(__subdir-n)
82 __subdir- := $(patsubst %/,%,$(filter %/, $(obj-)))
83 subdir- += $(__subdir-)
84 obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
85 obj-m := $(filter-out %/, $(obj-m))
87 # Subdirectories we need to descend into
89 subdir-ym := $(sort $(subdir-y) $(subdir-m))
91 # export.o is never a composite object, since $(export-objs) has a
92 # fixed meaning (== objects which EXPORT_SYMBOL())
93 __obj-y = $(filter-out export.o,$(obj-y))
94 __obj-m = $(filter-out export.o,$(obj-m))
96 # if $(foo-objs) exists, foo.o is a composite object
97 multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $($(m:.o=-objs)), $(m))))
98 multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(m:.o=-objs)), $(m))))
100 # Build list of the parts of our composite objects, our composite
101 # objects depend on those (obviously)
102 multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)))
103 multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)))
105 # $(subdir-obj-y) is the list of objects in $(obj-y) which do not live
106 # in the local directory
107 subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
109 # Replace multi-part objects by their individual parts, look at local dir only
110 real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m))) $(EXTRA_TARGETS)
111 real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m)))
113 # Only build module versions for files which are selected to be built
114 export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m))
116 # Add subdir path
118 EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
119 obj-y := $(addprefix $(obj)/,$(obj-y))
120 obj-m := $(addprefix $(obj)/,$(obj-m))
121 export-objs := $(addprefix $(obj)/,$(export-objs))
122 subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
123 real-objs-y := $(addprefix $(obj)/,$(real-objs-y))
124 real-objs-m := $(addprefix $(obj)/,$(real-objs-m))
125 multi-used-y := $(addprefix $(obj)/,$(multi-used-y))
126 multi-used-m := $(addprefix $(obj)/,$(multi-used-m))
127 multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y))
128 multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))
129 subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
131 # The temporary file to save gcc -MD generated dependencies must not
132 # contain a comma
133 depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
135 # We're called for one of three purposes:
136 # o fastdep: build module version files (.ver) for $(export-objs) in
137 # the current directory
138 # o modules_install: install the modules in the current directory
139 # o build: When no target is given, first_rule is the default and
140 # will build the built-in and modular objects in this dir
141 # (or a subset thereof, depending on $(KBUILD_MODULES),$(KBUILD_BUILTIN)
142 # When targets are given directly (like foo.o), we just build these
143 # targets (That happens when someone does make some/dir/foo.[ois])
145 ifeq ($(MAKECMDGOALS),fastdep)
147 # ===========================================================================
148 # Module versions
149 # ===========================================================================
151 ifeq ($(strip $(export-objs)),)
153 # If we don't export any symbols in this dir, just descend
154 # ---------------------------------------------------------------------------
156 fastdep: $(subdir-ym)
157 @/bin/true
159 else
161 # This sets version suffixes on exported symbols
162 # ---------------------------------------------------------------------------
164 MODVERDIR := include/linux/modules/
167 # Added the SMP separator to stop module accidents between uniprocessor
168 # and SMP Intel boxes - AC - from bits by Michael Chastain
171 ifdef CONFIG_SMP
172 genksyms_smp_prefix := -p smp_
173 else
174 genksyms_smp_prefix :=
175 endif
177 # Don't include modversions.h, we're just about to generate it here.
179 CFLAGS_MODULE := $(filter-out -include linux/modversions.h,$(CFLAGS_MODULE))
181 $(addprefix $(MODVERDIR)/,$(real-objs-y:.o=.ver)): modkern_cflags := $(CFLAGS_KERNEL)
182 $(addprefix $(MODVERDIR)/,$(real-objs-m:.o=.ver)): modkern_cflags := $(CFLAGS_MODULE)
183 $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver)): export_flags := -D__GENKSYMS__
185 c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
186 $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
187 -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
188 $(export_flags)
190 # Our objects only depend on modversions.h, not on the individual .ver
191 # files (fix-dep filters them), so touch modversions.h if any of the .ver
192 # files changes
194 quiet_cmd_cc_ver_c = MKVER include/linux/modules/$*.ver
195 cmd_cc_ver_c = $(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
196 -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
198 # Okay, let's explain what's happening in rule_make_cc_ver_c:
199 # o echo the command
200 # o execute the command
201 # o If the $(CPP) fails, we won't notice because it's output is piped
202 # to $(GENKSYMS) which does not fail. We recognize this case by
203 # looking if the generated $(depfile) exists, though.
204 # o If the .ver file changed, touch modversions.h, which is our maker
205 # of any changed .ver files.
206 # o Move command line and deps into their normal .*.cmd place.
208 define rule_cc_ver_c
209 $(if $($(quiet)cmd_cc_ver_c),echo ' $($(quiet)cmd_cc_ver_c)';) \
210 $(cmd_cc_ver_c); \
211 if [ ! -r $(depfile) ]; then exit 1; fi; \
212 scripts/fixdep $(depfile) $@ '$(cmd_cc_ver_c)' > $(@D)/.$(@F).tmp; \
213 rm -f $(depfile); \
214 if [ ! -r $@ ] || cmp -s $@ $@.tmp; then \
215 touch include/linux/modversions.h; \
216 fi; \
217 mv -f $@.tmp $@
218 mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
219 endef
221 $(MODVERDIR)/%.ver: %.c FORCE
222 @$(call if_changed_rule,cc_ver_c)
224 targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
226 fastdep: $(targets) $(subdir-ym)
227 @mkdir -p $(dir $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver)))
228 @touch $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver))
230 endif # export-objs
232 else # ! fastdep
233 ifeq ($(MAKECMDGOALS),modules_install)
235 # ==========================================================================
236 # Installing modules
237 # ==========================================================================
239 quiet_cmd_modules_install = INSTALL $(obj-m)
240 cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \
241 cp $(obj-m) $(MODLIB)/kernel/$(obj)
243 .PHONY: modules_install
245 modules_install: $(subdir-ym)
246 ifneq ($(obj-m),)
247 $(call cmd,modules_install)
248 else
249 @/bin/true
250 endif
252 else # ! modules_install
254 # ==========================================================================
255 # Building
256 # ==========================================================================
258 # If a Makefile does define neither O_TARGET nor L_TARGET,
259 # use a standard O_TARGET named "built-in.o"
261 ifndef O_TARGET
262 ifndef L_TARGET
263 O_TARGET := $(obj)/built-in.o
264 endif
265 endif
267 ifdef L_TARGET
268 L_TARGET := $(obj)/$(L_TARGET)
269 endif
271 first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
272 $(if $(KBUILD_MODULES),$(obj-m)) \
273 $(subdir-ym)
274 @/bin/true
276 # Compile C sources (.c)
277 # ---------------------------------------------------------------------------
279 # Default is built-in, unless we know otherwise
280 modkern_cflags := $(CFLAGS_KERNEL)
282 $(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
283 $(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE)
284 $(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE)
286 $(export-objs) : export_flags := $(EXPORT_FLAGS)
287 $(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS)
288 $(export-objs:.o=.s) : export_flags := $(EXPORT_FLAGS)
289 $(export-objs:.o=.lst): export_flags := $(EXPORT_FLAGS)
291 c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
292 $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
293 -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
294 $(export_flags)
296 quiet_cmd_cc_s_c = CC $(echo_target)
297 cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
299 %.s: %.c FORCE
300 $(call if_changed_dep,cc_s_c)
302 quiet_cmd_cc_i_c = CPP $(echo_target)
303 cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
305 %.i: %.c FORCE
306 $(call if_changed_dep,cc_i_c)
308 quiet_cmd_cc_o_c = CC $(echo_target)
309 cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
311 %.o: %.c FORCE
312 $(call if_changed_dep,cc_o_c)
314 quiet_cmd_cc_lst_c = MKLST $(echo_target)
315 cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && sh scripts/makelst $*.o System.map $(OBJDUMP) > $@
317 %.lst: %.c FORCE
318 $(call if_changed_dep,cc_lst_c)
320 # Compile assembler sources (.S)
321 # ---------------------------------------------------------------------------
323 modkern_aflags := $(AFLAGS_KERNEL)
325 $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
326 $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
328 a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \
329 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
331 quiet_cmd_as_s_S = CPP $(echo_target)
332 cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
334 %.s: %.S FORCE
335 $(call if_changed_dep,as_s_S)
337 quiet_cmd_as_o_S = AS $(echo_target)
338 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
340 %.o: %.S FORCE
341 $(call if_changed_dep,as_o_S)
343 targets += $(real-objs-y) $(real-objs-m) $(EXTRA_TARGETS) $(MAKECMDGOALS)
345 # Build the compiled-in targets
346 # ---------------------------------------------------------------------------
348 # To build objects in subdirs, we need to descend into the directories
349 $(sort $(subdir-obj-y)): $(subdir-ym) ;
352 # Rule to compile a set of .o files into one .o file
354 ifdef O_TARGET
355 quiet_cmd_link_o_target = LD $(echo_target)
356 # If the list of objects to link is empty, just create an empty O_TARGET
357 cmd_link_o_target = $(if $(strip $(obj-y)),\
358 $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\
359 rm -f $@; $(AR) rcs $@)
361 $(O_TARGET): $(obj-y) FORCE
362 $(call if_changed,link_o_target)
364 targets += $(O_TARGET)
365 endif # O_TARGET
368 # Rule to compile a set of .o files into one .a file
370 ifdef L_TARGET
371 quiet_cmd_link_l_target = AR $(echo_target)
372 cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
374 $(L_TARGET): $(obj-y) FORCE
375 $(call if_changed,link_l_target)
377 targets += $(L_TARGET)
378 endif
381 # Rule to link composite objects
384 quiet_cmd_link_multi = LD $(echo_target)
385 cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs)))),$^)
387 # We would rather have a list of rules like
388 # foo.o: $(foo-objs)
389 # but that's not so easy, so we rather make all composite objects depend
390 # on the set of all their parts
391 $(multi-used-y) : %.o: $(multi-objs-y) FORCE
392 $(call if_changed,link_multi)
394 $(multi-used-m) : %.o: $(multi-objs-m) FORCE
395 $(call if_changed,link_multi)
397 targets += $(multi-used-y) $(multi-used-m)
399 # Compile programs on the host
400 # ===========================================================================
402 host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
403 host-progs-multi := $(foreach m,$(host-progs),$(if $($(m)-objs),$(m)))
404 host-progs-multi-objs := $(foreach m,$(host-progs-multi),$($(m)-objs))
405 host-progs := $(addprefix $(obj)/,$(host-progs))
406 host-progs-single := $(addprefix $(obj)/,$(host-progs-single))
407 host-progs-multi := $(addprefix $(obj)/,$(host-progs-multi))
408 host-progs-multi-objs := $(addprefix $(obj)/,$(host-progs-multi-objs))
410 quiet_cmd_host_cc__c = HOSTCC $(echo_target)
411 cmd_host_cc__c = $(HOSTCC) -Wp,-MD,$(depfile) \
412 $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
413 $(HOST_LOADLIBES) -o $@ $<
415 $(host-progs-single): %: %.c FORCE
416 $(call if_changed_dep,host_cc__c)
418 quiet_cmd_host_cc_o_c = HOSTCC $(echo_target)
419 cmd_host_cc_o_c = $(HOSTCC) -Wp,-MD,$(depfile) \
420 $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $<
422 $(host-progs-multi-objs): %.o: %.c FORCE
423 $(call if_changed_dep,host_cc_o_c)
425 quiet_cmd_host_cc__o = HOSTLD $(echo_target)
426 cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj)/,$($(subst $(obj)/,,$@)-objs)) \
427 $(HOST_LOADLIBES)
429 $(host-progs-multi): %: $(host-progs-multi-objs) FORCE
430 $(call if_changed,host_cc__o)
432 targets += $(host-progs-single) $(host-progs-multi-objs) $(host-progs-multi)
434 endif # ! modules_install
435 endif # ! fastdep
437 # Shipped files
438 # ===========================================================================
440 quiet_cmd_shipped = SHIPPED $(echo_target)
441 cmd_shipped = cat $< > $@
443 %:: %_shipped
444 $(call cmd,shipped)
446 # Commands useful for building a boot image
447 # ===========================================================================
449 # Use as following:
451 # target: source(s) FORCE
452 # $(if_changed,ld/objcopy/gzip)
454 # and add target to EXTRA_TARGETS so that we know we have to
455 # read in the saved command line
457 # Linking
458 # ---------------------------------------------------------------------------
460 quiet_cmd_ld = LD $(echo_target)
461 cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
462 $(filter-out FORCE,$^) -o $@
464 # Objcopy
465 # ---------------------------------------------------------------------------
467 quiet_cmd_objcopy = OBJCOPY $(echo_target)
468 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $< $@
470 # Gzip
471 # ---------------------------------------------------------------------------
473 quiet_cmd_gzip = GZIP $(echo_target)
474 cmd_gzip = gzip -f -9 < $< > $@
476 # ===========================================================================
477 # Generic stuff
478 # ===========================================================================
480 # Descending
481 # ---------------------------------------------------------------------------
483 .PHONY: $(subdir-ym)
485 $(subdir-ym):
486 +@$(call descend,$@,$(MAKECMDGOALS))
488 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
489 # ---------------------------------------------------------------------------
491 .PHONY: FORCE
493 FORCE:
496 # This sets version suffixes on exported symbols
497 # Separate the object into "normal" objects and "exporting" objects
498 # Exporting objects are: all objects that define symbol tables
501 # ---------------------------------------------------------------------------
502 # Check if command line has changed
504 # Usage:
505 # normally one uses rules like
507 # %.o: %.c
508 # <command line>
510 # However, these only rebuild the target when the source has changed,
511 # but not when e.g. the command or the flags on the command line changed.
513 # This extension allows to do the following:
515 # command = <command line>
517 # %.o: %.c dummy
518 # $(call if_changed,command)
520 # which will make sure to rebuild the target when either its prerequisites
521 # change or the command line changes
523 # The magic works as follows:
524 # The addition of dummy to the dependencies causes the rule for rebuilding
525 # to be always executed. However, the if_changed function will generate
526 # an empty command when
527 # o none of the prequesites changed (i.e $? is empty)
528 # o the command line did not change (we compare the old command line,
529 # which is saved in .<target>.o, to the current command line using
530 # the two filter-out commands)
532 # Read all saved command lines and dependencies for the $(targets) we
533 # may be building above, using $(if_changed{,_dep}). As an
534 # optimization, we don't need to read them if the target does not
535 # exist, we will rebuild anyway in that case.
537 targets := $(wildcard $(sort $(targets)))
538 cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
540 ifneq ($(cmd_files),)
541 include $(cmd_files)
542 endif
544 # function to only execute the passed command if necessary
546 if_changed = $(if $(strip $? \
547 $(filter-out $(cmd_$(1)),$(cmd_$@))\
548 $(filter-out $(cmd_$@),$(cmd_$(1)))),\
549 @set -e; \
550 $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
551 $(cmd_$(1)); \
552 echo 'cmd_$@ := $(cmd_$(1))' > $(@D)/.$(@F).cmd)
555 # execute the command and also postprocess generated .d dependencies
556 # file
558 if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
559 $(filter-out $(cmd_$(1)),$(cmd_$@))\
560 $(filter-out $(cmd_$@),$(cmd_$(1)))),\
561 @set -e; \
562 $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
563 $(cmd_$(1)); \
564 scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \
565 rm -f $(depfile); \
566 mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
568 # Usage: $(call if_changed_rule,foo)
569 # will check if $(cmd_foo) changed, or any of the prequisites changed,
570 # and if so will execute $(rule_foo)
572 if_changed_rule = $(if $(strip $? \
573 $(filter-out $(cmd_$(1)),$(cmd_$@))\
574 $(filter-out $(cmd_$@),$(cmd_$(1)))),\
575 @set -e; \
576 mkdir -p $(dir $@); \
577 $(rule_$(1)))
579 # If quiet is set, only print short version of command
581 cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
583 # do_cmd is a shorthand used to support both compressed, verbose
584 # and silent output in a single line.
585 # Compared to cmd described avobe, do_cmd does no rely on any variables
586 # previously assigned a value.
588 # Usage $(call do_cmd,CMD $@,cmd_to_execute bla bla)
589 # Example:
590 # $(call do_cmd,CP $@,cp -b $< $@)
591 # make -s => nothing will be printed
592 # make KBUILD_VERBOSE=1 => cp -b path/to/src.file path/to/dest.file
593 # make KBUILD_VERBOSE=0 => CP path/to/dest.file
594 define do_cmd
595 @$(if $(filter quiet_,$(quiet)), echo ' $(1)' &&,
596 $(if $(filter silent_,$(quiet)),,
597 echo "$(2)" &&)) \
598 $(2)
599 endef
601 # $(call descend,<dir>,<target>)
602 # Recursively call a sub-make in <dir> with target <target>
604 ifeq ($(KBUILD_VERBOSE),1)
605 descend = echo '$(MAKE) -f $(1)/Makefile $(2)';
606 endif
607 descend += $(MAKE) -f $(1)/Makefile obj=$(1) $(2)