[EMAIL PROTECTED] writes:

> Hey guys,
> 
> I have made a number of modifications to NLBConfig, listed below.  If
> you consider these changes to be useful to your project, let me know
> and I may do some more, based on your feedback.  The overall reasons I
> made these changes were:
> 
> - To make the Makefile more readable and better documented, e.g. where
> do the different parts of the Makefile come from, what do they do,
> etc.?  This helped me understand the build process a lot better, and I
> think it would help other newcomers also.  Maybe oldtimers as well,
> when you experiment with new configurations, as you have done a lot
> lately.

This sounds like a good goal.  Even if we automatically generate it,
having a readable config file is appreciated.
 
> - To make NLBConfig a bit more readable, behave more consistently,
> give more informative diagnostics, be a little easier to use.
> 
> I have tried to maintain compatibility with existing config files, and
> as far as I know I haven't broken anything, but I have only tested it
> with a SiS630 build (and I don't have the hardware to test those bits
> with).
> 
> ...also, a few other notes/suggestions...

Ah so we need to be carefull :)
 
> - In the data sheets for a couple EPROMS and FLASH parts that I looked at,
> erasing the part results in memory being set to 0xFF.  And I've noticed
> with my EPROM programmer that when unused bytes are filled with FF (instead
> of 00), the programming is much faster.  So, you might consider changing
> mkrom and similar tools, to have them set unused bytes to FF.  It might
> speed up the FLASH programming.

Good suggestion.

 
> - This code in ~/freebios/src/arch/i386/config/make.base looks a bit odd:
> 
> addaction linuxbios.rom dd if=linuxbios.strip of=linuxbios.rom bs=1 seek=`expr
> $(ROM_IMAGE_SIZE) - $$size`
> 
> 
> For one thing, "dd ... seek" doesn't pad out the beginning of the file
> if the file doesn't already exist, at least on my system.  

It does on mine, and that was the intended behavior.  Are you certain
you had a ROM_IMAGE_SIZE greater than your image start?

> Instead, it
> just acts like cp - which I think is ok, because mkrom takes care of
> padding and so on.  

mkrom is no longer run.  At least it shouldn't be.

> If I've misunderstood something and you really want
> to pad the beginning of the file (with 0xFF) you can do the following:
> 
> addaction linuxbios.rom perl -e 'print "\377" x ('$(ROM_IMAGE_SIZE)-$$size')' >
> $@
> addaction linuxbios.rom cat linuxbios.strip >> $@

Since I've introduced perl in a few other places that looks like a much
better action.  

> - There are several files in the freebios/src tree that have lines of the form
> static char rcsid[] =
> "$Id: northbridge.c,v 1.8 2001/11/06 04:29:38 ollie Exp $";
> 
> These files cause "defined but not used" warnings when compiled.  The
> warnings are just noise that may be drowning out possibly more serious
> warnings.  The "not used" warnings can be cured by just changing the
> first line to
> 
> static char rcsid[] __attribute__ ((unused)) =

That sounds good.  It would probably do even better to make a
macro RCSID.  i.e.

#define RCSID(x) static char rcsid[] __attribute__ ((unused)) = x 
And then we could be easily consistent.

> 
> 
> Cheers!
> - Jan
> 
> 
> The changes to NLBConfig are as follows:
> 
> - Put more whitespace and comments into the Makefile.
> 
> - The "include cpuflags" in the Makefile was broken: namely, the
> cpuflags file was generated long after it was needed.  So I eliminated
> the cpuflags file and used a different mechanism to compute CPUFLAGS.
> Yet another way to do this would be to just have NLBConfig write
> "CPUFLAGS := ..." in Makefile.settings.

Was it really broken.  It works here and I haven't heard complaints.
GNU make is pretty smart about building makefile depenencies.

Ideally I'd like to have 2 tools.
Build-Makefile
Build-Configuration

And with everything being derived from Makefile.settings and regenerated
we don't have a problem seperating things out.

> - NLBConfig.py was renamed to NLBConfig and made executable.  So you
> just say "NLBConfig ... ..." rather than "python NLBConfig.py ... ..."
> 
> - The build directory is created if necessary.  This eliminates a
> dozen lines from the HOWTO document.

Quite reasonable.
 
> - The "Trying to create" messages were replaced with "Creating".
> Let's have a confident attitude :-)
> 
> - Deleted some apparently obsolete comments, rewrote some code to
> hopefully improve clarity.  Removed unreachable feature "list_vals".
> 
> - During make, the gcc lines are printed as "gcc ... -o nsuperio.o
> nsuperio.c" in one line rather than several lines of repetitious and
> noisy details.

I'll have to look but that sounds good.  Having all of the defines
on the command line is probably a bad idea but it was a good first stab.
 
> - Renamed some variables in the NLBConfig script to better match the
> command with which they are associated, for example outputdir is
> renamed target_dir.
> 
> - There seemed to be no reason to have separate userrules and
> makebaserules, so userrules was eliminated.
> 
> - Changed the rules for remaking Makefile when config dependencies
> change so as to avoid running NLBConfig twice.

Hmm.  I haven't seen that but it sounds o.k.
 
> - Improved error detection and reporting, in particular, report the
> config file in which any duplicate makerule target definition occurs,
> and in which command any syntax error occurs; detect and report more
> syntax errors.
> 
> - Cause makerules to be written to Makefile in the order that they are
> defined, rather than hash order.
> 
> - Change the parser for makerule and addaction to allow "#" comments
> to be passed to the Makefile as actions.  This allows the comments to
> be printed when make runs.
> 
> - Makerule remembers the config file where the makerule was given, and
> writes it in the Makefile, so it's easier to tell where rules come
> from.
Cool.

And you missed the number one detail on my todo list.  Add header file
dependencies so we have complete dependency information.

Eric

Reply via email to