[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New build system for GRUB

From: BVK Chaitanya
Subject: New build system for GRUB
Date: Wed, 31 Mar 2010 16:37:15 +0530


New automake based build system for GRUB is now available in
branches/automake branch.  Build system now has new dependency on GNU
Automake and GNU Autogen.  Autogen is used to convert a modules.def
definitions file into an automake makefile ( which is
included by

This modules.def definitions file is specially tailored to meet the
needs of GRUB requirements.  For example GRUB requirements includes,

1.  Some module FOO should be built only on, say i386-pc, i386-qemu,
i386-coreboot, but not on others.

This can be specified in modules.def file as,

module = {
  name = FOO;
  source = foo.c;

There are tags for each platform, and we can have tags for groups of
platforms, like i386 to mean i386-*, x86 to mean i386-* and x86_64-*,

2.  Some module BAR should be built with files efi/xyz.c efi/bar.c
when built for x86 efi platforms, ieee1275/bar.c for sparc-ieee275,
and bar.c for the rest of platforms.

This can be specified in modules.def file as,

module = {
  name = BAR;
  source = bar.c;

  x86-efi = efi/bar.c;
  x86-efi = efi/xyz.c;

  sparc-ieee1275 = ieee1275/bar.c;


Notice that tags can be used not just to enable the module for a
platform, but also to list the source files too, if necessary.  For
platforms that are enabled without explicit sources (in the example,
common tag enables all platforms), sources listed under "source" name
will be used.

Note that we can have multiple source files embedded in quotes on single line.

3.  Different flags are for different builds.

This is achieved as:

module = {
  name = BAZ;
  source = baz.c;

  cppflags = -Iincludedir;

  i386_cppflags = -Ii386_includes;

I believe this is self explanatory.

Though I started for above goals in mind, I ended up extending it for
other GRUB components also (i.e, .img files, scripts, programs,
libraries, test scripts and test programs, man pages).  Please go
through and grub-core/ files for the examples.

This GNU Autogen definitions is processed with a template file,
Makefile.tpl generated by gentpl.rb script.  Let me know your


reply via email to

[Prev in Thread] Current Thread [Next in Thread]