[coreboot] patch: allow kscope support for mainboard source code browsing.
Uwe Hermann
uwe at hermann-uwe.de
Tue Oct 7 02:36:56 CEST 2008
On Mon, Oct 06, 2008 at 05:26:47PM -0700, ron minnich wrote:
> These changes allow users to use kscope to browse v3 source.
>
> Want to find a function definition? Click and hit CTL-1
> Want to see what it calls? CTL-2
> Want to see who calls it? CTl-3
>
> And so on.
>
> For information on kscope please see: http://kscope.sourceforge.net/
> It's a great way to browse a project. The key idea here is that the
> kscope configuration is *specific to your mainboard* -- you only see the
> source and includes used in your mainboard!
>
> Improvements to the mkdep script are MOST welcome. I am no
> expert.
>
> Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>
>
> Index: util/mkdep
> ===================================================================
> --- util/mkdep (revision 0)
> +++ util/mkdep (revision 0)
> @@ -0,0 +1,16 @@
As always, add the usual license header please.
> +#!/bin/bash
I'd make this /bin/sh if that works, we don't want to depend on bash,
various people might use other shells.
> +out=$1
> +shift
> +o=""
> +while [ "$1" != "--" ]; do
> +o="$o $1"
> +shift
> +done
> +shift
> +p=`pwd`
> +while [ "$1" ] ; do
> +echo $1 >>${out}
> +cpp -M -m32 $o $1 | sed 's/.*://' | sed 's/^ *//g' | tr ' ' '\n' | tr '\\' ' ' |sed "s,^include,${p}/include," >>${out}
> +shift
> +done
> +sort -o ${out} -u ${out}
> Index: arch/x86/Makefile
> ===================================================================
> --- arch/x86/Makefile (revision 900)
> +++ arch/x86/Makefile (working copy)
> @@ -23,7 +23,7 @@
> ifeq ($(CONFIG_ARCH_X86),y)
>
> INITCFLAGS := $(CFLAGS) -I$(src)/include/arch/x86 -I$(src)/include \
> - -I$(obj) -I$(src)/mainboard/$(MAINBOARDDIR)/-fno-builtin
> + -I$(obj) -I$(src)/mainboard/$(MAINBOARDDIR)/ -fno-builtin
Yep, that looks like an (unrelated?) bug.
> SILENT := >/dev/null 2>&1
>
> @@ -275,3 +275,17 @@
> $(Q)$(NM) $(obj)/coreboot.initram | sort -u > $(obj)/coreboot.initram.map
>
> endif
> +
> +#
> +# For Kscope
Add the project URL here, I'd say (for convenience).
> +#
> +
> +kscope: $(obj)/mainboard/$(MAINBOARDDIR)/kscope/cscope.files
> + kscope $(obj)/mainboard/$(MAINBOARDDIR)/kscope
> +ALLSRC=$(STAGE0_SRC) $(INITRAM_SRC) $(STAGE2_SRC)
> +$(obj)/mainboard/$(MAINBOARDDIR)/kscope/cscope.files: $(ALLSRC)
> + $(Q)mkdir -p $(obj)/mainboard/$(MAINBOARDDIR)/kscope
> + $(Q)cp cscope.proj $(obj)/mainboard/$(MAINBOARDDIR)/kscope
> + $(Q)sh util/mkdep $@ $(INITCFLAGS) "--" $(ALLSRC)
Actually, maybe it's better to merge mkdep in the Makefile itself?
That would save us yet another tiny file cluttering up the space...
Opinions?
Uwe.
--
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