Skip to content

Commit

Permalink
Migrate tests and beta release names from cvs/RCS to git.
Browse files Browse the repository at this point in the history
Reorganisation of 16/32/64 bit selection, in behalf of win 64.
  • Loading branch information
albertvanderhorst committed Jan 17, 2017
1 parent 2716f2d commit 1d9d14a
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 69 deletions.
28 changes: 10 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ ci86.lina.labtest \
# That's all folks!

# 4.0 ### Version : an official release 4.0
# Left out : beta, revision number is taken from rcs e.g. 3.154
# Normally VERSION is passed via the command line.
VERSION=test
DATE=2030 # To get the newest version
# Left out : beta, revision number is taken from current date.
# For a release VERSION is passed via the command line as e.g. 5.3
VERSION=`date +%Y%b%d`
# M4_DEBUG=--debug=V # deperado debugging.

RELEASELINA32 = \
Expand Down Expand Up @@ -219,21 +218,25 @@ $(EXAMPLESRC) \
#ci86.lina64.fas \
# That's all folks!

VERSION:;echo 'define({M4_VERSION},{'${VERSION}'})' >VERSION

TEMPFILE=/tmp/ciforthscratch

# How to generate a Forth executable.
%: %.frt ; $(FORTH) -c $^

# Define NASM as *the* assembler generating bin files.
%.bin:%.asm
nasm -fbin $< -o $@ -l $*.lst
%.bin:%.asm ; nasm -fbin $< -o $@ -l $*.lst

# Define fasm as an alternative for generating bin files.
%:%.fas ; fasm $< -m256000

#%.exe: ci86.%.fas ; fasm $+ -m256000

# mina.cfg and alone.cfg are present (at least via RCS)
# allow to generate ci86.mina.bin etc.
ci86.%.rawdoc ci86.%.rawtest : ci86.%.asm ;

VERSION : ; echo 'define({M4_VERSION},$(VERSION))' >VERSION

ci86.%.asm : %.cfg VERSION nasm.m4 ci86.gnr
cat $+ | $(M4) $(M4_DEBUG) - > $(TEMPFILE)
Expand Down Expand Up @@ -289,9 +292,6 @@ lina64: ci86.lina64.fas ; fasm $+ -m256000; mv ${<:.fas=} $@
lina: glina64 ; $< -g 8000 $@
wina.exe: ci86.wina.fas ; fasm $+ -m256000 ; mv ${<:.fas=}.exe $@

# Put include type of dependancies here
$(TARGETS:%=%.cfg) : $(INGREDIENTS) ; if [ -f $@ ] ; then touch $@ ; else cvs update $@ ; fi

# Some of these targets make no sense and will fail
all: $(TARGETS:%=ci86.%.asm) $(TARGETS:%=ci86.%.msm) $(BINTARGETS:%=ci86.%.bin) \
$(LINUXFORTHS) $(OTHERTARGETS)
Expand All @@ -306,14 +306,6 @@ cleanall: clean testclean ; \
rm -f *.aux *.log *.ps *.toc *.pdf ; \
rm -f *.zip *gz

# FIXME, RCS is now in use.
# Until then this target must not be used.
RCSCLEAN: ;\
ln -s $(CVSROOT)/ciforth RCS
ln -f Makefile makefile
rcsclean
rm RCS

release : strip zip msdos32.zip msdos.zip lina.zip

