nga-c: work on an easier way to add extensions to the embedded image

FossilOrigin-Name: 7b6fae3d092e9255dba1f54115a8c9c347e73b53cbc3b95daa68a9b437bd6367
This commit is contained in:
crc 2020-12-30 20:50:32 +00:00
parent c8bea57564
commit dc0aa0cb21
6 changed files with 24 additions and 2 deletions

View file

@ -130,6 +130,7 @@ vm/nga-c/retro-image.c: ngaImage bin/retro-embedimage bin/retro-extend interface
bin/retro: vm/nga-c/retro-image.c vm/nga-c/retro-unix.c vm/nga-c/bsd-strl.c vm/nga-c/config.h vm/nga-c/dev-clock.c vm/nga-c/dev-files.c vm/nga-c/dev-floatingpoint.c vm/nga-c/dev-image.c vm/nga-c/dev-rng.c vm/nga-c/dev-sockets.c vm/nga-c/dev-unix.c vm/nga-c/prototypes.h
cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../bin/retro retro-unix.c $(LIBM)
cd package/extensions && ../../bin/retro -f ../../tools/generate-extensions-list.retro >../load-extensions.retro
cd package && ../bin/retro -f list.forth
./bin/retro-embedimage rre.image >vm/nga-c/retro-image.c
rm rre.image

View file

@ -0,0 +1,7 @@
Put extensions into this directory. When rebuilding via:
make clean; make
Any extensions here will be placed in a file named
`package/load-extensions.retro` for compilation into the
embedded image.

View file

@ -15,6 +15,10 @@ also use any Retro code directly.
'compat.retro include
~~~
~~~
'load-extensions.retro include
~~~
Save the image with anything loaded here added in. The
`retro` binary will be rebuilt using the extended image.

View file

@ -0,0 +1,3 @@
~~~
'extensions/README.retro include
~~~

View file

@ -0,0 +1,7 @@
#!/usr/bin/env retro
~~~
'~~~ s:put nl
[ ''extensions/%s_include\n s:format s:put ] unix:for-each-file
'~~~ s:put nl
~~~

View file

@ -55,7 +55,7 @@ CELL ngaImage[] = { 1793,14768,15377,15392,202101,0,10,1,10,2,10,3,10,4,10,5,10,
101,114,115,105,111,110,0,975,416,146,105,0,986,107,146,100,0,991,410,146,
114,0,996,339,146,101,114,114,58,110,111,116,102,111,117,110,100,0,0,0,
0,0,0,0,0,0,105,109,97,103,101,58,115,97,118,101,0,103,101,0,
117,109,101,110,116,0,105,116,104,0,104,0,79,85,78,68,0,125,126,0,
65,68,77,69,46,114,101,116,114,111,0,0,79,85,78,68,0,125,126,0,
72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -179,7 +179,7 @@ CELL ngaImage[] = { 1793,14768,15377,15392,202101,0,10,1,10,2,10,3,10,4,10,5,10,
21,2049,2100,4097,3256,10,1,3458,2049,2100,4097,3265,10,3433,3487,133,84,101,109,112,
83,116,114,105,110,103,115,0,32,3472,3505,133,84,101,109,112,83,116,114,105,
110,103,77,97,120,0,512,3488,3517,146,83,84,82,73,78,71,83,0,2049,1543,
3841,3487,3841,3505,19,18,10,3506,3537,133,67,117,114,114,101,110,116,0,16,10,
3841,3487,3841,3505,19,18,10,3506,3537,133,67,117,114,114,101,110,116,0,20,10,
3526,3552,146,115,58,112,111,105,110,116,101,114,0,3841,3537,3841,3505,19,2049,3517,
17,10,3539,3571,146,115,58,110,101,120,116,0,1,3537,2049,2988,3841,3537,3841,3487,
11,1793,3587,1,0,4097,3537,10,1,3582,9,10,3506,3601,146,115,58,116,101,109,