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'
This commit is contained in:
Vladimir Serbinenko 2015-07-27 12:39:41 +02:00
parent d5847bf594
commit 368ecfc3a0
2 changed files with 22 additions and 7 deletions

View file

@ -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()

View file

@ -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;