#Install it. To be run as root
Expand Down
69 changes: 34 additions & 35 deletions ci86.gnr
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,14 @@ _ENDCOMMENT
_C{ ########################################################################################}
_C{ PREPARATION (no code)}
_C{ ########################################################################################}
dnl It doesn't make sense to have duplicate code for 16/32/64 bits
dnl where m4 can handle it this easily.
dnl 16 bits was default for the startup code, now overrule.
dnl 16 bits is default for the boot code.
_BITS16_({include(width16.m4)})
_BITS32_({include(width32.m4)},{dnl})
_BITS64_({include(width64.m4)},{dnl})


FIGREL EQU 5 _C{ FIG RELEASE #}
FIGREV EQU 0 _C{ FIG REVISION #}
Expand Down Expand Up @@ -365,31 +371,31 @@ _C
dd 0,0,0,0,0

kernel_table:
_ExitProcess@4 dd rva _ExitProcess
CreateFile dd rva _CreateFileA
_CreateProcessA@40 dd rva _CreateProcess
_ReadFile@20 dd rva _ReadFile
_WriteFile@20 dd rva _WriteFile
CloseHandle dd rva _CloseHandle
SetFilePointer dd rva _SetFilePointer
_GetCommandLineA@0 dd rva _GetCommandLineA
GetEnvironmentVariable dd rva _GetEnvironmentVariable
_DeleteFileA@4 dd rva _DeleteFileA
_GetConsoleMode@8 dd rva _GetConsoleMode
_GetProcAddress@8 dd rva _GetProcAddress
_GetStdHandle@4 dd rva _GetStdHandle
_LoadLibraryA@4 dd rva _LoadLibraryA
_GetLastError@0 dd rva _GetLastError
_PeekConsoleInputA@16 dd rva _PeekConsoleInputA
_ReadConsoleA@20 dd rva _ReadConsoleA
GetTickCount dd rva _GetTickCount
GetSystemTime dd rva _GetSystemTime
GlobalMemoryStatus dd rva _GlobalMemoryStatus
_SetConsoleMode@8 dd rva _SetConsoleMode
_Sleep@4 dd rva _Sleep
dd 0

kernel_name db 'KERNEL32.DLL',0
_ExitProcess@4 DC rva _ExitProcess
CreateFile DC rva _CreateFileA
_CreateProcessA@40 DC rva _CreateProcess
_ReadFile@20 DC rva _ReadFile
_WriteFile@20 DC rva _WriteFile
CloseHandle DC rva _CloseHandle
SetFilePointer DC rva _SetFilePointer
_GetCommandLineA@0 DC rva _GetCommandLineA
GetEnvironmentVariable DC rva _GetEnvironmentVariable
_DeleteFileA@4 DC rva _DeleteFileA
_GetConsoleMode@8 DC rva _GetConsoleMode
_GetProcAddress@8 DC rva _GetProcAddress
_GetStdHandle@4 DC rva _GetStdHandle
_LoadLibraryA@4 DC rva _LoadLibraryA
_GetLastError@0 DC rva _GetLastError
_PeekConsoleInputA@16 DC rva _PeekConsoleInputA
_ReadConsoleA@20 DC rva _ReadConsoleA
GetTickCount DC rva _GetTickCount
GetSystemTime DC rva _GetSystemTime
GlobalMemoryStatus DC rva _GlobalMemoryStatus
_SetConsoleMode@8 DC rva _SetConsoleMode
_Sleep@4 DC rva _Sleep
DC 0

kernel_name db _BITS64_({'KERNEL32.DLL'})_BITS32_({'KERNEL32.DLL'}),0

_ExitProcess dw 0
db 'ExitProcess',0
Expand Down Expand Up @@ -1124,13 +1130,6 @@ ENDDPMI:
_C{ ######################### DPMI END ###############################################################}
})_C{}_END_({_HOSTED_DPMI_})

dnl It doesn't make sense to have duplicate code for 16/32/64 bits
dnl where m4 can handle it this easily.
dnl 16 bits was default for the startup code, now overrule.
_BITS32_({SET_32_BIT_MODE _C Assembler directive},{dnl})
_BITS32_({include(width32.m4)},{dnl})
_BITS64_({SET_64_BIT_MODE _C Assembler directive},{dnl})
_BITS64_({include(width64.m4)},{dnl})

_SWITCH_({
CLI _C{ Wait for stacks to be setup.}
Expand Down Expand Up @@ -1672,7 +1671,7 @@ _REAL_({
_C
_C{ If M4_VERSION exists and contains a . it is an official release}
define({M4_VERSION2}, ifelse( index(M4_VERSION,.), -1,
{{{beta $RCSfile$ $Revision$}}},
{beta M4_VERSION},
M4_VERSION))dnl
_C
worddoc({ENVIRONMENTS},{VERSION},{version}, {--- sc},{CI},
Expand Down Expand Up @@ -8783,7 +8782,7 @@ _C
worddoc( {INPUT},{SET-MODE},{set_mode},{u --- },{},
{Set the mode of standard input to forthvar({u}), as defined
in MS-WINDOWS forthemph({GetConsoleMode}) function from
forthemph({KERNEL32.DLL}).
forthemph({_BITS64_({KERNEL32.DLL})_BITS32_({KERNEL32.DLL})})
},
{{GET-MODE},{KEY?}}, {}, enddoc)
_HEADER({SET-MODE},{SETMODE},{DOCOL})
Expand All @@ -8795,7 +8794,7 @@ _C
worddoc( {INPUT},{GET-MODE},{get_mode},{ --- u },{},
{Get the mode of standard input to forthvar({u}), as defined
in MS-WINDOWS forthemph({GetConsoleMode}) function from
forthemph({KERNEL32.DLL}).
forthemph({_BITS64_({KERNEL32.DLL})_BITS32_({KERNEL32.DLL})}).
},
{{SET-MODE},{KEY?}}, {}, enddoc)
_C
Expand Down
4 changes: 2 additions & 2 deletions fasm.m4
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ define({_HEADER_ASM},{;
_DLL_(
{; fasm forth.asm forth
; fasm generates executable, no separate linking.
FORMAT PE console
_BITS32_({FORMAT PE console})_BITS64_({ FORMAT PE64 console})
;
INCLUDE 'include/win32a.inc' ; ASCII windows definitions.
INCLUDE _BITS32_({'include/win32a.inc'})_BITS64_({'include/win64a.inc'}) ; ASCII windows definitions.
define({_BSS_},{})dnl
define({_TEXT_}, { section '.text' code executable readable writable})dnl
})_C{}_END_({ _DLL_})
Expand Down
12 changes: 9 additions & 3 deletions howto.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ How to create a distribution :
make clean
rm VERSION


AN OFFICIAL RELEASE IS GENERATED BY PASSING A VERSION MACRO
WITH A DECIMAL POINT TO make.

Other VERSION or no VERSION means it is a beta.

Release generic version, official
make zip VERSION=4.0
Result in ciforth-4.0.tar.gz
Expand All @@ -71,12 +77,12 @@ How to create a distribution :
Result in ciforth-3d286.tar.gz (not yet)
Or use $V.

Release Linux version, official
make lina.zip VERSION=4.0
Release Linux version, official (same for LINA64ZIP)
make LINA32ZIP VERSION=4.0
Result in lina-4.0.tar.gz

Release Linux version, beta
make lina.zip VERSION=3d286
make LINA32ZIP VERSION=3d286
Result in lina-3d286.tar.gz
Or use $V.

Expand Down
6 changes: 6 additions & 0 deletions logforth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14053,6 +14053,12 @@ The tests that compare against a version in the cvs archive are
akward. Introduced testcmp subdirectory to contain those files.
Marked everything as LASTCVS

2017 jan 14
Even testwina works, however a symbolic link must be made to
the include directory from fasm. An exciting possibility is to use
the include directory from fasmw. That may make a 64 bit version of
wina work.

-
Greg Egan
Schild's ladder.
Expand Down
5 changes: 1 addition & 4 deletions setenv
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ O=/mnt/dosc/dfw/tforth/test/system/okay
DATE='"2010/04/05 15:00:00"'
export b c d x C f p l a A s t R O FD I M DATE pat
export CVSROOT=:pserver:albert@sparc:/usr/local/cvsroot
unalias cvs
alias cvs='cvs -d$CVSROOT'
cvs -d$CVSROOT login
V=`cvs log -r $f | grep -w revision| sed -e 's/revision /beta-/'`
V='2017jan15'
10 changes: 5 additions & 5 deletions test.mak
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ testlina32 : $(TESTLINA32) ci86.lina32.rawtest lina32 forth.lab.lina tsuite.frt
m4 $(TESTLINA32) >$(TEMPFILE)
sed $(TEMPFILE) -e '/Split here for test/,$$d' >$@.1
sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2
./lina32 <$@.1 2>&1| grep -v RCSfile >$@.3
./lina32 <$@.1 2>&1| grep -v beta >$@.3
diff -b -B $@.2 $@.3 || true
ln -sf forth.lab.lina forth.lab
./lina32 -a <tsuite.frt 2>&1 |cat >tsuite32.out
Expand All @@ -209,7 +209,7 @@ testlina64 : $(TESTLINA64) ci86.lina64.rawtest lina64 forth.lab.lina tsuite.frt
m4 $(TESTLINA64) >$(TEMPFILE)
sed $(TEMPFILE) -e '/Split here for test/,$$d' >$@.1
sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2
./lina64 <$@.1 2>&1| grep -v RCSfile >$@.3
./lina64 <$@.1 2>&1| grep -v beta >$@.3
diff -b -B $@.2 $@.3 || true
ln -sf forth.lab.lina forth.lab
./lina64 -a <tsuite.frt 2>&1 |cat >tsuite64.out
Expand All @@ -228,7 +228,7 @@ testwina : ci86.wina.rawtest test.m4 wina.exe forth.lab.wina tsuite.frt ;
sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2
rm $(TEMPFILE)
wine wina.exe <$@.1 2>&1|\
grep -v RCSfile |\
grep -v beta |\
sed -e 's/.*wina.exe/wina.exe/' >$@.3
diff -b -B $@.2 $@.3 || true
cp -f forth.lab.wina forth.lab
Expand All @@ -246,7 +246,7 @@ testlina64.tar : $(TESTLINA64) ci86.lina64.rawtest ci86.lina64.fas forth.lab.lin
m4 $(TESTLINA64) >$(TEMPFILE)
sed $(TEMPFILE) -e '/Split here for test/,$$d' >testlina64.1
sed $(TEMPFILE) -e '1,/Split here for test/d' >testlina64.2
echo "lina64 <testlina64.1 2>&1| grep -v RCSfile >testlina64.3 ">>testlina64
echo "lina64 <testlina64.1 2>&1| grep -v beta >testlina64.3 ">>testlina64
echo "diff -b -B testlina64.2 testlina64.3 || true ">>testlina64
echo "lina64 -a <tsuite.frt 2>&1 |cat >tsuite.tmp ">>testlina64
echo "diff -bBw tsuite.tmp tsuite64.out || true ">>testlina64
Expand All @@ -258,7 +258,7 @@ testlinux : $(TESTLINUX) ci86.linux.rawtest ciforthc forth.lab ;
m4 $(TESTLINUX) >$(TEMPFILE)
sed $(TEMPFILE) -e '/Split here for test/,$$d' >$@.1
sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2
ciforthc <$@.1 | grep -v RCSfile >$@.3
ciforthc <$@.1 | grep -v beta >$@.3
diff -b -B $@.2 $@.3 || true
rm $(TEMPFILE)

Expand Down
3 changes: 2 additions & 1 deletion toblock.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* $Id$ */
/* Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License */
/* Copyright(2017): Albert van der Horst, HCC FIG Holland by GNU Public License */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define CPL 64
Expand Down
4 changes: 3 additions & 1 deletion width32.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
dnl $Id$ M4 file to handle the develish FIG headers.
dnl Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License
dnl Copyright(2017): Albert van der Horst, HCC FIG Holland by GNU Public License
dnl None of the following makes sense unless 32 bit mode
SET_32_BIT_MODE _C Assembler directive
divert(-1)
define({CELL_M4},LONG)dnl
define({CWORD},{DWORD})dnl
Expand Down
2 changes: 2 additions & 0 deletions width64.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
dnl $Id$ M4 file to handle the develish FIG headers.
dnl Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License
dnl None of the following makes sense unless 64 bit mode
SET_64_BIT_MODE _C Assembler directive
divert(-1)
define({CELL_M4},{QUAD})dnl
define({CWORD},{QWORD})dnl
Expand Down

0 comments on commit 1d9d14a

Please sign in to comment.