some work on the build script

FossilOrigin-Name: 2ecf7b2f3b4412f124e3fb1c7a3ab8c7845b3e7ab1f3b82d8b19ee6d2ecc8792
This commit is contained in:
crc 2018-02-02 20:21:45 +00:00
parent cfd66b5ef9
commit b793fd334e
4 changed files with 62 additions and 46 deletions

28
NOTES Normal file
View file

@ -0,0 +1,28 @@
Version numbering:
12.YYYY.MM
Since all current builds are 12, I only specify the YYYY.MM part.
=======================================================================
For 2018.3 I'm focusing on:
- cleaning up the build scripts
- cleaning up the source tree
- making it easier to package / install
- setting the stage for the return of a standalone RETRO system
- general bug fixes
- documentation improvements
=======================================================================
I think I may move to a longer (2 month) release cycle. This will give
more time to refine things and reduce maintenance headaches for
packaging.
So releases in 2018 should be:
1 / 3 / 5 / 7 / 9 / 11
I expect to make releases near the end of the month.

View file

@ -16,7 +16,7 @@ adapt to various uses.
## Quick Start
For FreeBSD, macOS, Linux:
For FreeBSD, NetBSD, macOS, Linux:
./build
@ -36,8 +36,8 @@ and deploy.
This is a basic `read-evaluate-print-loop` for interactive use. It's
intended for quick tests and as an easy starting point for new interfaces.
The `repl` interface requires the RETRO image (`ngaImage`) in the current
working directory to operate.
The `repl` interface looks for the RETRO image (`ngaImage`) in the current
working. If not found, this will use an embedded copy.
listener

View file

@ -1,58 +1,50 @@
#!/bin/sh
echo Remove Old Binaries
rm -f bin/unu
rm -f bin/rre
rm -f bin/embedimage
rm -f bin/repl
rm -f bin/extend
rm -f bin/muri
cd tools
cc -O3 -c embedimage.c -o embedimage.o
cc -O3 -c extend.c -o extend.o
cc -O3 -c unu.c -o unu.o
cc -O3 -c muri.c -o muri.o
cc unu.o -lm -o unu
cc muri.o -lm -o muri
cc embedimage.o -lm -o embedimage
cc extend.o -lm -o extend
mv embedimage ../bin
mv extend ../bin
mv unu ../bin
mv muri ../bin
rm *.o
cd ..
echo Build Toolchain
cc tools/embedimage.c -o bin/embedimage
cc tools/extend.c -o bin/extend
cc tools/unu.c -o bin/unu
cc tools/muri.c -o bin/muri
echo Updating Sources
./bin/unu literate/Unu.md >tools/unu.c
./bin/unu literate/Muri.md >tools/muri.c
echo Assemble ngaImage
./bin/muri literate/Rx.md
./bin/extend literate/RetroForth.md
cp ngaImage interfaces/ri
cd interfaces/ri
../../bin/embedimage > image.c
cp image.c ..
rm ngaImage
cd ../..
echo Prepare Image for Embedding [repl, ri]
./bin/embedimage > interfaces/image.c
cp ngaImage interfaces
echo Prepare Extended Image for Embedding [rre/unix]
cp ngaImage cleanImage
./bin/extend interfaces/rre.forth
./bin/embedimage >interfaces/rre_image_unix.c
mv cleanImage ngaImage
echo Prepare Extended Image for Embedding [rre/windows]
cp ngaImage cleanImage
./bin/extend interfaces/rre_windows.forth
./bin/embedimage >interfaces/rre_image_windows.c
mv cleanImage ngaImage
echo Compile repl
cd interfaces
../bin/extend rre_windows.forth
../bin/embedimage > rre_image_windows.c
rm ngaImage
cc -O3 repl.c -o ../bin/repl
cd ..
cp ngaImage interfaces
echo Compile rre/unix
cd interfaces
../bin/extend rre.forth
../bin/embedimage > rre_image_unix.c
rm ngaImage
cc -O3 -c rre.c -o rre.o
cc -O3 -c repl.c -o repl.o
cc rre.o -lm -o rre
cc repl.o -o repl
mv rre ../bin
mv repl ../bin
rm *.o
cc -O3 -lm rre.c -o ../bin/rre
cd ..
echo "Update Glossary"

View file

@ -118,24 +118,20 @@ int include_file(char *fname) {
void stats() {
update_rx();
printf(" Heap @ %d\n", Heap);
printf("-> Image Size: %d\n", Heap);
}
int main(int argc, char **argv) {
int tokens;
FILE *fp;
printf("RETRO12\n");
printf("+ initialize\n");
ngaPrepare();
printf("+ load image\n");
ngaLoadImage("ngaImage");
stats();
dump_stack();
printf("+ load %s\n", argv[1]);
printf("-> Process code from %s\n", argv[1]);
tokens = include_file(argv[1]);
printf(" processed %d tokens\n", tokens);
printf(" %d tokens\n", tokens);
stats();
printf("+ save new image\n");
if ((fp = fopen("ngaImage", "wb")) == NULL) {
printf("Unable to save the ngaImage!\n");
exit(2);