Friday, September 26, 2008

Reading code is not as easy as it seems.

Reading client.mk and configure has been quite the tough task for me so far. Why am I even trying to read them? For my project of course.

At first, I thought that putting the 'time' command for each of the command called during the build would be an easy task. I was thinking, I'm sure they put all those call in some sort of loop and I can just put the 'time' in there in front of the calls. Oh boy was I wrong.

I started with trying to do some simple output in client.mk file to see if I was working with the right file for the build. Not much luck there, editing the client.mk was trickier than I thought it'd be. Just trying to read and find out where I should put the output took longer than expected. And when I finally found a place I think was a good spot, I tried putting some printf commands, echo commands, whatever commands it seems like it would take to output something on the screen, but whatever I tried, I always get the "separator missing" error. That was really annoying me. And when I finally got that error fixed, I can't see my output anywhere when I compiled.

So then, I thought maybe I'm not editing the right file, so I took at a look at the build output and see if it's reading some other files to make the calls for building.

Now I moved from reading client.mk to configure. What a big change it was. Reading from a file that's 410 lines to a file that's 22910 lines. Just seeing the line number was intimidating enough.

So before I continue trying to read configure, I'm going to ask around to make sure I'm looking at the right file.

2 comments:

Ted Mielczarek said...

I wouldn't bother reading either, honestly. configure gets run once at the beginning of a build, so it's not very performance-sensitive. client.mk drives the build, but you can build without it, it's mostly just a convenience. The real meat of building happens in rules.mk and some other files. If you catch me on IRC sometime I can point you at some relevant parts.

Tony Lai said...

Hey Patrick, my projects running pretty well now so just let me know if you need anything alright?

From your post here it looks like you're losing a bit of motivation you had earlier.

Let's build it up again =)
DP!