From 368ecfc3a031bd3b03bcaae776d6f276f79af157 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 27 Jul 2015 12:39:41 +0200 Subject: [PATCH] Add transform_data as a variant of data with substitutions. This fixrs name mismatch for grub.chrp with transform_program_name='s,grub,grub2,g' --- gentpl.py | 15 +++++++++++++++ grub-core/Makefile.core.def | 14 +++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/gentpl.py b/gentpl.py index 37b1f45bf..76971d3ce 100644 --- a/gentpl.py +++ b/gentpl.py @@ -834,6 +834,20 @@ def data(defn, platform): var_add("dist_" + installdir(defn) + "_DATA", platform_sources(defn, platform)) gvar_add("dist_noinst_DATA", extra_dist(defn)) +def transform_data(defn, platform): + name = defn['name'] + + var_add(installdir(defn) + "_DATA", name) + + rule(name, "$(top_builddir)/config.status " + platform_sources(defn, platform) + platform_dependencies(defn, platform), """ +(for x in """ + platform_sources(defn, platform) + """; do cat $(srcdir)/"$$x"; done) | $(top_builddir)/config.status --file=$@:- +chmod a+x """ + name + """ +""") + + gvar_add("CLEANFILES", name) + gvar_add("EXTRA_DIST", extra_dist(defn)) + gvar_add("dist_noinst_DATA", platform_sources(defn, platform)) + def script(defn, platform): name = defn['name'] @@ -881,6 +895,7 @@ rules("library", library) rules("program", program) rules("script", script) rules("data", data) +rules("transform_data", transform_data) write_output(section='decl') write_output() diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index a6101dec7..9764cd235 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1,43 +1,43 @@ AutoGen definitions Makefile.tpl; -script = { +transform_data = { installdir = noinst; name = gensyminfo.sh; common = gensyminfo.sh.in; }; -script = { +transform_data = { installdir = noinst; name = genmod.sh; common = genmod.sh.in; }; -script = { +transform_data = { installdir = noinst; name = modinfo.sh; common = modinfo.sh.in; }; -script = { +transform_data = { installdir = platform; name = gmodule.pl; common = gmodule.pl.in; }; -script = { +transform_data = { installdir = platform; name = gdb_grub; common = gdb_grub.in; }; -script = { +transform_data = { installdir = platform; name = grub.chrp; common = boot/powerpc/grub.chrp.in; enable = powerpc_ieee1275; }; -script = { +transform_data = { installdir = platform; name = bootinfo.txt; common = boot/powerpc/bootinfo.txt.in;