summaryrefslogtreecommitdiff
path: root/lang/RScheme/Makefile
blob: c5a542bf3038e992a23477020ec663ad812ec747 (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
# $NetBSD: Makefile,v 1.19 2004/12/03 15:15:00 wiz Exp $

DISTNAME=		rs-0.7.3.2
PKGNAME=		RScheme-0.7.3.2
PKGREVISION=		2
CATEGORIES=		lang
MASTER_SITES=		ftp://ftp.rscheme.org/pub/rscheme/

MAINTAINER=		tech-pkg@NetBSD.org
HOMEPAGE=		http://www.rscheme.org/
COMMENT=		Object-oriented Scheme implementation

USE_BUILDLINK3=		YES
GNU_CONFIGURE=		YES
BUILD_TARGET=		base
AUTOMAKE_OVERRIDE=	NO

NOT_FOR_PLATFORM=       *-*-alpha

RSCHEME_MODULES_DIR=	src/install/resource/modules
RSCHEME_MODULES=	${RSCHEME_MODULES_DIR}/primops.mif ${RSCHEME_MODULES_DIR}/precore.mif \
			${RSCHEME_MODULES_DIR}/corelib.mif ${RSCHEME_MODULES_DIR}/low_scheme.mif \
			${RSCHEME_MODULES_DIR}/objsys.mif ${RSCHEME_MODULES_DIR}/paths.mif \
			${RSCHEME_MODULES_DIR}/mathlib.mif ${RSCHEME_MODULES_DIR}/tables.mif \
			${RSCHEME_MODULES_DIR}/iolib.mif ${RSCHEME_MODULES_DIR}/high_scheme.mif \
			${RSCHEME_MODULES_DIR}/start.mif ${RSCHEME_MODULES_DIR}/sort.mif \
			${RSCHEME_MODULES_DIR}/imageio.mif ${RSCHEME_MODULES_DIR}/editinp.mif \
			${RSCHEME_MODULES_DIR}/mlink.mif ${RSCHEME_MODULES_DIR}/compiler.mif \
			${RSCHEME_MODULES_DIR}/codegen.mif ${RSCHEME_MODULES_DIR}/repl.mif \
			${RSCHEME_MODULES_DIR}/debugger.mif ${RSCHEME_MODULES_DIR}/regex.mif \
			${RSCHEME_MODULES_DIR}/hacks.mif ${RSCHEME_MODULES_DIR}/threads.mif

pre-configure:
	@cd ${WRKSRC}/stage0 && ${AUTOCONF}
	cd ${WRKSRC}/stage0 && ${SETENV} ${CONFIGURE_ENV} CFLAGS="${CFLAGS}" \
		./configure ${CONFIGURE_ARGS} --prefix=`pwd`/install
	@cd ${WRKSRC}/stage0 && ${SETENV} ${MAKE_ENV} ${MAKE}
	@${MKDIR} ${WRKSRC}/stage0/install/bin
	@cd ${WRKSRC}/stage0 && ${SETENV} ${MAKE_ENV} ${MAKE} shell
	@cd ${WRKSRC}/stage0 && ${LN} -fs ../../rshell/rs install/bin/rs
	@cd ${WRKSRC}/stage0 && ${LN} -fs ../../system.img install/resource/system.img
	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
		${MAKE}	RS=${WRKSRC}/stage0/install/bin/rs \
			RSC_FLAGS2=-ccode src src/tmp/rsc.img \
			${RSCHEME_MODULES} src/tmp/system.bas
	@cd ${WRKSRC} && ${CP} -p stage0/configure src/configure

do-configure:
	@cd ${WRKSRC}/src && ${SETENV} ${CONFIGURE_ENV} CFLAGS="${CFLAGS}" \
		./configure ${CONFIGURE_ARGS} --prefix=${PREFIX}/lib/rscheme \
				--enable-readline --enable-dynamic-linking

do-build:
	@cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${MAKE} ${BUILD_TARGET}

do-install:
	cd ${WRKSRC}/src && \
		(cd install; ${PAX} -rw include ${BUILDLINK_DIR}) && \
		(cd install; ${PAX} -rw lib ${BUILDLINK_DIR}) && \
		${LN} -s ${PREFIX}/lib/rscheme ${BUILDLINK_DIR}/lib/rscheme && \
		${SETENV} ${MAKE_ENV} ${MAKE} install-base && \
		${SETENV} ${MAKE_ENV} ${MAKE} shell && \
		${MAKE} install-shell && \
		${MAKE} packages

post-install:
	${RM} -f ${PREFIX}/bin/rscheme
	${LN} -s ${PREFIX}/lib/rscheme/bin/rs ${PREFIX}/bin/rscheme
	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/rscheme
	${INSTALL_DATA} ${WRKSRC}/COPYING ${WRKSRC}/README \
		${PREFIX}/share/doc/rscheme
	${RM} -rf ${BUILDLINK_DIR}/include/rscheme			\
		${BUILDLINK_DIR}/include/rscheme.h			\
		${BUILDLINK_DIR}/lib/librs.a				\
		${BUILDLINK_DIR}/lib/rscheme
	${CHMOD} -R g+w ${WRKSRC}

.include "../../devel/readline/buildlink3.mk"
.include "../../mk/autoconf.mk"
.include "../../mk/bsd.pkg.mk"