*_sources now collect all values of all its groups

This commit is contained in:
BVK Chaitanya 2010-08-21 14:27:31 +05:30
parent bdf0d62321
commit 8427685faa
4 changed files with 606 additions and 616 deletions

View file

@ -5,100 +5,99 @@ library = {
cflags = '$(CFLAGS_GCRY)'; cflags = '$(CFLAGS_GCRY)';
cppflags = '$(CPPFLAGS_GCRY)'; cppflags = '$(CPPFLAGS_GCRY)';
nodist = grub_script.tab.c; common_nodist = grub_script.tab.c;
nodist = grub_script.yy.c; common_nodist = grub_script.yy.c;
nodist = libgrub_a_init.c; common_nodist = libgrub_a_init.c;
common_nodist = grub_script.yy.h;
common_nodist = grub_script.tab.h;
source = grub-core/gnulib/error.c; common = grub-core/gnulib/error.c;
source = grub-core/gnulib/fnmatch.c; common = grub-core/gnulib/fnmatch.c;
source = grub-core/gnulib/getdelim.c; common = grub-core/gnulib/getdelim.c;
source = grub-core/gnulib/getline.c; common = grub-core/gnulib/getline.c;
source = grub-core/gnulib/getopt1.c; common = grub-core/gnulib/getopt1.c;
source = grub-core/gnulib/getopt.c; common = grub-core/gnulib/getopt.c;
source = grub-core/gnulib/progname.c; common = grub-core/gnulib/progname.c;
source = util/misc.c; common = util/misc.c;
source = grub-core/kern/misc.c; common = grub-core/kern/misc.c;
source = grub-core/kern/emu/mm.c; common = grub-core/kern/emu/mm.c;
source = grub-core/kern/emu/misc.c; common = grub-core/kern/emu/misc.c;
source = grub-core/kern/emu/hostfs.c; common = grub-core/kern/emu/hostfs.c;
source = grub-core/kern/emu/getroot.c; common = grub-core/kern/emu/getroot.c;
source = grub-core/kern/emu/hostdisk.c; common = grub-core/kern/emu/hostdisk.c;
source = grub-core/commands/blocklist.c; common = grub-core/commands/blocklist.c;
source = grub-core/commands/extcmd.c; common = grub-core/commands/extcmd.c;
source = grub-core/commands/ls.c; common = grub-core/commands/ls.c;
source = grub-core/disk/dmraid_nvidia.c; common = grub-core/disk/dmraid_nvidia.c;
source = grub-core/disk/host.c; common = grub-core/disk/host.c;
source = grub-core/disk/loopback.c; common = grub-core/disk/loopback.c;
source = grub-core/disk/lvm.c; common = grub-core/disk/lvm.c;
source = grub-core/disk/mdraid_linux.c; common = grub-core/disk/mdraid_linux.c;
source = grub-core/disk/raid5_recover.c; common = grub-core/disk/raid5_recover.c;
source = grub-core/disk/raid6_recover.c; common = grub-core/disk/raid6_recover.c;
source = grub-core/disk/raid.c; common = grub-core/disk/raid.c;
source = grub-core/fs/affs.c; common = grub-core/fs/affs.c;
source = grub-core/fs/afs_be.c; common = grub-core/fs/afs_be.c;
source = grub-core/fs/afs.c; common = grub-core/fs/afs.c;
source = grub-core/fs/befs_be.c; common = grub-core/fs/befs_be.c;
source = grub-core/fs/befs.c; common = grub-core/fs/befs.c;
source = grub-core/fs/cpio.c; common = grub-core/fs/cpio.c;
source = grub-core/fs/ext2.c; common = grub-core/fs/ext2.c;
source = grub-core/fs/fat.c; common = grub-core/fs/fat.c;
source = grub-core/fs/fshelp.c; common = grub-core/fs/fshelp.c;
source = grub-core/fs/hfs.c; common = grub-core/fs/hfs.c;
source = grub-core/fs/hfsplus.c; common = grub-core/fs/hfsplus.c;
source = grub-core/fs/iso9660.c; common = grub-core/fs/iso9660.c;
source = grub-core/fs/jfs.c; common = grub-core/fs/jfs.c;
source = grub-core/fs/minix.c; common = grub-core/fs/minix.c;
source = grub-core/fs/nilfs2.c; common = grub-core/fs/nilfs2.c;
source = grub-core/fs/ntfs.c; common = grub-core/fs/ntfs.c;
source = grub-core/fs/ntfscomp.c; common = grub-core/fs/ntfscomp.c;
source = grub-core/fs/reiserfs.c; common = grub-core/fs/reiserfs.c;
source = grub-core/fs/sfs.c; common = grub-core/fs/sfs.c;
source = grub-core/fs/tar.c; common = grub-core/fs/tar.c;
source = grub-core/fs/udf.c; common = grub-core/fs/udf.c;
source = grub-core/fs/ufs2.c; common = grub-core/fs/ufs2.c;
source = grub-core/fs/ufs.c; common = grub-core/fs/ufs.c;
source = grub-core/fs/xfs.c; common = grub-core/fs/xfs.c;
source = grub-core/kern/command.c; common = grub-core/kern/command.c;
source = grub-core/kern/device.c; common = grub-core/kern/device.c;
source = grub-core/kern/disk.c; common = grub-core/kern/disk.c;
source = grub-core/kern/env.c; common = grub-core/kern/env.c;
source = grub-core/kern/err.c; common = grub-core/kern/err.c;
source = grub-core/kern/file.c; common = grub-core/kern/file.c;
source = grub-core/kern/fs.c; common = grub-core/kern/fs.c;
source = grub-core/kern/list.c; common = grub-core/kern/list.c;
source = grub-core/kern/partition.c; common = grub-core/kern/partition.c;
source = grub-core/lib/arg.c; common = grub-core/lib/arg.c;
source = grub-core/lib/crc.c; common = grub-core/lib/crc.c;
source = grub-core/lib/crypto.c; common = grub-core/lib/crypto.c;
source = grub-core/lib/envblk.c; common = grub-core/lib/envblk.c;
source = grub-core/lib/hexdump.c; common = grub-core/lib/hexdump.c;
source = grub-core/lib/libgcrypt-grub/cipher/sha512.c; common = grub-core/lib/libgcrypt-grub/cipher/sha512.c;
source = grub-core/lib/LzFind.c; common = grub-core/lib/LzFind.c;
source = grub-core/lib/LzmaEnc.c; common = grub-core/lib/LzmaEnc.c;
source = grub-core/lib/pbkdf2.c; common = grub-core/lib/pbkdf2.c;
source = grub-core/normal/datetime.c; common = grub-core/normal/datetime.c;
source = grub-core/normal/misc.c; common = grub-core/normal/misc.c;
source = grub-core/partmap/acorn.c; common = grub-core/partmap/acorn.c;
source = grub-core/partmap/amiga.c; common = grub-core/partmap/amiga.c;
source = grub-core/partmap/apple.c; common = grub-core/partmap/apple.c;
source = grub-core/partmap/gpt.c; common = grub-core/partmap/gpt.c;
source = grub-core/partmap/msdos.c; common = grub-core/partmap/msdos.c;
source = grub-core/partmap/sun.c; common = grub-core/partmap/sun.c;
source = grub-core/script/function.c; common = grub-core/script/function.c;
source = grub-core/script/lexer.c; common = grub-core/script/lexer.c;
source = grub-core/script/main.c; common = grub-core/script/main.c;
source = grub-core/script/script.c; common = grub-core/script/script.c;
source = grub-core/script/argv.c; common = grub-core/script/argv.c;
nodist = grub_script.yy.h;
nodist = grub_script.tab.h;
}; };
program = { program = {
name = grub-bin2h; name = grub-bin2h;
source = util/bin2h.c; common = util/bin2h.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
mansection = 1; mansection = 1;
@ -108,8 +107,8 @@ program = {
name = grub-mkimage; name = grub-mkimage;
mansection = 1; mansection = 1;
source = util/grub-mkimage.c; common = util/grub-mkimage.c;
source = util/resolve.c; common = util/resolve.c;
extra_dist = util/grub-mkimagexx.c; extra_dist = util/grub-mkimagexx.c;
ldadd = libgrub.a; ldadd = libgrub.a;
@ -121,7 +120,7 @@ program = {
name = grub-mkrelpath; name = grub-mkrelpath;
mansection = 1; mansection = 1;
source = util/grub-mkrelpath.c; common = util/grub-mkrelpath.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
@ -131,7 +130,7 @@ program = {
name = grub-script-check; name = grub-script-check;
mansection = 1; mansection = 1;
source = util/grub-script-check.c; common = util/grub-script-check.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
@ -141,7 +140,7 @@ program = {
name = grub-editenv; name = grub-editenv;
mansection = 1; mansection = 1;
source = util/grub-editenv.c; common = util/grub-editenv.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
@ -151,7 +150,7 @@ program = {
name = grub-mkpasswd-pbkdf2; name = grub-mkpasswd-pbkdf2;
mansection = 1; mansection = 1;
source = util/grub-mkpasswd-pbkdf2.c; common = util/grub-mkpasswd-pbkdf2.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
@ -162,14 +161,14 @@ program = {
program = { program = {
name = grub-macho2img; name = grub-macho2img;
mansection = 1; mansection = 1;
source = util/grub-macho2img.c; common = util/grub-macho2img.c;
condition = COND_APPLE_CC; condition = COND_APPLE_CC;
}; };
program = { program = {
name = grub-pe2elf; name = grub-pe2elf;
mansection = 1; mansection = 1;
source = util/grub-pe2elf.c; common = util/grub-pe2elf.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL)'; ldflags = '$(LIBINTL)';
@ -179,7 +178,7 @@ program = {
program = { program = {
name = grub-fstest; name = grub-fstest;
mansection = 1; mansection = 1;
source = util/grub-fstest.c; common = util/grub-fstest.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
@ -189,8 +188,8 @@ program = {
program = { program = {
name = grub-mkfont; name = grub-mkfont;
mansection = 1; mansection = 1;
source = util/grub-mkfont.c; common = util/grub-mkfont.c;
source = grub-core/unidata.c; common = grub-core/unidata.c;
cflags = '$(freetype_cflags)'; cflags = '$(freetype_cflags)';
@ -204,9 +203,9 @@ program = {
name = grub-mkdevicemap; name = grub-mkdevicemap;
installdir = sbin; installdir = sbin;
mansection = 8; mansection = 8;
source = util/grub-mkdevicemap.c; nosparc64 = util/grub-mkdevicemap.c;
source = util/deviceiter.c; nosparc64 = util/deviceiter.c;
source = util/devicemap.c; nosparc64 = util/devicemap.c;
sparc64_ieee1275 = util/grub-mkdevicemap.c; sparc64_ieee1275 = util/grub-mkdevicemap.c;
sparc64_ieee1275 = util/deviceiter.c; sparc64_ieee1275 = util/deviceiter.c;
@ -221,7 +220,7 @@ program = {
name = grub-probe; name = grub-probe;
installdir = sbin; installdir = sbin;
mansection = 8; mansection = 8;
source = util/grub-probe.c; common = util/grub-probe.c;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)'; ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
@ -250,66 +249,66 @@ program = {
program = { program = {
name = grub-ofpathname; name = grub-ofpathname;
installdir = sbin; installdir = sbin;
source = util/ieee1275/grub-ofpathname.c; ieee1275 = util/ieee1275/grub-ofpathname.c;
source = util/ieee1275/ofpath.c; ieee1275 = util/ieee1275/ofpath.c;
ldadd = libgrub.a; ldadd = libgrub.a;
enable = sparc64_ieee1275; enable = sparc64_ieee1275;
}; };
data = { data = {
source = util/grub.d/README; common = util/grub.d/README;
installdir = grubconf; installdir = grubconf;
}; };
script = { script = {
name = '00_header'; name = '00_header';
source = util/grub.d/00_header.in; common = util/grub.d/00_header.in;
installdir = grubconf; installdir = grubconf;
}; };
/* /*
script = { script = {
name = '10_windows'; name = '10_windows';
source = util/grub.d/10_windows.in; common = util/grub.d/10_windows.in;
installdir = grubconf; installdir = grubconf;
}; };
script = { script = {
name = '10_hurd'; name = '10_hurd';
source = util/grub.d/10_hurd.in; common = util/grub.d/10_hurd.in;
installdir = grubconf; installdir = grubconf;
}; };
*/ */
script = { script = {
name = '10_linux'; name = '10_linux';
source = util/grub.d/10_linux.in; common = util/grub.d/10_linux.in;
installdir = grubconf; installdir = grubconf;
}; };
script = { script = {
name = '30_os-prober'; name = '30_os-prober';
source = util/grub.d/30_os-prober.in; common = util/grub.d/30_os-prober.in;
installdir = grubconf; installdir = grubconf;
}; };
script = { script = {
name = '40_custom'; name = '40_custom';
source = util/grub.d/40_custom.in; common = util/grub.d/40_custom.in;
installdir = grubconf; installdir = grubconf;
}; };
script = { script = {
name = '41_custom'; name = '41_custom';
source = util/grub.d/41_custom.in; common = util/grub.d/41_custom.in;
installdir = grubconf; installdir = grubconf;
}; };
script = { script = {
mansection = 1; mansection = 1;
name = grub-mkrescue; name = grub-mkrescue;
source = util/grub-mkrescue.in; i386_pc_qemu_coreboot = util/grub-mkrescue.in;
powerpc_ieee1275 = util/powerpc/ieee1275/grub-mkrescue.in; powerpc_ieee1275 = util/powerpc/ieee1275/grub-mkrescue.in;
enable = i386_pc; enable = i386_pc;
enable = i386_qemu; enable = i386_qemu;
@ -321,7 +320,10 @@ script = {
mansection = 8; mansection = 8;
installdir = sbin; installdir = sbin;
name = grub-install; name = grub-install;
source = util/grub-install.in;
mips = util/grub-install.in;
i386_noefi_noieee1275 = util/grub-install.in;
x86_efi = util/i386/efi/grub-install.in; x86_efi = util/i386/efi/grub-install.in;
i386_ieee1275 = util/ieee1275/grub-install.in; i386_ieee1275 = util/ieee1275/grub-install.in;
powerpc_ieee1275 = util/ieee1275/grub-install.in; powerpc_ieee1275 = util/ieee1275/grub-install.in;
@ -333,151 +335,151 @@ script = {
script = { script = {
name = grub-mkconfig; name = grub-mkconfig;
source = util/grub-mkconfig.in; common = util/grub-mkconfig.in;
mansection = 8; mansection = 8;
installdir = sbin; installdir = sbin;
}; };
script = { script = {
name = grub-set-default; name = grub-set-default;
source = util/grub-set-default.in; common = util/grub-set-default.in;
mansection = 8; mansection = 8;
installdir = sbin; installdir = sbin;
}; };
script = { script = {
name = grub-reboot; name = grub-reboot;
source = util/grub-reboot.in; common = util/grub-reboot.in;
mansection = 8; mansection = 8;
installdir = sbin; installdir = sbin;
}; };
script = { script = {
name = grub-mkconfig_lib; name = grub-mkconfig_lib;
source = util/grub-mkconfig_lib.in; common = util/grub-mkconfig_lib.in;
installdir = pkglib; installdir = pkglib;
}; };
script = { script = {
name = update-grub_lib; name = update-grub_lib;
source = util/update-grub_lib.in; common = util/update-grub_lib.in;
installdir = pkglib; installdir = pkglib;
}; };
script = { script = {
name = grub-shell; name = grub-shell;
source = tests/util/grub-shell.in; common = tests/util/grub-shell.in;
}; };
script = { script = {
name = grub-shell-tester; name = grub-shell-tester;
source = tests/util/grub-shell-tester.in; common = tests/util/grub-shell-tester.in;
}; };
script = { script = {
testcase; testcase;
name = example_scripted_test; name = example_scripted_test;
source = tests/example_scripted_test.in; common = tests/example_scripted_test.in;
}; };
script = { script = {
testcase; testcase;
name = example_grub_script_test; name = example_grub_script_test;
source = tests/example_grub_script_test.in; common = tests/example_grub_script_test.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_echo1; name = grub_script_echo1;
source = tests/grub_script_echo1.in; common = tests/grub_script_echo1.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_echo_keywords; name = grub_script_echo_keywords;
source = tests/grub_script_echo_keywords.in; common = tests/grub_script_echo_keywords.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_vars1; name = grub_script_vars1;
source = tests/grub_script_vars1.in; common = tests/grub_script_vars1.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_for1; name = grub_script_for1;
source = tests/grub_script_for1.in; common = tests/grub_script_for1.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_while1; name = grub_script_while1;
source = tests/grub_script_while1.in; common = tests/grub_script_while1.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_if; name = grub_script_if;
source = tests/grub_script_if.in; common = tests/grub_script_if.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_blanklines; name = grub_script_blanklines;
source = tests/grub_script_blanklines.in; common = tests/grub_script_blanklines.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_final_semicolon; name = grub_script_final_semicolon;
source = tests/grub_script_final_semicolon.in; common = tests/grub_script_final_semicolon.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_dollar; name = grub_script_dollar;
source = tests/grub_script_dollar.in; common = tests/grub_script_dollar.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_comments; name = grub_script_comments;
source = tests/grub_script_comments.in; common = tests/grub_script_comments.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_functions; name = grub_script_functions;
source = tests/grub_script_functions.in; common = tests/grub_script_functions.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_break; name = grub_script_break;
source = tests/grub_script_break.in; common = tests/grub_script_break.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_continue; name = grub_script_continue;
source = tests/grub_script_continue.in; common = tests/grub_script_continue.in;
}; };
script = { script = {
testcase; testcase;
name = grub_script_shift; name = grub_script_shift;
source = tests/grub_script_shift.in; common = tests/grub_script_shift.in;
}; };
program = { program = {
testcase; testcase;
name = example_unit_test; name = example_unit_test;
source = tests/example_unit_test.c; common = tests/example_unit_test.c;
source = tests/lib/unit_test.c; common = tests/lib/unit_test.c;
source = grub-core/kern/list.c; common = grub-core/kern/list.c;
source = grub-core/kern/misc.c; common = grub-core/kern/misc.c;
source = grub-core/tests/lib/test.c; common = grub-core/tests/lib/test.c;
cflags = -Wno-format; cflags = -Wno-format;
ldadd = libgrub.a; ldadd = libgrub.a;
ldflags = '$(LIBDEVMAPPER)'; ldflags = '$(LIBDEVMAPPER)';

183
gentpl.py
View file

@ -12,15 +12,42 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
GROUPS = {} GROUPS = {}
GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ] GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ]
GROUPS["x86_64"] = [ "x86_64_efi" ] GROUPS["x86_64"] = [ "x86_64_efi" ]
GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
GROUPS["x86_efi"] = [ "i386_efi", "x86_64_efi" ]
GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc")
GROUPS["x86_noefi"] = GROUPS["x86"][:]; GROUPS["x86_noefi"].remove("i386_efi"); GROUPS["x86_noefi"].remove("x86_64_efi")
GROUPS["i386_noefi"] = GROUPS["i386"][:]; GROUPS["i386_noefi"].remove("i386_efi")
GROUPS["x86_noieee1275"] = GROUPS["x86"][:]; GROUPS["x86_noieee1275"].remove("i386_ieee1275")
GROUPS["i386_noieee1275"] = GROUPS["i386"][:]; GROUPS["i386_noieee1275"].remove("i386_ieee1275")
GROUPS["i386_noefi_noieee1275"] = GROUPS["i386_noefi"][:]; GROUPS["i386_noefi_noieee1275"].remove("i386_ieee1275")
GROUPS["i386_pc_qemu_coreboot"] = ["i386_pc", "i386_qemu", "i386_coreboot"]
GROUPS["i386_coreboot_multiboot"] = ["i386_coreboot", "i386_multiboot"]
GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", "i386_qemu"]
GROUPS["i386_pc_coreboot_multiboot_qemu"] = ["i386_pc", "i386_coreboot", "i386_multiboot", "i386_qemu"]
GROUPS["mips"] = [ "mips_yeeloong" ] GROUPS["mips"] = [ "mips_yeeloong" ]
GROUPS["sparc64"] = [ "sparc64_ieee1275" ] GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
GROUPS["powerpc"] = [ "powerpc_ieee1275" ] GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
GROUPS["x86_efi"] = [ "i386_efi", "x86_64_efi" ] GROUPS["nosparc64"] = GRUB_PLATFORMS[:]; GROUPS["nosparc64"].remove("sparc64_ieee1275")
GROUPS["x86_noefi_mips"] = GROUPS["x86_noefi"] + GROUPS["mips"]
GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ] GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ]
GROUPS["noieee1275"] = GRUB_PLATFORMS[:]
for i in GROUPS["ieee1275"]: GROUPS["noieee1275"].remove(i)
GROUPS["pci"] = GROUPS["x86"] + GROUPS["mips"] GROUPS["pci"] = GROUPS["x86"] + GROUPS["mips"]
GROUPS["nonemu"] = GRUB_PLATFORMS[:]
GROUPS["nonemu"].remove("emu") GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
GROUPS["noemu_noieee1275"] = GRUB_PLATFORMS[:]
for i in ["emu"] + GROUPS["ieee1275"]: GROUPS["noemu_noieee1275"].remove(i)
GROUPS["common"] = GRUB_PLATFORMS[:]
# #
# Create platform => groups reverse map, where groups covering that # Create platform => groups reverse map, where groups covering that
@ -111,7 +138,19 @@ def if_platform_tagged(platform, tag, snippet_if, snippet_else=None):
return r return r
# #
# Template for handling platform specific values, for example: # Template for tagged values
#
# module = {
# extra_dist = ...
# extra_dist = ...
# ...
# };
#
def foreach_value(tag, closure):
return "[+ FOR " + tag + " +]" + closure("[+ ." + tag + " +]") + "[+ ENDFOR +]"
#
# Template for handling best matched values for a platform, for example:
# #
# module = { # module = {
# cflags = '-Wall'; # cflags = '-Wall';
@ -119,7 +158,7 @@ def if_platform_tagged(platform, tag, snippet_if, snippet_else=None):
# ... # ...
# } # }
# #
def foreach_platform_value(platform, tag, suffix, closure): def foreach_platform_specific_value(platform, suffix, nonetag, closure):
r = "" r = ""
for group in RMAP[platform]: for group in RMAP[platform]:
gtag = group + suffix gtag = group + suffix
@ -130,10 +169,46 @@ def foreach_platform_value(platform, tag, suffix, closure):
r += "[+ ELIF " + gtag + " +]" r += "[+ ELIF " + gtag + " +]"
r += "[+ FOR " + gtag + " +]" + closure("[+ ." + gtag + " +]") + "[+ ENDFOR +]" r += "[+ FOR " + gtag + " +]" + closure("[+ ." + gtag + " +]") + "[+ ENDFOR +]"
r += "[+ ELSE +][+ FOR " + tag + " +]" + closure("[+ ." + tag + " +]") + "[+ ENDFOR +][+ ENDIF +]" r += "[+ ELSE +][+ FOR " + nonetag + " +]" + closure("[+ ." + nonetag + " +]") + "[+ ENDFOR +][+ ENDIF +]"
return r return r
def each_platform(closure): #
# Template for handling values from sum of all groups for a platform,
# for example:
#
# module = {
# common = kern/misc.c;
# emu = kern/emu/misc.c;
# ...
# }
#
def foreach_platform_value (platform, suffix, closure):
r = ""
for group in RMAP[platform]:
gtag = group + suffix
r += "[+ IF " + gtag + " +]"
r += "[+ FOR " + gtag + " +]" + closure("[+ ." + gtag + " +]") + "[+ ENDFOR +]"
r += "[+ ENDIF +]"
return r
#
# Template for gaurding with platform specific "enable" keys, for example:
#
# module = {
# name = pci;
# noemu = bus/pci.c;
# emu = bus/emu/pci.c;
# emu = commands/lspci.c;
#
# enable = emu;
# enable = i386_pc;
# enable = x86_efi;
# enable = i386_ieee1275;
# enable = i386_coreboot;
# };
#
def foreach_enabled_platform(closure):
r = "[+ IF - enable undefined +]" r = "[+ IF - enable undefined +]"
for platform in GRUB_PLATFORMS: for platform in GRUB_PLATFORMS:
r += "\nif COND_" + platform + "\n" + closure(platform) + "endif\n" r += "\nif COND_" + platform + "\n" + closure(platform) + "endif\n"
@ -144,30 +219,49 @@ def each_platform(closure):
r += "[+ ENDIF +]" r += "[+ ENDIF +]"
return r return r
#
# Template for gaurding with platform specific automake conditionals,
# for example:
#
# module = {
# name = usb;
# common = bus/usb/usb.c;
# noemu = bus/usb/usbtrans.c;
# noemu = bus/usb/usbhub.c;
# enable = emu;
# enable = i386;
# enable = mips_yeeloong;
# emu_condition = COND_GRUB_EMU_USB;
# };
#
def under_platform_specific_conditionals(platform, snippet): def under_platform_specific_conditionals(platform, snippet):
r = foreach_platform_value(platform, "condition", "_condition", lambda cond: "if " + cond + "\n") r = foreach_platform_specific_value(platform, "_condition", "condition", lambda cond: "if " + cond + "\n")
r += snippet r += snippet
r += foreach_platform_value(platform, "condition", "_condition", lambda cond: "endif " + cond + "\n") r += foreach_platform_specific_value(platform, "_condition", "condition", lambda cond: "endif " + cond + "\n")
return r return r
def platform_specific_values(platform, tag, suffix): def platform_specific_values(platform, suffix, nonetag):
return foreach_platform_value(platform, tag, suffix, lambda value: value + " ") return foreach_platform_specific_value(platform, suffix, nonetag,
lambda value: value + " ")
def shared_sources(): return "[+ FOR shared +][+ .shared +] [+ ENDFOR +]" def platform_values(platform, suffix):
def shared_nodist_sources(): return "[+ FOR nodist_shared +] [+ .nodist_shared +][+ ENDFOR +]" return foreach_platform_value(platform, suffix, lambda value: value + " ")
def platform_sources(p): return platform_specific_values(p, "source", "") def extra_dist():
def platform_nodist_sources(p): return platform_specific_values(p, "nodist", "_nodist") return foreach_value("extra_dist", lambda value: value + " ")
def platform_extra_dist(p): return platform_specific_values(p, "extra_dist", "_extra_dist")
def platform_dependencies(p): return platform_specific_values(p, "dependencies", "_dependencies")
def platform_ldadd(p): return platform_specific_values(p, "ldadd", "_ldadd") def platform_sources(p): return platform_values(p, "")
def platform_cflags(p): return platform_specific_values(p, "cflags", "_cflags") def platform_nodist_sources(p): return platform_values(p, "_nodist")
def platform_ldflags(p): return platform_specific_values(p, "ldflags", "_ldflags") def platform_dependencies(p): return platform_values(p, "dependencies", "_dependencies")
def platform_cppflags(p): return platform_specific_values(p, "cppflags", "_cppflags")
def platform_ccasflags(p): return platform_specific_values(p, "ccasflags", "_ccasflags") def platform_startup(p): return platform_specific_values(p, "_startup", "startup")
def platform_stripflags(p): return platform_specific_values(p, "stripflags", "_stripflags") def platform_ldadd(p): return platform_specific_values(p, "_ldadd", "ldadd")
def platform_objcopyflags(p): return platform_specific_values(p, "objcopyflags", "_objcopyflags") def platform_cflags(p): return platform_specific_values(p, "_cflags", "cflags")
def platform_ldflags(p): return platform_specific_values(p, "_ldflags", "ldflags")
def platform_cppflags(p): return platform_specific_values(p, "_cppflags", "cppflags")
def platform_ccasflags(p): return platform_specific_values(p, "_ccasflags", "ccasflags")
def platform_stripflags(p): return platform_specific_values(p, "_stripflags", "stripflags")
def platform_objcopyflags(p): return platform_specific_values(p, "_objcopyflags", "objcopyflags")
def module(platform): def module(platform):
r = set_canonical_name_suffix(".module") r = set_canonical_name_suffix(".module")
@ -176,9 +270,7 @@ def module(platform):
r += gvar_add("MODULE_FILES", "[+ name +].module$(EXEEXT)") r += gvar_add("MODULE_FILES", "[+ name +].module$(EXEEXT)")
r += var_set(cname() + "_SOURCES", platform_sources(platform) + " ## platform sources") r += var_set(cname() + "_SOURCES", platform_sources(platform) + " ## platform sources")
r += var_add(cname() + "_SOURCES", shared_sources() + " ## shared sources")
r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + " ## platform nodist sources") r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + " ## platform nodist sources")
r += var_add("nodist_" + cname() + "_SOURCES", shared_nodist_sources() + " ## shared nodist sources")
r += var_set(cname() + "_LDADD", platform_ldadd(platform)) r += var_set(cname() + "_LDADD", platform_ldadd(platform))
r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_MODULE) " + platform_cflags(platform)) r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_MODULE) " + platform_cflags(platform))
r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_MODULE) " + platform_ldflags(platform)) r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_MODULE) " + platform_ldflags(platform))
@ -186,7 +278,7 @@ def module(platform):
r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_MODULE) " + platform_ccasflags(platform)) r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_MODULE) " + platform_ccasflags(platform))
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform)) # r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
r += gvar_add("EXTRA_DIST", platform_extra_dist(platform)) r += gvar_add("EXTRA_DIST", extra_dist())
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
@ -265,10 +357,9 @@ terminal-[+ name +].lst: [+ name +].pp $(srcdir)/genterminallist.sh
def kernel(platform): def kernel(platform):
r = set_canonical_name_suffix(".exec") r = set_canonical_name_suffix(".exec")
r += gvar_add("noinst_PROGRAMS", "[+ name +].exec") r += gvar_add("noinst_PROGRAMS", "[+ name +].exec")
r += var_set(cname() + "_SOURCES", platform_sources(platform)) r += var_set(cname() + "_SOURCES", platform_startup(platform))
r += var_add(cname() + "_SOURCES", shared_sources()) r += var_add(cname() + "_SOURCES", platform_sources(platform))
r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + " ## platform nodist sources") r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + " ## platform nodist sources")
r += var_add("nodist_" + cname() + "_SOURCES", shared_nodist_sources() + " ## shared nodist sources")
r += var_set(cname() + "_LDADD", platform_ldadd(platform)) r += var_set(cname() + "_LDADD", platform_ldadd(platform))
r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_KERNEL) " + platform_cflags(platform)) r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_KERNEL) " + platform_cflags(platform))
r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_KERNEL) " + platform_ldflags(platform)) r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_KERNEL) " + platform_ldflags(platform))
@ -277,7 +368,7 @@ def kernel(platform):
r += var_set(cname() + "_STRIPFLAGS", "$(AM_STRIPFLAGS) $(STRIPFLAGS_KERNEL) " + platform_stripflags(platform)) r += var_set(cname() + "_STRIPFLAGS", "$(AM_STRIPFLAGS) $(STRIPFLAGS_KERNEL) " + platform_stripflags(platform))
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform)) # r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
r += gvar_add("EXTRA_DIST", platform_extra_dist(platform)) r += gvar_add("EXTRA_DIST", extra_dist())
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
@ -292,9 +383,7 @@ def image(platform):
r = set_canonical_name_suffix(".image") r = set_canonical_name_suffix(".image")
r += gvar_add("noinst_PROGRAMS", "[+ name +].image") r += gvar_add("noinst_PROGRAMS", "[+ name +].image")
r += var_set(cname() + "_SOURCES", platform_sources(platform)) r += var_set(cname() + "_SOURCES", platform_sources(platform))
r += var_add(cname() + "_SOURCES", shared_sources())
r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + "## platform nodist sources") r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + "## platform nodist sources")
r += var_add("nodist_" + cname() + "_SOURCES", shared_nodist_sources() + "## shared nodist sources")
r += var_set(cname() + "_LDADD", platform_ldadd(platform)) r += var_set(cname() + "_LDADD", platform_ldadd(platform))
r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_IMAGE) " + platform_cflags(platform)) r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_IMAGE) " + platform_cflags(platform))
r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_IMAGE) " + platform_ldflags(platform)) r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_IMAGE) " + platform_ldflags(platform))
@ -303,7 +392,7 @@ def image(platform):
r += var_set(cname() + "_OBJCOPYFLAGS", "$(OBJCOPYFLAGS_IMAGE) " + platform_objcopyflags(platform)) r += var_set(cname() + "_OBJCOPYFLAGS", "$(OBJCOPYFLAGS_IMAGE) " + platform_objcopyflags(platform))
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform)) # r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
r += gvar_add("EXTRA_DIST", platform_extra_dist(platform)) r += gvar_add("EXTRA_DIST", extra_dist())
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
@ -322,15 +411,13 @@ def library(platform):
r = set_canonical_name_suffix("") r = set_canonical_name_suffix("")
r += gvar_add("noinst_LIBRARIES", "[+ name +]") r += gvar_add("noinst_LIBRARIES", "[+ name +]")
r += var_set(cname() + "_SOURCES", platform_sources(platform)) r += var_set(cname() + "_SOURCES", platform_sources(platform))
r += var_add(cname() + "_SOURCES", shared_sources())
r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform)) r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform))
r += var_add("nodist_" + cname() + "_SOURCES", shared_nodist_sources())
r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_LIBRARY) " + platform_cflags(platform)) r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_LIBRARY) " + platform_cflags(platform))
r += var_set(cname() + "_CPPFLAGS", "$(AM_CPPFLAGS) $(CPPFLAGS_LIBRARY) " + platform_cppflags(platform)) r += var_set(cname() + "_CPPFLAGS", "$(AM_CPPFLAGS) $(CPPFLAGS_LIBRARY) " + platform_cppflags(platform))
r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_LIBRARY) " + platform_ccasflags(platform)) r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_LIBRARY) " + platform_ccasflags(platform))
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform)) # r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
r += gvar_add("EXTRA_DIST", platform_extra_dist(platform)) r += gvar_add("EXTRA_DIST", extra_dist())
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
@ -362,9 +449,7 @@ def program(platform, test=False):
r += "[+ ENDIF +]" r += "[+ ENDIF +]"
r += var_set(cname() + "_SOURCES", platform_sources(platform)) r += var_set(cname() + "_SOURCES", platform_sources(platform))
r += var_add(cname() + "_SOURCES", shared_sources())
r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform)) r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform))
r += var_add("nodist_" + cname() + "_SOURCES", shared_nodist_sources())
r += var_set(cname() + "_LDADD", platform_ldadd(platform)) r += var_set(cname() + "_LDADD", platform_ldadd(platform))
r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_PROGRAM) " + platform_cflags(platform)) r += var_set(cname() + "_CFLAGS", "$(AM_CFLAGS) $(CFLAGS_PROGRAM) " + platform_cflags(platform))
r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_PROGRAM) " + platform_ldflags(platform)) r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_PROGRAM) " + platform_ldflags(platform))
@ -372,14 +457,14 @@ def program(platform, test=False):
r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_PROGRAM) " + platform_ccasflags(platform)) r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_PROGRAM) " + platform_ccasflags(platform))
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform)) # r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
r += gvar_add("EXTRA_DIST", platform_extra_dist(platform)) r += gvar_add("EXTRA_DIST", extra_dist())
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
return r return r
def data(platform): def data(platform):
r = gvar_add("EXTRA_DIST", platform_sources(platform)) r = gvar_add("EXTRA_DIST", platform_sources(platform))
r += gvar_add("EXTRA_DIST", platform_extra_dist(platform)) r += gvar_add("EXTRA_DIST", extra_dist())
r += gvar_add(installdir() + "_DATA", platform_sources(platform)) r += gvar_add(installdir() + "_DATA", platform_sources(platform))
return r return r
@ -403,31 +488,31 @@ chmod a+x [+ name +]
return r return r
def module_rules(): def module_rules():
return "[+ FOR module +]" + each_platform( return "[+ FOR module +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, module(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, module(p))) + "[+ ENDFOR +]"
def kernel_rules(): def kernel_rules():
return "[+ FOR kernel +]" + each_platform( return "[+ FOR kernel +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, kernel(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, kernel(p))) + "[+ ENDFOR +]"
def image_rules(): def image_rules():
return "[+ FOR image +]" + each_platform( return "[+ FOR image +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, image(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, image(p))) + "[+ ENDFOR +]"
def library_rules(): def library_rules():
return "[+ FOR library +]" + each_platform( return "[+ FOR library +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, library(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, library(p))) + "[+ ENDFOR +]"
def program_rules(): def program_rules():
return "[+ FOR program +]" + each_platform( return "[+ FOR program +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, program(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, program(p))) + "[+ ENDFOR +]"
def script_rules(): def script_rules():
return "[+ FOR script +]" + each_platform( return "[+ FOR script +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, script(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, script(p))) + "[+ ENDFOR +]"
def data_rules(): def data_rules():
return "[+ FOR data +]" + each_platform( return "[+ FOR data +]" + foreach_enabled_platform(
lambda p: under_platform_specific_conditionals(p, data(p))) + "[+ ENDFOR +]" lambda p: under_platform_specific_conditionals(p, data(p))) + "[+ ENDFOR +]"
print "[+ AutoGen5 template +]\n" print "[+ AutoGen5 template +]\n"

File diff suppressed because it is too large Load diff

View file

@ -277,7 +277,7 @@ for cipher_file in cipher_files:
conf.write ("module = {\n") conf.write ("module = {\n")
conf.write (" name = %s;\n" % modname) conf.write (" name = %s;\n" % modname)
for src in modfiles.split(): for src in modfiles.split():
conf.write (" source = %s;\n" % src) conf.write (" common = %s;\n" % src)
conf.write (" cflags = '$(CFLAGS_GCRY)';\n"); conf.write (" cflags = '$(CFLAGS_GCRY)';\n");
conf.write (" cppflags = '$(CPPFLAGS_GCRY)';\n"); conf.write (" cppflags = '$(CPPFLAGS_GCRY)';\n");
conf.write ("};\n\n") conf.write ("};\n\n")