1: \ builttag.fs
2:
3: \ Copyright (C) 1998 Free Software Foundation, Inc.
4:
5: \ This file is part of Gforth.
6:
7: \ Gforth is free software; you can redistribute it and/or
8: \ modify it under the terms of the GNU General Public License
9: \ as published by the Free Software Foundation; either version 2
10: \ of the License, or (at your option) any later version.
11:
12: \ This program is distributed in the hope that it will be useful,
13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: \ GNU General Public License for more details.
16:
17: \ You should have received a copy of the GNU General Public License
18: \ along with this program; if not, write to the Free Software
19: \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20:
21: variable builtnr
22: create linebuf 200 chars allot
23: create filename 200 chars allot
24: 0 value fd
25:
26: : s'
27: [char] ' parse postpone sliteral ; immediate
28:
29: : builttag
30: sourcefilename filename place
31: 'n filename count + 1 chars - c!
32: filename count r/o bin open-file
33: IF drop 0 builtnr !
34: ELSE >r linebuf 100 r@ read-line drop drop
35: linebuf swap 0 -rot 0 -rot >number 2drop drop 1+
36: builtnr ! r> close-file throw
37: THEN
38: filename count r/w bin create-file throw to fd
39: base @ >r decimal
40: builtnr @ s>d <# #S #> fd write-file throw
41: s" constant built#" fd write-line throw
42: s' const create builtdate ," ' fd write-file throw
43: time&date >r >r >r
44: s>d <# ': hold # # #> fd write-file throw
45: s>d <# bl hold # # #> fd write-file throw
46: drop
47: r> s>d <# '. hold # # #> fd write-file throw
48: r> s>d <# '. hold # # #> fd write-file throw
49: r> s>d <# # # # # #> fd write-file throw
50: s' "' fd write-line throw
51: s' : .built cr ." Built #" built# . ." Date " builtdate count type cr ;'
52: fd write-line throw
53: fd close-file throw
54: filename count included
55: r> base ! ;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>