2021-01-24 00:45:31 +01:00
|
|
|
VERSION ?= 2021.4
|
|
|
|
KEYPAIR ?= 2021-04
|
2018-11-09 04:22:51 +01:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
DATADIR ?= $(PREFIX)/share/RETRO12
|
|
|
|
DOCSDIR ?= $(PREFIX)/share/doc/RETRO12
|
|
|
|
EXAMPLESDIR ?= $(PREFIX)/share/examples/RETRO12
|
2019-02-20 17:15:30 +01:00
|
|
|
MANDIR ?= $(PREFIX)/man/man1
|
2018-11-09 04:22:51 +01:00
|
|
|
LIBM ?= -lm
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
2019-02-20 17:15:30 +01:00
|
|
|
help:
|
|
|
|
|
2019-04-24 16:24:20 +02:00
|
|
|
build: dirs toolchain ngaImage bin/retro bin/retro-describe
|
2019-02-20 17:15:30 +01:00
|
|
|
|
2019-03-29 19:46:22 +01:00
|
|
|
optional: build bin/retro-repl
|
2019-02-20 17:15:30 +01:00
|
|
|
|
|
|
|
toolchain: dirs bin/retro-embedimage bin/retro-extend bin/retro-muri bin/retro-unu
|
2018-11-14 23:56:30 +01:00
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
image: vm/nga-c/image.c
|
|
|
|
|
|
|
|
repl: bin/retro-repl
|
|
|
|
|
2018-11-14 23:56:30 +01:00
|
|
|
dirs:
|
|
|
|
mkdir -p bin
|
2020-09-21 19:46:08 +02:00
|
|
|
cp tools/retro-document.sh bin/retro-document
|
2018-11-09 04:22:51 +01:00
|
|
|
|
|
|
|
clean:
|
2019-02-20 17:15:30 +01:00
|
|
|
rm -f bin/*
|
2018-11-09 04:22:51 +01:00
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
|
|
|
|
# installation targets
|
|
|
|
|
2019-04-24 16:24:20 +02:00
|
|
|
install: build install-data install-docs install-examples install-manpages
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -c -m 755 bin/retro-embedimage $(DESTDIR)$(PREFIX)/bin/retro-embedimage
|
|
|
|
install -c -m 755 bin/retro-extend $(DESTDIR)$(PREFIX)/bin/retro-extend
|
|
|
|
install -c -m 755 bin/retro-muri $(DESTDIR)$(PREFIX)/bin/retro-muri
|
|
|
|
install -c -m 755 bin/retro $(DESTDIR)$(PREFIX)/bin/retro
|
|
|
|
install -c -m 755 bin/retro-unu $(DESTDIR)$(PREFIX)/bin/retro-unu
|
|
|
|
install -c -m 755 bin/retro-describe $(DESTDIR)$(PREFIX)/bin/retro-describe
|
2019-05-10 15:04:25 +02:00
|
|
|
install -c -m 755 bin/retro-document $(DESTDIR)$(PREFIX)/bin/retro-document
|
2019-08-27 16:19:07 +02:00
|
|
|
install -c -m 755 example/retro-tags.retro $(DESTDIR)$(PREFIX)/bin/retro-tags
|
2020-01-08 22:45:46 +01:00
|
|
|
install -c -m 755 example/retro-locate.retro $(DESTDIR)$(PREFIX)/bin/retro-locate
|
2019-04-24 16:24:20 +02:00
|
|
|
|
|
|
|
install-strip: build install-data install-docs install-examples
|
|
|
|
install -m 755 -d -- $(DESTDIR)/bin
|
|
|
|
install -c -m 755 -s bin/retro-embedimage $(DESTDIR)$(PREFIX)/bin/retro-embedimage
|
|
|
|
install -c -m 755 -s bin/retro-extend $(DESTDIR)$(PREFIX)/bin/retro-extend
|
|
|
|
install -c -m 755 -s bin/retro-muri $(DESTDIR)$(PREFIX)/bin/retro-muri
|
|
|
|
install -c -m 755 -s bin/retro $(DESTDIR)$(PREFIX)/bin/retro
|
|
|
|
install -c -m 755 -s bin/retro-unu $(DESTDIR)$(PREFIX)/bin/retro-unu
|
2019-05-10 15:14:17 +02:00
|
|
|
install -c -m 755 bin/retro-describe $(DESTDIR)$(PREFIX)/bin/retro-describe
|
|
|
|
install -c -m 755 bin/retro-document $(DESTDIR)$(PREFIX)/bin/retro-document
|
2019-08-27 16:19:07 +02:00
|
|
|
install -c -m 755 example/retro-tags.retro $(DESTDIR)$(PREFIX)/bin/retro-tags
|
2020-01-08 22:45:46 +01:00
|
|
|
install -c -m 755 example/retro-locate.retro $(DESTDIR)$(PREFIX)/bin/retro-locate
|
2019-04-24 16:24:20 +02:00
|
|
|
|
|
|
|
install-data:
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(DATADIR)
|
2019-11-22 20:16:33 +01:00
|
|
|
install -c -m 644 tools/glossary.retro $(DESTDIR)$(DATADIR)/glossary.retro
|
2019-04-24 16:24:20 +02:00
|
|
|
install -c -m 644 ngaImage $(DESTDIR)$(DATADIR)/ngaImage
|
|
|
|
cp -fpR tests $(DESTDIR)$(DATADIR)/
|
2019-11-25 13:49:15 +01:00
|
|
|
install -c -m 644 doc/words.tsv $(DESTDIR)$(DATADIR)/words.tsv
|
2019-04-24 16:24:20 +02:00
|
|
|
|
|
|
|
install-docs:
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(DOCSDIR)
|
2019-06-28 22:08:27 +02:00
|
|
|
install -c -m 644 README $(DESTDIR)$(DOCSDIR)/README
|
|
|
|
install -c -m 644 RELEASE-NOTES $(DESTDIR)$(DOCSDIR)/RELEASE-NOTES
|
2020-01-13 13:13:56 +01:00
|
|
|
install -c -m 644 doc/RETRO-Book.md $(DESTDIR)$(DOCSDIR)/RETRO-Book.md
|
|
|
|
install -c -m 644 doc/words.tsv $(DESTDIR)$(DOCSDIR)/words.tsv
|
2019-04-24 16:24:20 +02:00
|
|
|
|
|
|
|
install-examples:
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(EXAMPLESDIR)
|
|
|
|
cp -fpR example $(DESTDIR)$(EXAMPLESDIR)
|
|
|
|
|
|
|
|
install-manpages:
|
|
|
|
install -c -m 644 man/retro.1 $(MANDIR)/retro.1
|
|
|
|
install -c -m 644 man/retro-embedimage.1 $(MANDIR)/retro-embedimage.1
|
|
|
|
install -c -m 644 man/retro-extend.1 $(MANDIR)/retro-extend.1
|
|
|
|
install -c -m 644 man/retro-describe.1 $(MANDIR)/retro-describe.1
|
2019-05-10 15:14:17 +02:00
|
|
|
install -c -m 644 man/retro-document.1 $(MANDIR)/retro-document.1
|
2019-04-24 16:24:20 +02:00
|
|
|
install -c -m 644 man/retro-muri.1 $(MANDIR)/retro-muri.1
|
|
|
|
install -c -m 644 man/retro-unu.1 $(MANDIR)/retro-unu.1
|
2019-08-20 20:31:46 +02:00
|
|
|
install -c -m 644 man/retro-tags.1 $(MANDIR)/retro-tags.1
|
2020-01-09 15:53:10 +01:00
|
|
|
install -c -m 644 man/retro-locate.1 $(MANDIR)/retro-locate.1
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2018-11-09 04:22:51 +01:00
|
|
|
|
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
# toolchain targets
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2019-11-22 20:16:33 +01:00
|
|
|
bin/retro-describe: tools/retro-describe.retro doc/words.tsv
|
|
|
|
cat tools/retro-describe.retro doc/words.tsv >bin/retro-describe
|
2019-05-10 16:38:57 +02:00
|
|
|
chmod +x bin/retro-describe
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2020-09-21 19:51:59 +02:00
|
|
|
bin/retro-embedimage: tools/retro-embedimage.c
|
|
|
|
$(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-embedimage.c
|
2018-11-09 04:22:51 +01:00
|
|
|
|
2020-09-21 19:51:59 +02:00
|
|
|
bin/retro-extend: tools/retro-extend.c
|
|
|
|
$(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-extend.c
|
2018-11-09 04:22:51 +01:00
|
|
|
|
2020-09-21 19:46:08 +02:00
|
|
|
bin/retro-muri: tools/retro-muri.c
|
|
|
|
$(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-muri.c
|
2018-11-09 04:22:51 +01:00
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
bin/retro-unu: tools/retro-unu.c
|
|
|
|
$(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-unu.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# basic image target
|
|
|
|
|
2020-12-21 22:05:30 +01:00
|
|
|
ngaImage: image/retro.muri image/retro.forth bin/retro-muri bin/retro-extend
|
|
|
|
./bin/retro-muri image/retro.muri
|
2020-10-16 19:31:09 +02:00
|
|
|
./bin/retro-extend ngaImage image/retro.forth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# minimal system
|
|
|
|
|
2019-11-22 19:30:02 +01:00
|
|
|
bin/retro-repl: vm/nga-c/repl.c vm/nga-c/image.c
|
2020-01-07 15:09:08 +01:00
|
|
|
cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../bin/retro-repl repl.c
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
# retro on unix
|
|
|
|
|
2020-12-31 16:04:06 +01:00
|
|
|
update-extensions: bin/retro
|
|
|
|
cd package/extensions && ../../bin/retro -f ../../tools/generate-extensions-list.retro >../load-extensions.retro
|
|
|
|
|
2020-11-12 16:03:11 +01:00
|
|
|
vm/nga-c/retro-image.c: ngaImage bin/retro-embedimage bin/retro-extend interface/filesystem.retro interface/floatingpoint.retro interface/unix.retro interface/rng.retro interface/sockets.retro interface/scripting.retro interface/retro-unix.retro interface/clock.retro
|
2019-02-20 17:15:30 +01:00
|
|
|
cp ngaImage rre.image
|
2021-01-24 06:16:18 +01:00
|
|
|
./bin/retro-extend rre.image interface/filesystem.retro interface/floatingpoint.retro interface/unix.retro interface/rng.retro interface/sockets.retro interface/scripting.retro interface/clock.retro interface/retro-unix.retro
|
2019-11-22 19:30:02 +01:00
|
|
|
./bin/retro-embedimage rre.image >vm/nga-c/retro-image.c
|
2020-11-12 16:03:11 +01:00
|
|
|
|
2020-12-31 16:04:06 +01:00
|
|
|
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 package/list.forth package/load-extensions.retro
|
2020-01-07 15:09:08 +01:00
|
|
|
cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../bin/retro retro-unix.c $(LIBM)
|
2021-01-24 02:13:04 +01:00
|
|
|
cd package && ../bin/retro -u rre.image -f list.forth
|
2019-11-22 19:30:02 +01:00
|
|
|
./bin/retro-embedimage rre.image >vm/nga-c/retro-image.c
|
2019-02-20 17:15:30 +01:00
|
|
|
rm rre.image
|
2020-01-07 15:09:08 +01:00
|
|
|
cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../bin/retro retro-unix.c $(LIBM)
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
# optional targets
|
|
|
|
|
2020-12-23 19:42:53 +01:00
|
|
|
bin/retro-compiler: bin/retro-extend vm/nga-c/retro-compiler.c vm/nga-c/retro-runtime.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
|
2020-10-16 19:31:09 +02:00
|
|
|
cp ngaImage runtime.image
|
|
|
|
./bin/retro-extend runtime.image interface/scripting.retro interface/filesystem.retro interface/floatingpoint.retro interface/unix.retro interface/rng.retro interface/retro-unix.retro interface/clock.retro
|
|
|
|
cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../retro-runtime retro-runtime.c $(LIBM)
|
|
|
|
cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../bin/retro-compiler retro-compiler.c
|
|
|
|
objcopy --add-section .ngaImage=runtime.image --set-section-flags .ngaImage=noload,readonly bin/retro-compiler
|
|
|
|
objcopy --add-section .runtime=retro-runtime --set-section-flags .runtime=noload,readonly bin/retro-compiler
|
|
|
|
rm runtime.image retro-runtime
|
|
|
|
|
|
|
|
image-js: bin/retro
|
|
|
|
./bin/retro example/retro-generate-image-js.retro >vm/nga-js/image.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# documentation targets
|
|
|
|
|
|
|
|
glossary: doc/Glossary.txt doc/Glossary.html doc/Glossary-Concise.txt doc/Glossary-Names-and-Stack.txt doc/words.tsv
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2019-11-22 20:16:33 +01:00
|
|
|
sorted: doc/words.tsv
|
|
|
|
LC_ALL=C sort -o sorted.tsv doc/words.tsv
|
|
|
|
mv sorted.tsv doc/words.tsv
|
2019-06-28 22:08:27 +02:00
|
|
|
|
|
|
|
doc/Glossary.txt: bin/retro sorted
|
2019-11-22 20:16:33 +01:00
|
|
|
./bin/retro tools/glossary.retro export glossary >doc/Glossary.txt
|
2018-11-09 04:22:51 +01:00
|
|
|
|
2019-06-28 22:08:27 +02:00
|
|
|
doc/Glossary.html: bin/retro sorted
|
2019-11-22 20:16:33 +01:00
|
|
|
./bin/retro tools/glossary.retro export html >doc/Glossary.html
|
2019-02-20 17:15:30 +01:00
|
|
|
|
2019-06-28 22:08:27 +02:00
|
|
|
doc/Glossary-Concise.txt: bin/retro sorted
|
2019-11-22 20:16:33 +01:00
|
|
|
./bin/retro tools/glossary.retro export concise >doc/Glossary-Concise.txt
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2019-06-28 22:08:27 +02:00
|
|
|
doc/Glossary-Names-and-Stack.txt: bin/retro sorted
|
2019-11-22 20:16:33 +01:00
|
|
|
./bin/retro tools/glossary.retro export concise-stack >doc/Glossary-Names-and-Stack.txt
|
2019-04-24 16:24:20 +02:00
|
|
|
|
2019-02-20 17:15:30 +01:00
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
|
|
|
|
# other targets
|
2020-04-27 19:44:03 +02:00
|
|
|
|
|
|
|
release: clean build glossary
|
|
|
|
fossil tarball tip R12.tar.gz
|
|
|
|
mkdir release
|
|
|
|
cd release && tar xzvf ../R12.tar.gz
|
|
|
|
cd release && mv * RETRO12-$(VERSION)
|
|
|
|
cd release && tar cf RETRO12-$(VERSION).tar RETRO12-$(VERSION)
|
|
|
|
cd release && gzip RETRO12-$(VERSION).tar
|
|
|
|
mv release/RETRO12-$(VERSION).tar.gz .
|
|
|
|
rm -rf release
|
2020-04-29 13:33:32 +02:00
|
|
|
signify -S -s /home/crc/keys/$(KEYPAIR).sec -m RETRO12-$(VERSION).tar.gz
|
|
|
|
signify -V -p security/$(KEYPAIR).pub -m RETRO12-$(VERSION).tar.gz
|
|
|
|
|
2020-10-16 19:31:09 +02:00
|
|
|
test: bin/retro
|
|
|
|
./bin/retro tests/test-core.forth
|
|
|
|
|