[coreboot] [patch] 'dist' target for 'flashrom' Makefile

Uwe Hermann uwe at hermann-uwe.de
Fri Jan 25 15:43:02 CET 2008


On Wed, Jan 23, 2008 at 09:55:30PM +0200, Martin-Éric Racine wrote:
> I just implemented release tarball generation (with ChangeLog
> generation) in the enclosed patch for flashrom's Makefile, diffed
> against SVN.

Please send all patches with a Signed-off-by, otherwise we cannot
commit. See http://www.coreboot.org/Development_Guidelines#Sign-off_Procedure

> This required editing the version parsing rule to make it useful for
> versioning the tarball filename too. Please check if this still
> produces the desired effect for the -D CFLAG fragment.

Not quite, after running 'make' I get:

  cc1: warnings being treated as errors
  flashrom.c: In function ‘print_version’:
  flashrom.c:221: warning: format ‘%s’ expects type ‘char *’, but argument 2 has ype ‘int’
  make: *** [flashrom.o] Error 1

The fix is easy though, you have to use


(note the additional quotes)

> diff -pruN flashrom/Makefile flashrom.new/Makefile
> --- flashrom/Makefile	2008-01-23 15:03:54.000000000 +0200
> +++ flashrom.new/Makefile	2008-01-23 17:10:05.000000000 +0200
> @@ -8,6 +8,7 @@ PROGRAM = flashrom
>  CC      = gcc
>  STRIP	= strip
> +GZIP_ENV = --best
>  INSTALL = /usr/bin/install
>  PREFIX  = /usr/local
>  #CFLAGS  = -O2 -g -Wall -Werror
> @@ -30,23 +31,34 @@ all: pciutils dep $(PROGRAM)
>  # Set the flashrom version string from the highest revision number
>  # of the checked out flashrom files.
> -SVNDEF := -D'FLASHROM_VERSION="$(shell svnversion -cn . \
> -          | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/")"'
> +SVNDEF := $(shell svnversion -cn . | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/")
>  $(PROGRAM): $(OBJS)
>  	$(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
> +ChangeLog:
> +	svn2cl

I'd make this 'svn log > ChangeLog' or 'svn log -v > ChangeLog' in order
to not add the additional dependency on svn2cl. The output is similarly
useful, IMO.

Also, the ChangeLog is not included in the tarball at the moment, you
have to put it in the flashrom-rXXXX directory before tar'ing it.

Another problem is that the generated tarball cannot correctly build a
working version of flashrom. The version number string is not passed
correctly, you get

  gcc -Os -Wall -Werror -DDISABLE_DOC  -D'FLASHROM_VERSION=""'   -c -o sst28sf040.o sst28sf040.c

Which leads to a broken --version output. Fixing this is a bit tricky.

Personally, I'm not convinced we want to do tarball releases at all, not
sure it's worth the hassle. Definately not "real" releases as in
flashrom 0.4.5 or so, but maybe one tarball per svn revision would be
nice to put up on the website similar to the svn snapshots which are
generated for coreboot? Stefan?

http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org

More information about the coreboot mailing list