|
@@ -177,13 +177,13 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
|
|
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
|
|
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
|
|
# Usage:
|
|
# Usage:
|
|
# $(Q)$(MAKE) $(build)=dir
|
|
# $(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=
|
|
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
|
|
# Usage:
|
|
# Usage:
|
|
# $(Q)$(MAKE) $(modbuiltin)=dir
|
|
# $(Q)$(MAKE) $(modbuiltin)=dir
|
|
-modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
|
|
|
|
|
|
+modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
|
|
|
|
|
|
# Prefix -I with $(srctree) if it is not an absolute path.
|
|
# Prefix -I with $(srctree) if it is not an absolute path.
|
|
# skip if -I has no parameter
|
|
# skip if -I has no parameter
|
|
@@ -221,11 +221,13 @@ else
|
|
arg-check = $(if $(strip $(cmd_$@)),,1)
|
|
arg-check = $(if $(strip $(cmd_$@)),,1)
|
|
endif
|
|
endif
|
|
|
|
|
|
-# >'< substitution is for echo to work,
|
|
|
|
-# >$< substitution to preserve $ when reloading .cmd file
|
|
|
|
-# note: when using inline perl scripts [perl -e '...$$t=1;...']
|
|
|
|
-# in $(cmd_xxx) double $$ your perl vars
|
|
|
|
-make-cmd = $(subst \\,\\\\,$(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))))
|
|
|
|
|
|
+# Replace >$< with >$$< to preserve $ when reloading the .cmd file
|
|
|
|
+# (needed for make)
|
|
|
|
+# Replace >#< with >\#< to avoid starting a comment in the .cmd file
|
|
|
|
+# (needed for make)
|
|
|
|
+# Replace >'< with >'\''< to be able to enclose the whole string in '...'
|
|
|
|
+# (needed for the shell)
|
|
|
|
+make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1)))))
|
|
|
|
|
|
# Find any prerequisites that is newer than target or that does not exist.
|
|
# Find any prerequisites that is newer than target or that does not exist.
|
|
# PHONY targets skipped in both cases.
|
|
# PHONY targets skipped in both cases.
|
|
@@ -236,7 +238,7 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
|
|
if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
|
|
if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
|
|
@set -e; \
|
|
@set -e; \
|
|
$(echo-cmd) $(cmd_$(1)); \
|
|
$(echo-cmd) $(cmd_$(1)); \
|
|
- echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
|
|
|
|
|
|
+ printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
|
|
|
|
|
|
# Execute the command and also postprocess generated .d dependencies file.
|
|
# Execute the command and also postprocess generated .d dependencies file.
|
|
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
|
|
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
|