change image extend to allow specification of image file

FossilOrigin-Name: 32644c0d15a6d130620dc4d3078dc88c7980aca9f7c27e055ebdd83f604f6451
This commit is contained in:
crc 2019-01-10 18:18:27 +00:00
parent a0f8716a7c
commit 45bec1c58b
3 changed files with 23 additions and 31 deletions

View file

@ -104,29 +104,29 @@ bin/retro-repl: interfaces/repl.c interfaces/image.c
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro-repl repl.c
bin/retro-ri: interfaces/ri.c interfaces/image.c interfaces/io_filesystem.c interfaces/io_filesystem.forth interfaces/io_floatingpoint.c interfaces/io_floatingpoint.forth
cp ngaImage cleanImage
./bin/retro-extend interfaces/io_filesystem.forth
./bin/retro-extend interfaces/io_floatingpoint.forth
./bin/retro-embedimage >interfaces/ri_image.c
mv cleanImage ngaImage
cp ngaImage ri.image
./bin/retro-extend ri.image interfaces/io_filesystem.forth
./bin/retro-extend ri.image interfaces/io_floatingpoint.forth
./bin/retro-embedimage ri.image >interfaces/ri_image.c
rm ri.image
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro-ri $(LIBCURSES) $(LIBM) io_filesystem.c io_floatingpoint.c ri.c
bin/retro: bin/retro-embedimage bin/retro-extend interfaces/image.c interfaces/rre.c interfaces/rre.forth interfaces/io_filesystem.c interfaces/io_filesystem.forth interfaces/io_gopher.c interfaces/io_gopher.forth interfaces/io_floatingpoint.c interfaces/io_floatingpoint.forth interfaces/io_unix_syscalls.c interfaces/io_unix_syscalls.forth
cp ngaImage cleanImage
./bin/retro-extend interfaces/io_filesystem.forth
./bin/retro-extend interfaces/io_gopher.forth
./bin/retro-extend interfaces/io_floatingpoint.forth
./bin/retro-extend interfaces/io_unix_syscalls.forth
./bin/retro-extend interfaces/rre.forth
./bin/retro-embedimage >interfaces/rre_image.c
mv cleanImage ngaImage
cp ngaImage rre.image
./bin/retro-extend rre.image interfaces/io_filesystem.forth
./bin/retro-extend rre.image interfaces/io_gopher.forth
./bin/retro-extend rre.image interfaces/io_floatingpoint.forth
./bin/retro-extend rre.image interfaces/io_unix_syscalls.forth
./bin/retro-extend rre.image interfaces/rre.forth
./bin/retro-embedimage rre.image >interfaces/rre_image.c
rm rre.image
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro $(LIBM) io_filesystem.c io_gopher.c io_floatingpoint.c io_unix_syscalls.c rre.c
bin/retro-barebones: bin/retro-embedimage bin/retro-extend interfaces/image.c interfaces/barebones.c interfaces/barebones.forth
cp ngaImage cleanImage
./bin/retro-extend interfaces/barebones.forth
./bin/retro-embedimage >interfaces/barebones_image.c
mv cleanImage ngaImage
cp ngaImage barebones.image
./bin/retro-extend barebones.image interfaces/barebones.forth
./bin/retro-embedimage barebones.image >interfaces/barebones_image.c
rm barebones.image
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro-barebones barebones.c
bin/retro-unu: tools/unu.c
@ -139,5 +139,5 @@ doc/Glossary.txt: bin/retro words.tsv
interfaces/image.c: bin/retro-embedimage bin/retro-extend bin/retro-muri literate/RetroForth.md literate/Rx.md
./bin/retro-muri literate/Rx.md
./bin/retro-extend literate/RetroForth.md
./bin/retro-embedimage > interfaces/image.c
./bin/retro-extend ngaImage literate/RetroForth.md
./bin/retro-embedimage ngaImage > interfaces/image.c

View file

@ -25,11 +25,7 @@ errors by doing:
make -kis
If you are building an an older Linux system and are running
into problems, try using the `build.sh` script:
sh build.sh
Or the alternate `Makefile.linux`:
into problems, try using the alternative Makefile:
make -f Makefile.linux
@ -53,10 +49,6 @@ floating point math support.
The `retro` executable can handle a variety of command line
arguments:
retro
Starts the *listener*, a basic REPL for interactive use.
retro -i
Starts the *listener*, a basic REPL for interactive use.

View file

@ -150,14 +150,14 @@ int main(int argc, char **argv) {
ngaPrepare();
max_sp = 0;
max_rsp = 0;
ngaLoadImage("ngaImage");
ngaLoadImage(argv[1]);
stats();
dump_stack();
printf("-> Process code from %s\n", argv[1]);
tokens = include_file(argv[1]);
tokens = include_file(argv[2]);
printf(" %d tokens\n", tokens);
stats();
if ((fp = fopen("ngaImage", "wb")) == NULL) {
if ((fp = fopen(argv[1], "wb")) == NULL) {
printf("Unable to save the ngaImage!\n");
exit(2);
}