* [PATCH 1/4] kbuild: do not delete $@ explicitly on failure
@ 2020-04-30 5:13 Masahiro Yamada
2020-04-30 5:13 ` [PATCH 2/4] kbuild: sync filechk rule with Linux 5.7-rc2 Masahiro Yamada
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-04-30 5:13 UTC (permalink / raw)
To: barebox; +Cc: Masahiro Yamada
The .DELETE_ON_ERROR special target is specified in scripts/Kbuild.include
You do not need to delete $@ explicitly when the command fails.
GNU Make automatically does it.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Makefile | 6 +-----
arch/arm/tools/Makefile | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index de9b40ade..967c27909 100644
--- a/Makefile
+++ b/Makefile
@@ -643,11 +643,7 @@ define rule_barebox__
$(Q)$(if $($(quiet)cmd_sysmap), \
echo ' $($(quiet)cmd_sysmap) System.map' &&) \
- $(cmd_sysmap) $@ System.map; \
- if [ $$? -ne 0 ]; then \
- rm -f $@; \
- false; \
- fi;
+ $(cmd_sysmap) $@ System.map
endef
ifdef CONFIG_KALLSYMS
diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile
index 67ae9e701..bff825e58 100644
--- a/arch/arm/tools/Makefile
+++ b/arch/arm/tools/Makefile
@@ -7,4 +7,4 @@
include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
$(Q)$(kecho) ' Generating $@'
$(Q)mkdir -p $(dir $@)
- $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
+ $(Q)$(AWK) -f $^ > $@
--
2.25.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/4] kbuild: sync filechk rule with Linux 5.7-rc2
2020-04-30 5:13 [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Masahiro Yamada
@ 2020-04-30 5:13 ` Masahiro Yamada
2020-04-30 5:13 ` [PATCH 3/4] kbuild: sync if_changed and friends " Masahiro Yamada
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-04-30 5:13 UTC (permalink / raw)
To: barebox; +Cc: Masahiro Yamada
The 'filechk' in the latest Linux works more simply, reliably.
- Do not show CHK every time
- Delete the *.tmp file when the filechk_$(1) fails
- Do not open the first prerequisite. This is unneeded in most cases.
I deleted pointeless dependency on Makefile.
Also delete the meaningless assignment to 'targets' because filechk
does not generate .cmd file.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Makefile | 10 +++++-----
common/Makefile | 4 +---
scripts/Kbuild.include | 24 +++++++++++-------------
3 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/Makefile b/Makefile
index 967c27909..59e041fed 100644
--- a/Makefile
+++ b/Makefile
@@ -883,16 +883,16 @@ define filechk_utsrelease.h
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi; \
- (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
+ echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"
endef
define filechk_version.h
- (echo \#define LINUX_VERSION_CODE $(shell \
- expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
- echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
+ echo \#define LINUX_VERSION_CODE $(shell \
+ expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
+ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
endef
-include/generated/version.h: $(srctree)/Makefile FORCE
+include/generated/version.h: FORCE
$(call filechk,version.h)
include/generated/utsrelease.h: include/config/kernel.release FORCE
diff --git a/common/Makefile b/common/Makefile
index 84463b4d4..c14af692f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -86,11 +86,9 @@ echo "\";" \
endef
endif
-include/generated/passwd.h: $(srctree)/$(src)/Makefile FORCE
+include/generated/passwd.h: FORCE
$(call filechk,passwd)
-targets += include/generated/passwd.h
-
$(obj)/password.o: include/generated/passwd.h
endif # CONFIG_PASSWORD
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 227a022b4..983329e40 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -37,11 +37,11 @@ kecho := $($(quiet)kecho)
###
# filechk is used to check if the content of a generated file is updated.
# Sample usage:
-# define filechk_sample
-# echo $KERNELRELEASE
-# endef
-# version.h : Makefile
+#
+# filechk_sample = echo $(KERNELRELEASE)
+# version.h: FORCE
# $(call filechk,sample)
+#
# The rule defined shall write to stdout the content of the new file.
# The existing file will be compared with the new one.
# - If no file exist it is created
@@ -50,15 +50,13 @@ kecho := $($(quiet)kecho)
# - stdin is piped in from the first prerequisite ($<) so one has
# to specify a valid file as first prerequisite (often the kbuild file)
define filechk
- $(Q)set -e; \
- $(kecho) ' CHK $@'; \
- mkdir -p $(dir $@); \
- $(filechk_$(1)) < $< > $@.tmp; \
- if [ -r $@ ] && cmp -s $@ $@.tmp; then \
- rm -f $@.tmp; \
- else \
- $(kecho) ' UPD $@'; \
- mv -f $@.tmp $@; \
+ $(Q)set -e; \
+ mkdir -p $(dir $@); \
+ trap "rm -f $(dot-target).tmp" EXIT; \
+ { $(filechk_$(1)); } > $(dot-target).tmp; \
+ if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then \
+ $(kecho) ' UPD $@'; \
+ mv -f $(dot-target).tmp $@; \
fi
endef
--
2.25.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] kbuild: sync if_changed and friends with Linux 5.7-rc2
2020-04-30 5:13 [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Masahiro Yamada
2020-04-30 5:13 ` [PATCH 2/4] kbuild: sync filechk rule with Linux 5.7-rc2 Masahiro Yamada
@ 2020-04-30 5:13 ` Masahiro Yamada
2020-04-30 5:13 ` [PATCH 4/4] kbuild: sync scripts/Kbuild.include " Masahiro Yamada
2020-05-04 7:00 ` [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-04-30 5:13 UTC (permalink / raw)
To: barebox; +Cc: Masahiro Yamada
Resync cmd, if_change, if_changed_dep, and if_changed_rule.
Clean up the users of if_changed_rule.
I deleted the modversions rule. It is dead code because barebox
does not define CONFIG_MODVERSIONS. It does not work without
scripts/genksyms/ anyway.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Makefile | 14 ++-------
scripts/Kbuild.include | 47 +++++++++++++++---------------
scripts/Makefile.build | 66 +++++-------------------------------------
3 files changed, 34 insertions(+), 93 deletions(-)
diff --git a/Makefile b/Makefile
index 59e041fed..9485f5551 100644
--- a/Makefile
+++ b/Makefile
@@ -626,24 +626,18 @@ quiet_cmd_barebox_version = GEN .version
$(MAKE) $(build)=common
# Generate System.map
-quiet_cmd_sysmap = SYSMAP
- cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
+quiet_cmd_sysmap = SYSMAP System.map
+ cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap $@ System.map
# Link of barebox
# If CONFIG_KALLSYMS is set .version is already updated
# Generate System.map and verify that the content is consistent
# Use + in front of the barebox_version rule to silent warning with make -j2
-# First command is ':' to allow us to use + in front of the rule
define rule_barebox__
- :
$(if $(CONFIG_KALLSYMS),,+$(call cmd,barebox_version))
$(call cmd,barebox__)
-
$(Q)echo 'cmd_$@ := $(cmd_barebox__)' > $(@D)/.$(@F).cmd
-
- $(Q)$(if $($(quiet)cmd_sysmap), \
- echo ' $($(quiet)cmd_sysmap) System.map' &&) \
- $(cmd_sysmap) $@ System.map
+ $(call cmd,sysmap)
endef
ifdef CONFIG_KALLSYMS
@@ -684,10 +678,8 @@ endef
# Update barebox version before link
# Use + in front of this rule to silent warning about make -j1
-# First command is ':' to allow us to use + in front of this rule
cmd_ksym_ld = $(cmd_barebox__)
define rule_ksym_ld
- :
+$(call cmd,barebox_version)
$(call cmd,barebox__)
$(Q)echo 'cmd_$@ := $(cmd_barebox__)' > $(@D)/.$(@F).cmd
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 983329e40..074d2db04 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -165,7 +165,7 @@ echo-cmd = $(if $($(quiet)cmd_$(1)),\
echo ' $(call escsq,$($(quiet)cmd_$(1)))$(echo-why)';)
# printing commands
-cmd = @$(echo-cmd) $(cmd_$(1))
+cmd = @set -e; $(echo-cmd) $(cmd_$(1))
# Add $(obj)/ for paths that are not absolute
objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
@@ -176,15 +176,15 @@ objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
# if_changed_dep - as if_changed, but uses fixdep to reveal dependencies
# including used config symbols
# if_changed_rule - as if_changed but execute rule instead
-# See Documentation/kbuild/makefiles.txt for more info
+# See Documentation/kbuild/makefiles.rst for more info
ifneq ($(KBUILD_NOCMDDEP),1)
-# Check if both arguments are the same including their order. Result is empty
+# Check if both commands are the same including their order. Result is empty
# string if equal. User may override this check using make KBUILD_NOCMDDEP=1
-arg-check = $(filter-out $(subst $(space),$(space_escape),$(strip $(cmd_$@))), \
+cmd-check = $(filter-out $(subst $(space),$(space_escape),$(strip $(cmd_$@))), \
$(subst $(space),$(space_escape),$(strip $(cmd_$1))))
else
-arg-check = $(if $(strip $(cmd_$@)),,1)
+cmd-check = $(if $(strip $(cmd_$@)),,1)
endif
# Replace >$< with >$$< to preserve $ when reloading the .cmd file
@@ -195,34 +195,33 @@ endif
# (needed for the shell)
make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1)))))
-# Find any prerequisites that is newer than target or that does not exist.
+# Find any prerequisites that are newer than target or that do not exist.
+# (This is not true for now; $? should contain any non-existent prerequisites,
+# but it does not work as expected when .SECONDARY is present. This seems a bug
+# of GNU Make.)
# PHONY targets skipped in both cases.
-any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
+newer-prereqs = $(filter-out $(PHONY),$?)
# Execute command if command has changed or prerequisite(s) are updated.
-#
-if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
- @set -e; \
- $(echo-cmd) $(cmd_$(1)); \
- printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
+if_changed = $(if $(newer-prereqs)$(cmd-check), \
+ $(cmd); \
+ printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
# Execute the command and also postprocess generated .d dependencies file.
-if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
- @set -e; \
- $(echo-cmd) $(cmd_$(1)); \
- scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
- rm -f $(depfile); \
- mv -f $(dot-target).tmp $(dot-target).cmd)
+if_changed_dep = $(if $(newer-prereqs)$(cmd-check),$(cmd_and_fixdep),@:)
+
+cmd_and_fixdep = \
+ $(cmd); \
+ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).cmd;\
+ rm -f $(depfile)
# Usage: $(call if_changed_rule,foo)
# Will check if $(cmd_foo) or any of the prerequisites changed,
# and if so will execute $(rule_foo).
-if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \
- @set -e; \
- $(rule_$(1)))
+if_changed_rule = $(if $(newer-prereqs)$(cmd-check),$(rule_$(1)),@:)
###
-# why - tell why a a target got build
+# why - tell why a target got built
# enabled by make V=2
# Output (listed in the order they are checked):
# (1) - due to target is PHONY
@@ -244,8 +243,8 @@ ifeq ($(KBUILD_VERBOSE),2)
why = \
$(if $(filter $@, $(PHONY)),- due to target is PHONY, \
$(if $(wildcard $@), \
- $(if $(strip $(any-prereq)),- due to: $(any-prereq), \
- $(if $(arg-check), \
+ $(if $(newer-prereqs),- due to: $(newer-prereqs), \
+ $(if $(cmd-check), \
$(if $(cmd_$@),- due to command line change, \
$(if $(filter $@, $(targets)), \
- due to missing .cmd file, \
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 002afd245..2273d815c 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -88,10 +88,10 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(pbl-target) $(
# Linus' kernel sanity checking tool
ifeq ($(KBUILD_CHECKSRC),1)
quiet_cmd_checksrc = CHECK $<
- cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
+ cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
else ifeq ($(KBUILD_CHECKSRC),2)
quiet_cmd_force_checksrc = CHECK $<
- cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
+ cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
endif
# Compile C sources (.c)
@@ -137,73 +137,23 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
%.i: %.c FORCE
$(call if_changed_dep,cc_i_c)
-quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
-cmd_cc_symtypes_c = \
- $(CPP) -D__GENKSYMS__ $(c_flags) $< \
- | $(GENKSYMS) -T $@ >/dev/null; \
- test -s $@ || rm -f $@
-
-%.symtypes : %.c FORCE
- $(call if_changed_dep,cc_symtypes_c)
-
# C (.c) files
# The C file is compiled and updated dependency information is generated.
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
+ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
quiet_cmd_pbl_cc_o_c = PBLCC $@
-
-ifndef CONFIG_MODVERSIONS
-cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
-cmd_pbl_cc_o_c = $(CC) -D__PBL__ $(c_flags) $(PBL_CPPFLAGS) -c -o $@ $<
-
-else
-# When module versioning is enabled the following steps are executed:
-# o compile a .tmp_<file>.o from <file>.c
-# o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
-# not export symbols, we just rename .tmp_<file>.o to <file>.o and
-# are done.
-# o otherwise, we calculate symbol versions using the good old
-# genksyms on the preprocessed source and postprocess them in a way
-# that they are usable as a linker script
-# o generate <file>.o from .tmp_<file>.o using the linker to
-# replace the unresolved symbols __crc_exported_symbol with
-# the actual value of the checksum generated by genksyms
-
-cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
-cmd_modversions = \
- if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
- $(CPP) -D__GENKSYMS__ $(c_flags) $< \
- | $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
- -T $(@D)/$(@F:.o=.symtypes)) \
- > $(@D)/.tmp_$(@F:.o=.ver); \
- \
- $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
- -T $(@D)/.tmp_$(@F:.o=.ver); \
- rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
- else \
- mv -f $(@D)/.tmp_$(@F) $@; \
- fi;
-endif
+ cmd_pbl_cc_o_c = $(CC) -D__PBL__ $(c_flags) $(PBL_CPPFLAGS) -c -o $@ $<
define rule_cc_o_c
- $(call echo-cmd,checksrc) $(cmd_checksrc) \
- $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
- $(cmd_modversions) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
- $(dot-target).tmp; \
- rm -f $(depfile); \
- mv -f $(dot-target).tmp $(dot-target).cmd
+ $(call cmd,checksrc)
+ $(call cmd_and_fixdep,cc_o_c)
endef
define rule_pbl_cc_o_c
- $(call echo-cmd,checksrc) $(cmd_checksrc) \
- $(call echo-cmd,pbl_cc_o_c) $(cmd_pbl_cc_o_c); \
- $(cmd_modversions) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,pbl_cc_o_c)' > \
- $(dot-target).tmp; \
- rm -f $(depfile); \
- mv -f $(dot-target).tmp $(dot-target).cmd
+ $(call cmd,checksrc)
+ $(call cmd_and_fixdep,pbl_cc_o_c)
endef
# Built-in and composite module parts
--
2.25.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/4] kbuild: sync scripts/Kbuild.include with Linux 5.7-rc2
2020-04-30 5:13 [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Masahiro Yamada
2020-04-30 5:13 ` [PATCH 2/4] kbuild: sync filechk rule with Linux 5.7-rc2 Masahiro Yamada
2020-04-30 5:13 ` [PATCH 3/4] kbuild: sync if_changed and friends " Masahiro Yamada
@ 2020-04-30 5:13 ` Masahiro Yamada
2020-05-04 7:00 ` [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-04-30 5:13 UTC (permalink / raw)
To: barebox; +Cc: Masahiro Yamada
More random cherry-picks for scripts/Kbuild.include
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Kbuild.include | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 074d2db04..838ab11e7 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
####
# kbuild: Generic definitions
@@ -23,10 +24,18 @@ depfile = $(subst $(comma),_,$(dot-target).d)
# filename of target with directory and extension stripped
basetarget = $(basename $(notdir $@))
+###
+# real prerequisites without phony targets
+real-prereqs = $(filter-out $(PHONY), $^)
+
###
# Escape single quote for use in echo statements
escsq = $(subst $(squote),'\$(squote)',$1)
+###
+# Quote a string to pass it to C files. foo => '"foo"'
+stringify = $(squote)$(quote)$1$(quote)$(squote)
+
###
# Easy method for doing a status message
kecho := :
@@ -62,18 +71,19 @@ endef
######
# gcc support functions
-# See documentation in Documentation/kbuild/makefiles.txt
+# See documentation in Documentation/kbuild/makefiles.rst
# cc-cross-prefix
# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
-# Return first prefix where a prefix$(CC) is found in PATH.
-# If no $(CC) found in PATH with listed prefixes return nothing
-cc-cross-prefix = \
- $(word 1, $(foreach c,$(1), \
- $(shell set -e; \
- if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \
- echo $(c); \
- fi)))
+# Return first <prefix> where a <prefix>gcc is found in PATH.
+# If no gcc found in PATH with listed prefixes return nothing
+#
+# Note: '2>/dev/null' is here to force Make to invoke a shell. Otherwise, it
+# would try to directly execute the shell builtin 'command'. This workaround
+# should be kept for a long time since this issue was fixed only after the
+# GNU Make 4.2.1 release.
+cc-cross-prefix = $(firstword $(foreach c, $(1), \
+ $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c))))
# output directory for tests below
TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
@@ -138,18 +148,13 @@ ld-option = $(call try-run,\
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
# Usage:
# $(Q)$(MAKE) $(build)=dir
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+build := -f $(srctree)/scripts/Makefile.build obj
###
-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
-# Usage:
-# $(Q)$(MAKE) $(modbuiltin)=dir
-modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
-
-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=
# Usage:
# $(Q)$(MAKE) $(clean)=dir
-clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
+clean := -f $(srctree)/scripts/Makefile.clean obj
# Prefix -I with $(srctree) if it is not an absolute path.
# skip if -I has no parameter
@@ -167,9 +172,6 @@ echo-cmd = $(if $($(quiet)cmd_$(1)),\
# printing commands
cmd = @set -e; $(echo-cmd) $(cmd_$(1))
-# Add $(obj)/ for paths that are not absolute
-objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
-
###
# if_changed - execute command if any prerequisite is newer than
# target, or command line has changed
--
2.25.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4] kbuild: do not delete $@ explicitly on failure
2020-04-30 5:13 [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Masahiro Yamada
` (2 preceding siblings ...)
2020-04-30 5:13 ` [PATCH 4/4] kbuild: sync scripts/Kbuild.include " Masahiro Yamada
@ 2020-05-04 7:00 ` Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2020-05-04 7:00 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: barebox
On Thu, Apr 30, 2020 at 02:13:54PM +0900, Masahiro Yamada wrote:
> The .DELETE_ON_ERROR special target is specified in scripts/Kbuild.include
>
> You do not need to delete $@ explicitly when the command fails.
> GNU Make automatically does it.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
Applied, thanks
Sascha
>
> Makefile | 6 +-----
> arch/arm/tools/Makefile | 2 +-
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index de9b40ade..967c27909 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -643,11 +643,7 @@ define rule_barebox__
>
> $(Q)$(if $($(quiet)cmd_sysmap), \
> echo ' $($(quiet)cmd_sysmap) System.map' &&) \
> - $(cmd_sysmap) $@ System.map; \
> - if [ $$? -ne 0 ]; then \
> - rm -f $@; \
> - false; \
> - fi;
> + $(cmd_sysmap) $@ System.map
> endef
>
> ifdef CONFIG_KALLSYMS
> diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile
> index 67ae9e701..bff825e58 100644
> --- a/arch/arm/tools/Makefile
> +++ b/arch/arm/tools/Makefile
> @@ -7,4 +7,4 @@
> include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
> $(Q)$(kecho) ' Generating $@'
> $(Q)mkdir -p $(dir $@)
> - $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
> + $(Q)$(AWK) -f $^ > $@
> --
> 2.25.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-04 7:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 5:13 [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Masahiro Yamada
2020-04-30 5:13 ` [PATCH 2/4] kbuild: sync filechk rule with Linux 5.7-rc2 Masahiro Yamada
2020-04-30 5:13 ` [PATCH 3/4] kbuild: sync if_changed and friends " Masahiro Yamada
2020-04-30 5:13 ` [PATCH 4/4] kbuild: sync scripts/Kbuild.include " Masahiro Yamada
2020-05-04 7:00 ` [PATCH 1/4] kbuild: do not delete $@ explicitly on failure Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox