Commit 6d81e2f4 authored by jwilke's avatar jwilke

Dos Changes:

!!Moved:
engine/32bit.h moved to arch/generic/machine.h
cache.c moved to arch/hppa/
cleanalign.c moved to engine/
!!New Files:
envos.* *.bsh
Instead of linking arch/xy/machine.h an custom include path is used
engine.a engine.o main.o makes with engine/Makefile now
history.fs and startup.fs works for dos and unix now
environment variable osclass is set in envos.fs, wich is os-specific
any comments?
supressed some warnings in main.c
parent 62956219
......@@ -23,12 +23,33 @@
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
#gforth version
# Warning:
# For some stupid reason setting SHELL to bash does not work properly with
# DOS. If you want to use shell-specific things that must run with DOS make
# an external batch file and call it with bash (see versions.bsh).
# ------------- gforth version
VERSION_MAJOR=0
VERSION_MINOR=3
VERSION_RELEASE=1
VERSION =$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
DOSVERSION=$(VERSION_MAJOR)$(VERSION_MINOR)$(VERSION_RELEASE)
# ------------- System specific variables
machine=@mach_h@
# this is the type of machine
# used to extend the include path with ./arch/$machine
# so we could include a machine specific
# machine.h file
PATHSEP = @PATHSEP@
osclass = @OSCLASS@
# ------------- Utility programs
SHELL = /bin/sh
RM = rm
RMTREE = rm -rf
......@@ -40,7 +61,6 @@ INSTALL_DATA = @INSTALL_DATA@
LN_S = @LN_S@
GCC = @CC@
CC = $(GCC)
PATHSEP = @PATHSEP@
FORTHPATH = $(libdir)/gforth/site-forth$(PATHSEP)$(datadir)/gforth/site-forth$(PATHSEP)$(libdir)/gforth/$(VERSION)$(PATHSEP)$(datadir)/gforth/$(VERSION)$(PATHSEP).
FORTHSIZES = @FORTHSIZES@
FORTH = ./gforth -p $(FORTHPATH)$(PATHSEP)$(srcdir)
......@@ -53,12 +73,15 @@ DVI2PS = dvips -D300
#you can get texi2html from http://wwwcn.cern.ch/dci/texi2html/
TEXI2HTML = texi2html
MAKEINFO = makeinfo
# ------------- Compiler Flags
XCFLAGS = @CFLAGS@
XDEFINES = @DEFS@
SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions
ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves
DEBUGFLAG = @DEBUGFLAG@
CFLAGS = $(DEBUGFLAG) -I$(srcdir)/engine -I$(srcdir) -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
CFLAGS = $(DEBUGFLAG) -I$(srcdir)/engine -I$(srcdir)/arch/$(machine) -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
#John Wavrik should use -Xlinker -N to get a writable text (executable)
XLDFLAGS = @LDFLAGS@
......@@ -66,6 +89,8 @@ GCCLDFLAGS = @GCCLDFLAGS@
LDFLAGS = $(DEBUGFLAG) $(XLDFLAGS) $(GCCLDFLAGS)
LDLIBS = @LIBS@
# ------------ Install Directorys
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
......@@ -168,7 +193,8 @@ COMPAT = compat/CVS compat/README compat/control.fs compat/anslocal.fs \
ALLSUBDIRS = engine
ARCHS = arch/m68k/machine.h \
ARCHS = arch/generic/machine.h \
arch/m68k/machine.h \
arch/mips/machine.h \
arch/386/machine.h \
arch/hppa/machine.h \
......@@ -230,7 +256,7 @@ DOCDIST = doc/gforth.info doc/gforth.info-* doc/gforth.ps
#stuff in a binonly distribution
BINONLYDIST = config.status Makefile gforth gforth-ditc \
$(OBJECTS0) $(OBJECTS) $(OBJECTS_DITC)\
machine/machine.h engine/config.h kernel.fi \
arch/$(machine)/machine.h engine/config.h kernel.fi \
stamp-h engine/version.h kernel/version.fs version-stamp \
INSTALL.BINDIST
......@@ -244,20 +270,29 @@ GEN_PRECIOUS = $(FORTH_GEN) $(KERNLS) doc/gforth.texi doc/gforth.dvi doc/gforth.
.SUFFIXES:
.SUFFIXES: .c .o
all: kernel/version.fs more
# use this dependency for phony targets just as mostlyclean,...
FORCE: ;
#this rule avoids remaking everything after minor changes in Makefile.in
version: Makefile.in
if test -r $@ && test x'$(VERSION)' = x`cat $@` ; then true ; else echo $(VERSION) > $@ ; fi
# With dos we use normal dos echo
# we cannot pipe the output to engine/version.h directly because
# of the "/ and \" problem. Copying works because we use the
# shell und file utilities.
engine/version.h: version
echo "static char gforth_version[]=\"$(VERSION)\" ;" >$@
bash versions.bsh $(VERSION)
kernel/version.fs: version
$(MAKE) gforth
echo ": version-string s\" $(VERSION)\" ;" >$@
bash versions.bsh $(VERSION)
more: $(OBJECTS) $(FORTH_GEN) gforth
more: engine $(FORTH_GEN) gforth
#from the gcc Makefile:
#"Deletion of files made during compilation.
......@@ -270,7 +305,7 @@ more: $(OBJECTS) $(FORTH_GEN) gforth
# `distclean' also deletes the files made by config.
# `realclean' also deletes everything that could be regenerated automatically."
mostlyclean:
mostlyclean: FORCE
-$(RM) -rf *.s gforth.fi *.fi~ *.fi- kernel/version.fs *TAGS \
doc/crossdoc.fd doc/doc.fd doc/gforth.texi doc/gforth.fns \
doc/gforth.aux doc/gforth.cp doc/gforth.cps \
......@@ -401,7 +436,7 @@ installdirs: mkinstalldirs
#deinstall all files specific to this version of gforth
#to uninstall version foo, type `make uninstall VERSION=foo'
uninstall:
uninstall: FORCE
-$(RM) -rf $(libdir)/gforth/$(VERSION) $(datadir)/gforth/$(VERSION) $(bindir)/gforth-$(VERSION)
@echo -e "Type\n$(RM) -rf $(bindir)/gforth $(man1dir)/gforth.1 $(infodir)/gforth.info* $(datadir)/gforth $(libdir)/gforth\nto remove Gforth completely"
......@@ -419,14 +454,15 @@ bench: gforth gforth.fi
time $(FORTH) -m 160000 matrix.fs -e "main bye"
time $(FORTH) fib.fs -e "main bye"
gforth: $(OBJECTS) $(OBJECTS0)
-$(CP) gforth gforth~
$(GCC) $(LDFLAGS) $(OBJECTS) $(OBJECTS0) $(LDLIBS) -o $@
@GFORTH_EXE@
# ------------- Make forth images
gforth-ditc: $(OBJECTS_DITC) $(OBJECTS0)
$(GCC) $(LDFLAGS) $(OBJECTS_DITC) $(OBJECTS0) $(LDLIBS) -o $@
@GFORTHDITC_EXE@
# Hot to make new images:
# 1. Produce an image called kernlXYZ.fi-
# the original kernel.fi is not touched because it's needed for creation
# 2. copy old kernlXYZ.fi to kernlXYZ.fi~
# that's a backup copy in case the new kernels don't work
# 3. copy new kernels to kernlXYZ.fi
# these are the ones we want to use now
kernl16l.fi-: $(KERN_SRC) kernel/version.fs mach16l.fs $(FORTH_GEN0)
$(FORTHK) -e 's" mach16l.fs"' kernel/main.fs -e "save-cross kernl16l.fi- $(bindir)/gforth-$(VERSION) bye"
......@@ -482,37 +518,17 @@ kernl64l.fi: $(KERNLS)
# -$(CP) $@ $@~
# -$(CP) $< $@
gforth.fi: @kernel_fi@ gforthmi gforth gforth-ditc $(GFORTH_FI_SRC)
GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc -p .$(PATHSEP)$(srcdir) -i kernel.fi startup.fs" $(srcdir)/gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) startup.fs
#TAGS is a GNU standard target
TAGS: gforth.TAGS
$(CP) gforth.TAGS $@
gforth.TAGS: @kernel_fi@ gforth $(GFORTH_FI_SRC) prim.TAGS
$(FORTHK) etags.fs startup.fs -e bye
cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS
rm TAGS
engine/replace.a:
cd engine; $(MAKE) replace.a
engine.s: engine/engine.c engine/prim.i engine/prim_lab.i machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S $(srcdir)/engine/engine.c
engine/engine.o: engine/engine.c engine/prim.i engine/prim_lab.i machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c $(srcdir)/engine/engine.c -o $@
engine/engine-ditc.o: engine/engine.c engine/prim.i engine/prim_lab.i machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine/engine.c
# If we want a new kernel.fi we should use "kernel.fi:" this makes
# a link or a copy from kernl....fi to kernel.fi
# works for dos-computers, too!!
engine/main.o: engine/main.c machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h engine/version.h
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c $(srcdir)/engine/main.c
kernel.fi: @kernel_fi@
@LINK_KERNL@
engine/main-ditc.o: engine/main.c machine/machine.h engine/threaded.h $(INCLUDES) engine/config.h engine/version.h
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c $(srcdir)/engine/main.c
gforth.fi: kernel.fi gforthmi gforth gforth-ditc $(GFORTH_FI_SRC)
GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc -p .$(PATHSEP)$(srcdir) -i kernel.fi startup.fs" $(srcdir)/gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) startup.fs
engine/strtoul.o: strtoul.c strtol.c
# ------------- Make c-engine
prim.b: prim
m4 -s $(srcdir)/prim >$@
......@@ -539,6 +555,32 @@ kernel/prim.fs: prim.b prims2x.fs kernel/prim0.fs
$(CP) $@- $@
$(RM) $@-
engine: engine/prim_lab.i engine/prim.i engine/version.h FORCE
bash makein.bsh engine engine
engine_ditc: engine/prim_lab.i engine/prim.i engine/version.h FORCE
bash makein.bsh engine engine_ditc
gforth: engine
-$(CP) gforth gforth~
$(GCC) $(LDFLAGS) $(OBJECTS) $(OBJECTS0) $(LDLIBS) -o $@
@GFORTH_EXE@
gforth-ditc: engine_ditc
$(GCC) $(LDFLAGS) $(OBJECTS_DITC) $(OBJECTS0) $(LDLIBS) -o $@
@GFORTHDITC_EXE@
# ------------- Make Documentation
#TAGS is a GNU standard target
TAGS: gforth.TAGS
$(CP) gforth.TAGS $@
gforth.TAGS: @kernel_fi@ gforth $(GFORTH_FI_SRC) prim.TAGS
$(FORTHK) etags.fs startup.fs -e bye
cat TAGS prim.TAGS kernel.TAGS >gforth.TAGS
rm TAGS
prim.TAGS: prim.b prims2x.fs
$(FORTHK) prims2x.fs -e "s\" $(srcdir)/prim.b\" ' output-tag process-file bye" >$@-
$(CP) $@- $@
......@@ -603,11 +645,11 @@ config.status: configure
#create files for DOS, because DOS cannot do it itself
makefile.dos: mkdosmf.sed Makefile.in
makefile.dos: mkdosmf.sed Makefile.in engine/Makefile.in
sed -f mkdosmf.sed <Makefile.in >makefile.dos
sed -f mkdosmf.sed <engine/Makefile.in >engine/makefile.dos
makefile.os2: mkos2mf.sed Makefile.in
makefile.os2: mkos2mf.sed Makefile.in engine/Makefile.in
sed -f mkos2mf.sed <Makefile.in >makefile.os2
sed -f mkos2mf.sed <engine/Makefile.in >engine/makefile.os2
echo '%.o: %.c' >>makefile.os2
......@@ -615,10 +657,13 @@ makefile.os2: mkos2mf.sed Makefile.in
echo '%.o: %.c' >>engine/makefile.os2
echo ' $$(GCC) $$(CFLAGS) -c $$<' >>engine/makefile.os2
# Garbage:
# to be deleted!
# history is a little bit different now! JAW
#history.dos: history.fs Makefile.in
# history.dos: history.fs Makefile.in
# sed -e "s,~/\.gforth-history,/gforth.his,g" <history.fs >history.dos
startup.dos: startup.fs Makefile.in
sed -e "s/\\\\ include doskey/include doskey/g" \
-e "s/include vt100key/\\\\ include vt100key/g" <startup.fs >startup.dos
# startup.dos: startup.fs Makefile.in
# sed -e "s/\\\\ include doskey/include doskey/g" \
# -e "s/include vt100key/\\\\ include vt100key/g" <startup.fs >startup.dos
......@@ -20,7 +20,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "../../engine/32bit.h"
#include "../generic/machine.h"
/* indirect threading is faster on the 486, on the 386 direct
threading is probably faster. Therefore we leave defining
......
......@@ -34,7 +34,7 @@
#define FLUSH_ICACHE(addr,size) asm("call_pal 0x86") /* imb (instruction-memory barrier) */
#include "../../engine/32bit.h"
#include "../generic/machine.h"
#ifdef DIRECT_THREADED
#ifdef WORDS_BIGENDIAN
......
......@@ -45,7 +45,7 @@ extern void cacheflush(void *, int, int);
cacheflush((void *)(addr), (int)(size), 32)
#endif
#include "../../engine/32bit.h"
#include "../generic/machine.h"
#ifdef DIRECT_THREADED
/* PFA gives the parameter field address corresponding to a cfa */
......
......@@ -35,7 +35,7 @@
#define AUTO_INCREMENT
#include "../../engine/32bit.h"
#include "../generic/machine.h"
/* Clearing the whole cache is a bit drastic, but this is the only
* cache control available on the apollo and NeXT
......
......@@ -29,7 +29,7 @@
#endif
#endif
#include "../../engine/32bit.h"
#include "../generic/machine.h"
/* cache flush stuff */
#warning If you get assembly errors, here is the reason why
......
......@@ -19,7 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "../../engine/32bit.h"
#include "../generic/machine.h"
#if !defined(USE_TOS) && !defined(USE_NO_TOS)
#define USE_TOS
......
......@@ -25,23 +25,18 @@ IF "%1"=="--enable-indirect-threaded" set THREAD=i
IF "%1"=="--enable-force-reg" set FREGS=y
shift
IF NOT "%1"=="" GOTO SWITCHES
MD MACHINE
COPY engine\MAKEFILE.DOS engine\MAKEFILE
COPY MAKEFILE.DOS MAKEFILE
COPY KERNL32L.FI KERNEL.FI
COPY ARCH\386\MACHINE.H MACHINE\MACHINE.H
COPY DOSCONF.H CSRC\CONFIG.H
COPY STARTUP.FS STARTUP.UNX
COPY STARTUP.DOS STARTUP.FS
COPY HISTORY.DOS HISTORY.FS
IF "%THREAD%"=="i" ECHO #ifndef INDIRECT_THREADED >>CSRC\CONFIG.H
IF "%THREAD%"=="i" ECHO #define INDIRECT_THREADED 1 >>CSRC\CONFIG.H
IF "%THREAD%"=="i" ECHO #endif >>CSRC\CONFIG.H
IF "%THREAD%"=="d" ECHO #ifndef DIRECT_THREADED >>CSRC\CONFIG.H
IF "%THREAD%"=="d" ECHO #define DIRECT_THREADED 1 >>CSRC\CONFIG.H
IF "%THREAD%"=="d" ECHO #endif >>CSRC\CONFIG.H
IF "%FREGS%"=="y" ECHO #ifndef FORCE_REG >>CSRC\CONFIG.H
IF "%FREGS%"=="y" ECHO #define FORCE_REG 1 >>CSRC\CONFIG.H
IF "%FREGS%"=="y" ECHO #endif >>CSRC\CONFIG.H
ECHO static char gforth_version[]="0.3.0"; >version.h1
ECHO : version-string s" 0.3.0" ; >version.fs1

\ No newline at end of file
COPY DOSCONF.H ENGINE\CONFIG.H
COPY ENVOS.FS ENVOS.UNX
COPY ENVOS.DOS ENVOS.FS
IF "%THREAD%"=="i" ECHO #ifndef INDIRECT_THREADED >>ENGINE\CONFIG.H
IF "%THREAD%"=="i" ECHO #define INDIRECT_THREADED 1 >>ENGINE\CONFIG.H
IF "%THREAD%"=="i" ECHO #endif >>ENGINE\CONFIG.H
IF "%THREAD%"=="d" ECHO #ifndef DIRECT_THREADED >>ENGINE\CONFIG.H
IF "%THREAD%"=="d" ECHO #define DIRECT_THREADED 1 >>ENGINE\CONFIG.H
IF "%THREAD%"=="d" ECHO #endif >>ENGINE\CONFIG.H
IF "%FREGS%"=="y" ECHO #ifndef FORCE_REG >>ENGINE\CONFIG.H
IF "%FREGS%"=="y" ECHO #define FORCE_REG 1 >>ENGINE\CONFIG.H
IF "%FREGS%"=="y" ECHO #endif >>ENGINE\CONFIG.H
......@@ -276,7 +276,8 @@ AC_CHECK_FUNCS(mmap sysconf getpagesize)
kernel_fi=kernl${wordsize}${bytesex}.fi
AC_SUBST(kernel_fi)
AC_LINK_FILES(arch/${mach_h} $kernel_fi,machine kernel.fi)
AC_SUBST(mach_h)
AC_LINK_FILES($kernel_fi,kernel.fi)
AC_OUTPUT([
Makefile
engine/Makefile ],echo timestamp > stamp-h)
......
......@@ -18,6 +18,8 @@
#along with this program; if not, write to the Free Software
#Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
machine = @mach_h@
SHELL = /bin/sh
RM = rm
RMTREE = rm -rf
......@@ -26,20 +28,51 @@ TAR = tar cf -
GCC = @CC@
CC = $(GCC)
STRIP = strip
XCFLAGS = @CFLAGS@
XDEFINES = @DEFS@
SWITCHES = $(XCFLAGS) $(XDEFINES)
ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves
DEBUGFLAG = @DEBUGFLAG@
CFLAGS = $(DEBUGFLAG) -I$(srcdir) -O4 -Wall $(SWITCHES)
CFLAGS = $(DEBUGFLAG) -I../arch/$(machine) -O4 -Wall $(SWITCHES) -DDEFAULTPATH=\"$(FORTHPATH)\"
AOBJECTS = io.o memcmpc.o @LIBOBJS@ @getopt_long@
OBJECTS = io.o memcmpc.o @LIBOBJS@ @getopt_long@
OBJECTS0 = replace.a
OBJECTS = engine.o main.o
OBJECTS_DITC = engine-ditc.o main-ditc.o
# In engine subdirectory there are (or should be) only files that belong to
# our engine, so we can make life easy
ENGINE_DEPS = *.c *.h *.i ../arch/$(machine)/*
all: replace.a
replace.a: $(OBJECTS)
ar r $@ $(OBJECTS)
replace.a: $(AOBJECTS)
ar r $@ $(AOBJECTS)
engine.s: $(ENGINE_DEPS)
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S engine.c
engine.o: $(ENGINE_DEPS)
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c engine.c -o $@
engine-ditc.o: $(ENGINE_DEPS)
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c engine.c
main.o: $(ENGINE_DEPS)
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -o $@ -c main.c
main-ditc.o: $(ENGINE_DEPS)
$(GCC) $(CFLAGS) $(ENGINE_FLAGS) -DDOUBLY_INDIRECT -o $@ -c main.c
engine: $(OBJECTS) $(OBJECTS0) ;
engine_ditc: $(OBJECTS_DITC) $(OBJECTS0) ;
#NeXTstep hack
termios.o: /usr/lib/libposix.a
ar x /usr/lib/libposix.a termios.o
\ No newline at end of file
ar x /usr/lib/libposix.a termios.o
/* cache flushing for the HP-PA architecture
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of Gforth.
Gforth is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
void cacheflush(void * address, int size, int linewidth)
{
int i;
address=(void *)((int)address & (-linewidth));
for(i=1-linewidth; i<size; i+=linewidth)
asm volatile("fdc (%0)\n\t"
"sync\n\t"
"fic,m %1(%0)\n\t"
"sync" : : "r" (address), "r" (linewidth) : "memory" );
}
......@@ -53,7 +53,7 @@ typedef void *Label;
/* the size of the DOESJUMP, which resides between DOES> and the does-code */
#define DOES_HANDLER_SIZE (2*sizeof(Cell))
#include "../machine/machine.h"
#include "machine.h"
/* Forth data types */
/* Cell and UCell must be the same size as a pointer */
......
......@@ -194,10 +194,10 @@ Address verbose_malloc(Cell size)
Address my_alloc(Cell size)
{
#if HAVE_MMAP
static Address next_address=0;
Address r;
#if HAVE_MMAP
#if defined(MAP_ANON)
if (debug)
fprintf(stderr,"try mmap($%lx, $%lx, ..., MAP_ANON, ...); ", (long)next_address, (long)size);
......@@ -292,7 +292,7 @@ Address loader(FILE *imagefile, char* filename)
)
{ fprintf(stderr,"This image is %d bit %s-endian, whereas the machine is %d bit %s-endian.\n",
((magic[7]-'0')&~1)*8, endianstring[magic[7]&1],
sizeof(Cell)*8, endianstring[
(int) sizeof(Cell)*8, endianstring[
#ifdef WORDS_BIGENDIAN
0
#else
......@@ -327,7 +327,7 @@ Address loader(FILE *imagefile, char* filename)
pagesize=PAGESIZE; /* in limits.h according to Gallmeister's POSIX.4 book */
#endif
if (debug)
fprintf(stderr,"pagesize=%d\n",pagesize);
fprintf(stderr,"pagesize=%ld\n",(unsigned long) pagesize);
image = dict_alloc(preamblesize+dictsize+data_offset)+data_offset;
rewind(imagefile); /* fseek(imagefile,0L,SEEK_SET); */
......
\ envos.fs set os-specific environmental queries 07jul97jaw
get-current environment-wordlist set-current
: os-class s" dos" ;
set-current
\ envos.fs set os-specific environmental queries 07jul97jaw
get-current environment-wordlist set-current
: os-class s" unix" ;
set-current
\ envos.fs set os-specific environmental queries 07jul97jaw
get-current environment-wordlist set-current
: os-class s" os2" ;
set-current
......@@ -71,17 +71,32 @@ interpret/compile: ctrl ( "<char>" -- ctrl-code )
history file-size throw
2dup forward^ 2! 2dup backward^ 2! end^ 2! ;
s" GFORTHHIST" getenv dup 0= [IF]
2drop s" ~/.gforth-history"
[THEN] get-history
s" os-class" environment? [IF] s" unix" compare 0= [ELSE] true [THEN]
[IF]
: history-cold
Defers 'cold
s" GFORTHHIST" getenv dup 0= IF
2drop s" ~/.gforth-history"
THEN get-history ;
[ELSE]
: history-dir
s" TMP" getenv ?dup ?EXIT drop
s" TEMP" getenv ?dup ?EXIT drop
s" c:/" ;
: history-file
s" GFORTHHIST" getenv ?dup ?EXIT
drop
history-dir pad place
s" /ghist.txt" pad +place pad count ;
: history-cold
history-file
get-history ;
[THEN]
' history-cold IS 'cold
' history-cold INIT8 chained
history-cold
\ moving in history file 16oct94py
......
cd $1
make $2
s%/bin/sh%command.com%g
s% rm% del%g
s% cp% copy%g
s% ln -s% copy%g
# We use the bash and shell and file utilities with dos
s%SHELL%# SHELL%g
# s% rm% del%g
# s% cp% copy%g
s% ln -s% cp%g
s%@mach_h@%386%g
s%-pipe %%g
s% ./gforth% gforth%g
s%io.o %%g
......@@ -31,8 +34,8 @@ s%@srcdir@%.%g
s%@LINK_KERNL@%-$(CP) kernl32l.fi kernel.fi%g
s%@PATHSEP@%;%g
s%-fforce-mem -fforce-addr %%g
s%echo "static char gforth_version.*;" >$@%$(CP) version.h1 engine\version.h%g
s%echo ": version-string.*;" >$@%$(CP) version.fs1 kernel\version.fs%g
# s%echo "static char gforth_version.*;" >$@%$(CP) version.h1 engine\version.h%g
# s%echo ": version-string.*;" >$@%$(CP) version.fs1 kernel\version.fs%g
s%$(srcdir)/config.h.in: stamp-h.in%#$(srcdir)/config.h.in: stamp-h.in%g
s%engine/config.h: stamp-h%#engine/config.h: stamp-h%g
s%$(FORTHPATH)$(PATHSEP)%%g
......@@ -40,8 +43,9 @@ s%@FORTHSIZES@%%g
s%test x'$(VERSION)' = x`cat $@` || %%g
s%--clear-dictionary%-c%g
s%.$(PATHSEP)$(srcdir)%.%g
s% -I$(srcdir)%%g
# s% -I$(srcdir)%%g
s%GFORTHD="./gforth-ditc -p .* $(srcdir)/%%g
s%gforth-ditc%gforth-d%g
s%engine-ditc%engine-d%g
s%main-ditc%main-d%g
s%@OSCLASS@%dos%g
......@@ -54,8 +54,8 @@ s%@getopt_long@%getopt.o getopt1.o%g
s%@kernel_fi@%kernl32l.fi%g
s%@PATHSEP@%;%g
s%-fforce-mem -fforce-addr %%g
s%echo "static char gforth_version.*;" >$@%$(CP) version.h1 engine\version.h%g
s%echo ": version-string.*;" >$@%$(CP) version.fs1 kernel\version.fs%g
# s%echo "static char gforth_version.*;" >$@%$(CP) version.h1 engine\version.h%g
# s%echo ": version-string.*;" >$@%$(CP) version.fs1 kernel\version.fs%g
s%$(srcdir)/config.h.in: stamp-h.in%#$(srcdir)/config.h.in: stamp-h.in%g
s%engine/config.h: stamp-h%#engine/config.h: stamp-h%g
s%$(FORTHPATH)$(PATHSEP)%%g
......@@ -65,3 +65,4 @@ s%test x'$(VERSION)' = x`cat $@` || %%g
s%GFORTHD="./gforth-ditc -p .* $(srcdir)/%%g
s%'s"%"s\\"%g
s%"'%\\""%g
s%@OSCLASS@%dos%g
......@@ -21,6 +21,7 @@
warnings off
include search.fs
include environ.fs
include envos.fs
include errors.fs
include extend.fs \ load core-extended
include hash.fs
......@@ -38,8 +39,12 @@ include bufio.fs
include debug.fs
require stuff.fs
include history.fs
\ include doskey.fs
s" os-class" environment? dup [IF] drop s" dos" compare 0= [THEN]
[IF]
include doskey.fs
[ELSE]
include vt100key.fs
[THEN]
require debugs.fs
require assert.fs
require blocks.fs
......@@ -74,8 +79,6 @@ true constant string
true constant string-ext
set-current
warnings on
require siteinit.fs
echo "static char gforth_version[]=\"$1\" ;" > engine/version.h
echo ": version-string s\" $1\" ;" > kernel/version.fs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment