summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-04-13 11:43:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-04-17 09:00:44 +0200
commit33d84d31d6277c87bb4ca1ac1f6d186c2d3e4d27 (patch)
tree07c303d1720643ef5b534f1462c2a3c9692b0735 /scripts
parent48f583b9b34fbddc8798efd508b5113ae8860acc (diff)
downloadbarebox-33d84d31d6277c87bb4ca1ac1f6d186c2d3e4d27.tar.gz
kbuild: drop reliance on echo -e extension for DT fragments
We are using echo -e, so the \n in the string being echo'd are interpreted. As -e is not POSIX and dash doesn't provide it, we use a strange /usr/bin/env echo -e construct hoping that whatever non-builtin echo is first in the search path supports -e. As the new lines are just used to separate CPP directives, we can just pass the directives as $(CPP) flags. This has the same result, but is portable and avoids NixOS complaining when building barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 4deaa5dfa7..51beff56ae 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -371,9 +371,8 @@ $(obj)/%.dtb.z: $(obj)/%.dtb FORCE
dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS))
quiet_cmd_dtc = DTC $@
-# For compatibility between make 4.2 and 4.3
-cmd_dtc = /usr/bin/env echo -e '$(pound)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(2),'$(pound)include "$(f)"\n') | \
- $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
+cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) \
+ -D'$(subst -,_,$(*F))_dts=1' $(foreach f,$< $(2),-include '$(f)') /dev/null ; \
$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
-i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \
-i $(srctree)/dts/src/$(SRCARCH) \