sed: Replace hack'ish command line with script file
Add `common/delete_dyncpu.sed` that replaces the ugly attempt to
do it inline.
Change-Id: Ief65038ae5e798d18403565d8a7ede3ecb918bb6
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/55464
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/Makefile.inc b/common/Makefile.inc
index 2d18703..ed5f504 100644
--- a/common/Makefile.inc
+++ b/common/Makefile.inc
@@ -107,11 +107,10 @@
sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
-e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
-e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
- -e":s$$(printf '\n ')/,$$/{N;s/,\n.*Dyn_CPU\(_Var\)\?[^,)]*//;ts$$(printf '\n ')P;D;}" \
- -e'/Dyn_CPU\(_Var\)\?/d' \
-e's/<\(gen\|$(_GEN_TLA_SUBSTITUTIONS)\(...\)\?\)bool>/constant Boolean/' \
-e's/<\($(_GEN_TLA_SUBSTITUTIONS)\(...\)\?\)var>/constant/' \
-e's/<cpunull>/ is null/' \
+ -f $(dir $<)/delete_dyncpu.sed \
$< >$@
endif
gfxinit-gen-y += $(hw-gfx-gma-config-ads)
diff --git a/common/delete_dyncpu.sed b/common/delete_dyncpu.sed
new file mode 100644
index 0000000..92da9d9
--- /dev/null
+++ b/common/delete_dyncpu.sed
@@ -0,0 +1,11 @@
+# delete `Dyn_CPU` lines along with a preceding comma in the previous line:
+:s
+/,$/{
+ N
+ s/,\n.*Dyn_CPU[^,)]*//
+ ts
+ P
+ D
+}
+# delete all other lines about `Dyn_CPU`:
+/Dyn_CPU/d