headers.sed can't handle embedded tabs

Doug Evans dje@transmeta.com
Mon Aug 12 17:07:00 GMT 2002


Is anyone else seeing the top of the files generated by "make headers"
containing incorrect text?

doc/Makefile quotes the file dependency list to passed to sed.
e.g.

	echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@

With that I'm getting this for libbfd.h.

/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
   generated from "proto.str			chew".
   Run "make headers" in your build bfd/ to regenerate.  */

If I remove the quoting, as in,

-	echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
+	echo $(LIBBFD_H_DEP) | sed -f $(srcdir)/header.sed > $@

I get the expected

/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
   generated from "libbfd-in.h", "init.c", "libbfd.c", "cache.c", 
   "reloc.c", "archures.c" and "elf.c".
   Run "make headers" in your build bfd/ to regenerate.  */

Some experimentation reveals it's this line of headers.sed.

s|[^ ]*/||g

Maybe ya want to support tabs in there.
Maybe ya want to not quote the arg to echo.
I'll leave it to you to fix as you wish.



More information about the Binutils mailing list