summaryrefslogtreecommitdiff
path: root/lang/forth-retro/Makefile
blob: cddb246c1dfa3e7de7ac00c347f1ed6e53384673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# $NetBSD: Makefile,v 1.1 2018/01/27 10:59:05 kamil Exp $

DISTNAME=	RETRO${RETRO_REL}-${RETRO_SNAPSHOT}
PKGNAME=	forth-retro-${RETRO_REL}.0.${RETRO_SNAPSHOT}
CATEGORIES=	lang
MASTER_SITES=	https://forthworks.com/retro/r/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://forthworks.com/retro/
COMMENT=	Clean, elegant, and pragmatic dialect of Forth
LICENSE=	isc

RETRO_REL=	12
RETRO_SNAPSHOT=	2018.1

USE_TOOLS+=	pax

REPLACE_INTERPRETER+=	rre
REPLACE.rre.old=	.*rre
REPLACE.rre.new=	${PREFIX}/bin/rre
REPLACE_FILES.rre=	bin/listener

INSTALLATION_DIRS=	bin
INSTALLATION_DIRS+=	share/doc/${PKGBASE}
INSTALLATION_DIRS+=	share/doc/${PKGBASE}/literate
INSTALLATION_DIRS+=	share/${PKGBASE}
INSTALLATION_DIRS+=	share/examples/${PKGBASE}

# Reimplement build.sh
do-build:
	${RUN} cd ${WRKSRC}/tools && \
	for file in unu muri embedimage extend; do \
		${CC} ${CFLAGS} ${LDFLAGS} -lm -o $$file $$file.c; \
	done

	${RUN} cd ${WRKSRC} && \
		./tools/unu literate/Unu.md > tools/unu.c; \
		./tools/unu literate/Muri.md > tools/muri.c; \
		./tools/muri literate/Rx.md; \
		./tools/extend literate/RetroForth.md

	${RUN} ${LN} -sf ${WRKSRC}/ngaImage ${WRKSRC}/interfaces/ri/ngaImage
	${RUN} cd ${WRKSRC}/interfaces/ri/ && \
		../../tools/embedimage > image.c

	${RUN} ${LN} -sf ${WRKSRC}/ngaImage ${WRKSRC}/interfaces/ngaImage
	${RUN} cd ${WRKSRC}/interfaces/ && \
		../tools/extend rre_windows.forth; \
		../tools/embedimage > image_windows.c; \
		../tools/extend rre.forth; \
		../tools/embedimage > image.c

	${RUN} cd ${WRKSRC}/interfaces/ && \
	for file in rre repl; do \
		${CC} ${CFLAGS} ${LDFLAGS} -lm -o $$file $$file.c; \
	done

	${RUN} cd ${WRKSRC} && \
		sort -o words.tsv words.tsv

	${RUN} cd ${WRKSRC} && \
		./interfaces/rre glossary.forth export glossary > doc/Glossary.txt

do-install:
.for f in embedimage extend muri unu
	${RUN} ${INSTALL_PROGRAM} \
		${WRKSRC}/tools/${f} \
		${DESTDIR}${PREFIX}/bin/${f}
.endfor

.for f in rre repl
	${RUN} ${INSTALL_PROGRAM} \
		${WRKSRC}/interfaces/${f} \
		${DESTDIR}${PREFIX}/bin/${f}
.endfor

	${RUN} ${INSTALL_SCRIPT} \
		${WRKSRC}/bin/listener \
		${DESTDIR}${PREFIX}/bin/listener

.for f in README.md RELEASE_NOTES.md
	${RUN} ${INSTALL_DATA} \
		${WRKSRC}/${f} \
		${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
.endfor
	${RUN} cd ${WRKSRC}/doc && \
		${PAX} -rw . ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
	${RUN} cd ${WRKSRC}/literate && \
		${PAX} -rw . ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/literate

.for f in glossary.forth ngaImage words.tsv
	${RUN} ${INSTALL_DATA} \
		${WRKSRC}/${f} \
		${DESTDIR}${PREFIX}/share/${PKGBASE}
.endfor

	${RUN} cd ${WRKSRC}/example && \
		${PAX} -rw . ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}

.include "../../mk/bsd.pkg.mk"