Skip to contentSkip to conversation

Build environment

DISCUSSION Jeff Bailey 3 participants 3 messages Aug 5, 2006 – Aug 10, 2006

lore
Share & tools
lore
#0 lore raw

I'll start by saying that I have nothing but hate for the build environment in grub2.

I realise that automake can be equally confusing in many ways, but it has two main advantages: 1) Everyone knows it already, 2) Other people are helping solve bugs with it.

Assuming that we're stuck with this, is it home grown or is there some upstream project using it? The types of problems that I've seen:

* No autodetection of Makefile snippet, to auto update them. No
generic rules to handle the updating when testing.

* No obvious well to tell how it's getting to any given phase. No
documentation.

* Dependancy generation is run too early. Initial dependancies are
broken.

* No obvious way to add dependancies to specific files that need them.

* Order in .mk files is important even for seemingly unrelated clauses.

The build system for grub2 just gets in the way of coding the program itself. I have a working version of grub-emu now for hppa-ipl, but most of my coding time has been spent staring at Makefiles, wondering how the other targets work, and copying segments of .rmk files that are essentially identical in other files. Done right, I suspect that I could've done the port to this point in about 4 lines of Makefile snippet.

I've hated the build system for years, and the fact that none of the people in #grub seem to understand it either doesn't help. I've offered to fix it up using the usual set of autotools a number of times, and the offer still stands.
</rant>

Signature · 3 lines
I do not agree with a word you say, but I will defend to the death your
right to say it. 
 - Voltaire
#1 lore raw
Quoted 2 lines · Jeff Bailey

I'll start by saying that I have nothing but hate for the build environment in grub2.

In general I'd agree with that.

Quoted 3 lines

I realise that automake can be equally confusing in many ways, but it has two main advantages: 1) Everyone knows it already, 2) Other people are helping solve bugs with it.

As far as I've seen, most projects using automake barely understand it. "Everyone knows it already" sounds like a huge overstatement to me.

Quoted 2 lines

Assuming that we're stuck with this, is it home grown or is there some upstream project using it? The types of problems that I've seen:

It seems to be some homegrown Ruby that Okuji wrote.

Quoted 6 lines

* No autodetection of Makefile snippet, to auto update them. No
generic rules to handle the updating when testing.

* No obvious well to tell how it's getting to any given phase. No
documentation.

Quoted 6 lines

* Dependancy generation is run too early. Initial dependancies are
broken.

* No obvious way to add dependancies to specific files that need them.

* Order in .mk files is important even for seemingly unrelated clauses.

Adding or deleting files results in incredibly frustrating "can't find .d file" messages, even when trying to run "make clean"! That one has caused me a lot of aggravation.

Quoted 7 lines

The build system for grub2 just gets in the way of coding the program itself. I have a working version of grub-emu now for hppa-ipl, but most of my coding time has been spent staring at Makefiles, wondering how the other targets work, and copying segments of .rmk files that are essentially identical in other files. Done right, I suspect that I could've done the port to this point in about 4 lines of Makefile snippet.

I agree, there is also a huge amount of duplication in the "mk" files. They can and should be refactored to simplify them.

Quoted 4 lines

I've hated the build system for years, and the fact that none of the people in #grub seem to understand it either doesn't help. I've offered to fix it up using the usual set of autotools a number of times, and the offer still stands.

I'm no fan of autotools.

-Hollis

#2 lore raw
In reply to Jeff Bailey
Quoted 2 lines · Jeff Bailey

I'll start by saying that I have nothing but hate for the build environment in grub2.

That's your freedom. :p

Quoted 3 lines

I realise that automake can be equally confusing in many ways, but it has two main advantages: 1) Everyone knows it already, 2) Other people are helping solve bugs with it.

Automake is unacceptable, since it does not support what GRUB 2 requires. For instance, how do you specify different compilers for different targets? I can enumerate a lot of deficiency in automake, as I was an automake developer, but I don't think it's worth doing here. The only way to fix automake is to redesign it from scratch; then this is much more work than writing our own Makefile generator.

Note that our generator is designed for those who know automake to understand very easily. The way of how it works is quite similar to automake.

Quoted 2 lines

* No autodetection of Makefile snippet, to auto update them. No
generic rules to handle the updating when testing.

I do not understand this. What rules do you need?

Quoted 2 lines

* No obvious well to tell how it's getting to any given phase. No
documentation.

Because I think it is too trivial for those who know GNU make.

Quoted 2 lines

* Dependancy generation is run too early. Initial dependancies are
broken.

Yes, I agree. Please feel free to improve it.

Quoted 1 line

* No obvious way to add dependancies to specific files that need them.

It is obvious. You just write a dependency as in GNU make. Like automake, every line is verbosely copied.

Quoted 1 line

* Order in .mk files is important even for seemingly unrelated clauses.

I haven't notified this.

Okuji