2018-04-21 03:41:07 +02:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
DATADIR ?= $(PREFIX)/share/RETRO12
|
|
|
|
DOCSDIR ?= $(PREFIX)/share/doc/RETRO12
|
|
|
|
EXAMPLESDIR ?= $(PREFIX)/share/examples/RETRO12
|
|
|
|
LIBM ?= -lm
|
|
|
|
LIBCURSES ?= -lcurses
|
2018-02-06 02:35:41 +01:00
|
|
|
|
2018-04-21 03:41:07 +02:00
|
|
|
all: build
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-04 22:34:56 +01:00
|
|
|
build: bin/retro-embedimage bin/retro-extend bin/retro-injectimage-js bin/retro-muri bin/RETRO12.html bin/retro-ri bin/retro bin/retro-repl bin/retro-unu
|
2018-02-03 15:53:33 +01:00
|
|
|
|
|
|
|
clean:
|
2018-11-02 16:29:24 +01:00
|
|
|
rm -f bin/retro-embedimage
|
|
|
|
rm -f bin/retro-extend
|
|
|
|
rm -f bin/retro-injectimage-js
|
|
|
|
rm -f bin/retro-muri
|
2018-04-19 17:31:30 +02:00
|
|
|
rm -f bin/RETRO12.html
|
2018-11-02 16:29:24 +01:00
|
|
|
rm -f bin/retro-repl
|
|
|
|
rm -f bin/retro-ri
|
2018-11-04 22:34:56 +01:00
|
|
|
rm -f bin/retro
|
2018-11-02 16:29:24 +01:00
|
|
|
rm -f bin/retro-unu
|
2018-02-03 15:53:33 +01:00
|
|
|
|
2018-04-21 03:41:07 +02:00
|
|
|
install: build install-data install-docs install-examples
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin
|
2018-11-02 16:29:24 +01:00
|
|
|
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-injectimage-js $(DESTDIR)$(PREFIX)/bin/retro-injectimage-js
|
|
|
|
install -c -m 755 bin/retro-listener $(DESTDIR)$(PREFIX)/bin/retro-listener
|
|
|
|
install -c -m 755 bin/retro-muri $(DESTDIR)$(PREFIX)/bin/retro-muri
|
|
|
|
install -c -m 755 bin/retro-repl $(DESTDIR)$(PREFIX)/bin/retro-repl
|
|
|
|
install -c -m 755 bin/retro-ri $(DESTDIR)$(PREFIX)/bin/retro-ri
|
2018-11-04 22:34:56 +01:00
|
|
|
install -c -m 755 bin/retro $(DESTDIR)$(PREFIX)/bin/retro
|
2018-11-02 16:29:24 +01:00
|
|
|
install -c -m 755 bin/retro-unu $(DESTDIR)$(PREFIX)/bin/retro-unu
|
2018-04-21 03:41:07 +02:00
|
|
|
|
|
|
|
install-strip: build install-data install-docs install-examples
|
|
|
|
install -m 755 -d -- $(DESTDIR)/bin
|
2018-11-02 16:29:24 +01:00
|
|
|
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-injectimage-js $(DESTDIR)$(PREFIX)/bin/retro-injectimage-js
|
|
|
|
install -c -m 755 bin/retro-listener $(DESTDIR)$(PREFIX)/bin/retro-listener
|
|
|
|
install -c -m 755 -s bin/retro-muri $(DESTDIR)$(PREFIX)/bin/retro-muri
|
|
|
|
install -c -m 755 -s bin/retro-repl $(DESTDIR)$(PREFIX)/bin/retro-repl
|
|
|
|
install -c -m 755 -s bin/retro-ri $(DESTDIR)$(PREFIX)/bin/retro-ri
|
2018-11-04 22:34:56 +01:00
|
|
|
install -c -m 755 -s bin/retro $(DESTDIR)$(PREFIX)/bin/retro
|
2018-11-02 16:29:24 +01:00
|
|
|
install -c -m 755 -s bin/retro-unu $(DESTDIR)$(PREFIX)/bin/retro-unu
|
2018-04-21 03:41:07 +02:00
|
|
|
|
|
|
|
install-data: bin/RETRO12.html
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(DATADIR)
|
|
|
|
install -c -m 644 bin/RETRO12.html $(DESTDIR)$(DATADIR)/RETRO12.html
|
|
|
|
install -c -m 644 glossary.forth $(DESTDIR)$(DATADIR)/glossary.forth
|
|
|
|
install -c -m 644 ngaImage $(DESTDIR)$(DATADIR)/ngaImage
|
|
|
|
cp -fpR tests $(DESTDIR)$(DATADIR)/
|
|
|
|
install -c -m 644 words.tsv $(DESTDIR)$(DATADIR)/words.tsv
|
|
|
|
|
|
|
|
install-docs:
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(DOCSDIR)
|
|
|
|
cp -fpR doc $(DESTDIR)$(DOCSDIR)
|
|
|
|
cp -fpR literate $(DESTDIR)$(DOCSDIR)
|
|
|
|
install -c -m 644 README.md $(DESTDIR)$(DOCSDIR)/README.md
|
|
|
|
install -c -m 644 RELEASE_NOTES.md $(DESTDIR)$(DOCSDIR)/RELEASE_NOTES.md
|
|
|
|
|
|
|
|
install-examples:
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(EXAMPLESDIR)
|
|
|
|
cp -fpR example $(DESTDIR)$(EXAMPLESDIR)
|
2018-02-03 15:53:33 +01:00
|
|
|
|
2018-11-04 22:34:56 +01:00
|
|
|
test: bin/retro
|
|
|
|
./bin/retro tests/test-core.forth
|
2018-04-19 17:31:30 +02:00
|
|
|
|
|
|
|
# Targets for development/interactive usage
|
|
|
|
|
|
|
|
glossary: doc/Glossary.txt
|
|
|
|
|
|
|
|
image: interfaces/image.c
|
|
|
|
|
|
|
|
js: bin/RETRO12.html
|
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
repl: bin/retro-repl
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
ri: bin/retro-ri
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
update: bin/retro-unu literate/Unu.md literate/Muri.md
|
|
|
|
./bin/retro-unu literate/Unu.md >tools/unu.c
|
|
|
|
./bin/retro-unu literate/Muri.md >tools/muri.c
|
2018-02-03 15:53:33 +01:00
|
|
|
|
2018-04-19 17:31:30 +02:00
|
|
|
# File targets.
|
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-embedimage: tools/embedimage.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/retro-embedimage tools/embedimage.c
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-extend: tools/extend.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/retro-extend tools/extend.c
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-injectimage-js: tools/injectimage-js.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/retro-injectimage-js tools/injectimage-js.c
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-muri: tools/muri.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/retro-muri tools/muri.c
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/RETRO12.html: bin/retro-injectimage-js
|
|
|
|
./bin/retro-injectimage-js >bin/RETRO12.html
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-repl: interfaces/repl.c interfaces/image.c
|
|
|
|
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro-repl repl.c
|
2018-02-03 15:53:33 +01:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-ri: interfaces/ri.c interfaces/image.c
|
|
|
|
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro-ri $(LIBCURSES) ri.c
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-04 22:34:56 +01:00
|
|
|
bin/retro: bin/retro-embedimage bin/retro-extend interfaces/image.c interfaces/rre.c interfaces/rre.forth
|
2018-02-03 15:53:33 +01:00
|
|
|
cp ngaImage cleanImage
|
2018-11-02 16:29:24 +01:00
|
|
|
./bin/retro-extend interfaces/rre.forth
|
|
|
|
./bin/retro-embedimage >interfaces/rre_image_unix.c
|
2018-02-03 15:53:33 +01:00
|
|
|
mv cleanImage ngaImage
|
2018-11-04 22:34:56 +01:00
|
|
|
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro $(LIBM) rre.c
|
2018-04-18 17:45:54 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-barebones: bin/retro-embedimage bin/retro-extend interfaces/image.c interfaces/barebones.c interfaces/barebones.forth
|
2018-10-01 16:56:49 +02:00
|
|
|
cp ngaImage cleanImage
|
2018-11-02 16:29:24 +01:00
|
|
|
./bin/retro-extend interfaces/barebones.forth
|
|
|
|
./bin/retro-embedimage >interfaces/barebones_image.c
|
2018-10-01 16:56:49 +02:00
|
|
|
mv cleanImage ngaImage
|
2018-11-02 16:29:24 +01:00
|
|
|
cd interfaces && $(CC) $(CFLAGS) $(LDFLAGS) -o ../bin/retro-barebones barebones.c
|
2018-10-01 16:56:49 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
bin/retro-unu: tools/unu.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o bin/retro-unu tools/unu.c
|
2018-02-06 16:36:34 +01:00
|
|
|
|
2018-11-04 22:34:56 +01:00
|
|
|
doc/Glossary.txt: bin/retro words.tsv
|
2018-04-21 03:41:07 +02:00
|
|
|
LC_ALL=C sort -o sorted.tsv words.tsv
|
2018-02-03 15:53:33 +01:00
|
|
|
mv sorted.tsv words.tsv
|
2018-11-04 22:34:56 +01:00
|
|
|
./bin/retro glossary.forth export glossary >doc/Glossary.txt
|
2018-04-19 17:31:30 +02:00
|
|
|
|
2018-11-02 16:29:24 +01:00
|
|
|
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
|