[openfirmware] r871 - cpu/x86 cpu/x86/build cpu/x86/pc/olpc cpu/x86/pc/olpc/build forth/kernel forth/lib

svn at openfirmware.info svn at openfirmware.info
Thu Aug 7 23:12:51 CEST 2008


Author: wmb
Date: 2008-08-07 23:12:51 +0200 (Thu, 07 Aug 2008)
New Revision: 871

Added:
   forth/lib/toctags
Modified:
   cpu/x86/basefw.bth
   cpu/x86/build/builder.dic
   cpu/x86/kernel.bth
   cpu/x86/pc/olpc/build/Makefile
   cpu/x86/pc/olpc/fw.bth
   cpu/x86/tools.bth
   forth/kernel/kernel.fth
   forth/kernel/meta1.fth
Log:
Added ctags support - building the firmware image automatically creates a "tags" file.



Modified: cpu/x86/basefw.bth
===================================================================
--- cpu/x86/basefw.bth	2008-08-06 07:06:30 UTC (rev 870)
+++ cpu/x86/basefw.bth	2008-08-07 21:12:51 UTC (rev 871)
@@ -5,6 +5,8 @@
 command: &x86forth &dictionary &this
 build-now
 
+" basefw.tag" r/w create-file drop  tag-file !
+
 \ ' $report-name is include-hook
 \ ' noop is include-hook
 
@@ -120,7 +122,10 @@
 [ifndef] no-heads
 resident   dispose   0 0 set-transize   \ true is suppress-transient
 
+tag-file @ fclose  tag-file off
+
 cr .( --- Saving basefw.dic --- )  " basefw.dic" $save-forth  cr
+
 [then]
 
 \ LICENSE_BEGIN

Modified: cpu/x86/kernel.bth
===================================================================
--- cpu/x86/kernel.bth	2008-08-06 07:06:30 UTC (rev 870)
+++ cpu/x86/kernel.bth	2008-08-07 21:12:51 UTC (rev 871)
@@ -69,6 +69,8 @@
 
 fload ${BP}/cpu/x86/metainit.fth
 
+" kernel.tag" r/w create-file drop  meta-tag-file !
+
 always-headers
 
 \ Comment out the following line(s) when debugging
@@ -109,6 +111,8 @@
 
 ' (do-literal) is do-literal
 
+meta-tag-file @ fclose  meta-tag-file off
+
 fload ${BP}/cpu/x86/saveexp.fth
 fload ${BP}/cpu/x86/savemeta.fth
 

Modified: cpu/x86/pc/olpc/build/Makefile
===================================================================
--- cpu/x86/pc/olpc/build/Makefile	2008-08-06 07:06:30 UTC (rev 870)
+++ cpu/x86/pc/olpc/build/Makefile	2008-08-07 21:12:51 UTC (rev 871)
@@ -1,7 +1,15 @@
 OS := $(shell uname)
 
-all: olpc.rom
+BASEDIR= `(cd ../../../../..; pwd;)`
+TAGFILES= ../../../build/*.tag *.tag
 
+all: olpc.rom tags
+
+fw.tag: olpc.rom
+
+tags: fw.tag
+	@${BASEDIR}/forth/lib/toctags ${BASEDIR} ${TAGFILES}
+
 ofw.elf: FORCE build ../../../build/inflate.bin
 	./build $@
 

Modified: cpu/x86/pc/olpc/fw.bth
===================================================================
--- cpu/x86/pc/olpc/fw.bth	2008-08-06 07:06:30 UTC (rev 870)
+++ cpu/x86/pc/olpc/fw.bth	2008-08-07 21:12:51 UTC (rev 871)
@@ -6,6 +6,7 @@
 in: builton.fth
 build-now
 
+" fw.tag" r/w create-file drop  tag-file !
 
 hex
 \ ' $report-name is include-hook
@@ -617,6 +618,8 @@
 warning !
 previous previous definitions
 
+tag-file @ fclose  tag-file off
+
 .( --- Saving fw.dic ...)
 " fw.dic" $save-forth cr
 

Modified: cpu/x86/tools.bth
===================================================================
--- cpu/x86/tools.bth	2008-08-06 07:06:30 UTC (rev 870)
+++ cpu/x86/tools.bth	2008-08-07 21:12:51 UTC (rev 871)
@@ -9,6 +9,8 @@
 \ ' $report-name is include-hook
 \ : rn  (cr 2dup type 15 spaces  ;  ' rn is include-hook
 
+" tools.tag" r/w create-file drop  tag-file !
+
 create resident-packages
 
 fload ${BP}/forth/lib/fwsetup.fth
@@ -37,8 +39,12 @@
 resident   dispose   0 0 set-transize   \ true is suppress-transient
 \ .(   zeroed: ) dot
 
+tag-file @ fclose  tag-file off
+
 ' noop is include-hook  ' noop is include-exit-hook
 .( --- Saving tools.dic --- )  " tools.dic" $save-forth cr
+
+
 [then]
 \ LICENSE_BEGIN
 \ Copyright (c) 2006 FirmWorks

Modified: forth/kernel/kernel.fth
===================================================================
--- forth/kernel/kernel.fth	2008-08-06 07:06:30 UTC (rev 870)
+++ forth/kernel/kernel.fth	2008-08-07 21:12:51 UTC (rev 871)
@@ -1362,8 +1362,23 @@
 
 headerless
 
+nuser tag-file
+
+decimal
+: $tag-field  ( $ -- )  tag-file @ fputs  ;
+: tag-char  ( char -- )  tag-file @ fputc  ;
+: $tagout  ( name$ -- )
+   tag-file @ 0=  if  2drop exit  then
+   source-id -1 =  if  2drop exit  then
+   $tag-field  9 tag-char
+   source-id file-name  $tag-field  9 tag-char
+   base @ decimal  source-id file-line (.) $tag-field  base !
+   newline-string $tag-field
+;
+
 : $make-header  ( adr len voc-acf -- )
    -rot                        ( voc-acf adr,len )
+   2dup $tagout
    dup 1+ /link +              ( voc-acf adr,len hdr-len )
 
    here +                       ( voc-acf adr,len  addr' )

Modified: forth/kernel/meta1.fth
===================================================================
--- forth/kernel/meta1.fth	2008-08-06 07:06:30 UTC (rev 870)
+++ forth/kernel/meta1.fth	2008-08-07 21:12:51 UTC (rev 871)
@@ -14,6 +14,8 @@
 variable current-t
 variable context-t
 
+variable meta-tag-file
+
 \ Return the host address where the given target address is being compiled
 : >hostaddr  ( target-address -- host-address )
    origin-t -   compilation-base l+
@@ -57,7 +59,9 @@
    context link@ >r   current link@ >r   warning @ >r
    context link!  definitions
    warning off
+   tag-file @ >r  meta-tag-file @ tag-file !
    $create
+   r> tag-file !
    r> warning !   r> current link!   r> context link!
 ;
 \ : vcreate  ( str voc-cfa -- )  count $vcreate  ;

Added: forth/lib/toctags
===================================================================
--- forth/lib/toctags	                        (rev 0)
+++ forth/lib/toctags	2008-08-07 21:12:51 UTC (rev 871)
@@ -0,0 +1,10 @@
+#! /bin/sh
+# Converts a collection of .tag files to ctag format
+
+# Usage: toctag BASEDIR file.tag ...
+
+homedir=$1
+shift
+
+sed -e "s,\${BP},${homedir}," $* | LC_ALL=C sort >tags
+


Property changes on: forth/lib/toctags
___________________________________________________________________
Added: svn:executable
   + *




More information about the openfirmware mailing list