summaryrefslogtreecommitdiff
path: root/math/frobby/Makefile
blob: 1f31e29c7377e76cc2859dc3b00327f0bf36aaa8 (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
101
102

PORTNAME=		frobby
PORTVERSION=		0.9.1
DISTVERSIONPREFIX=	v
CATEGORIES=		math

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Software system and project for computations with monomial ideals

LICENSE=	GPLv2+

LIB_DEPENDS=	libgmp.so:math/gmp

USES=		gmake shebangfix

USE_GITHUB=	yes
GH_ACCOUNT=	Macaulay2

BINARY_ALIAS=	make=gmake
USE_LDCONFIG=	yes

SHEBANG_FILES=	test/testScripts/* test/runTests test/runSplitTests \
		test/latticeFormats/runtest*

OPTIONS_DEFINE=		EXEDOCS LIBDOCS TEST
OPTIONS_DEFAULT=	STATIC SHARED
OPTIONS_MULTI=		INSTALL
OPTIONS_MULTI_INSTALL=	EXECUTABLE \
			SHARED \
			STATIC
EXEDOCS_DESC=		Build and install documentation for frobby executable
LIBDOCS_DESC=		Build and install documentation for frobby library
EXECUTABLE_DESC=	Build and install frobby executable
SHARED_DESC=		Build and install libfrobby.so
STATIC_DESC=		Build and install libfrobby.a
EXEDOCS_BUILD_DEPENDS=	latex:print/tex-formats \
			dvips:print/tex-dvipsk
LIBDOCS_BUILD_DEPENDS=	doxygen:devel/doxygen \
			epstopdf:print/texlive-base
TEST_BUILD_DEPENDS=	bash:shells/bash
OPTIONS_SUB=		yes

MAKE_ARGS+=	GMP_INC_DIR=${LOCALBASE}/include
MAKE_ENV=	RANLIB=${RANLIB}
LDFLAGS+=	-L${LOCALBASE}/lib

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSHARED} || ${PORT_OPTIONS:MSTATIC}
PLIST_SUB+=	LIBRARY="" NO_LIBRARY="@comment "
.else
PLIST_SUB+=	LIBRARY="@comment " NO_LIBRARY=""
.endif

do-build:

do-build-EXEDOCS-on:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} doc

do-build-EXECUTABLE-on:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}

do-build-LIBDOCS-on:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} develDoc

do-build-STATIC-on:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} library

post-build-SHARED-on:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} MODE=shared library

post-build-TEST-on: do-build-EXECUTABLE-on
	cd ${WRKSRC} && test/runTests _full
	cd ${WRKSRC} && test/runSplitTests _full

do-install:

do-install-EXECUTABLE-on:
	${INSTALL_PROGRAM} ${WRKSRC}/bin/release/frobby ${STAGEDIR}${PREFIX}/bin

do-install-SHARED-on:
	${INSTALL_DATA} ${WRKSRC}/src/frobby.h ${STAGEDIR}${PREFIX}/include
	${INSTALL_DATA} ${WRKSRC}/bin/libfrobby.so ${STAGEDIR}${PREFIX}/lib/libfrobby.so.0
	cd ${STAGEDIR}${PREFIX}/lib &&	\
	${LN} -sf libfrobby.so.0 ${STAGEDIR}${PREFIX}/lib/libfrobby.so

do-install-STATIC-on:
	${INSTALL_DATA} ${WRKSRC}/src/frobby.h ${STAGEDIR}${PREFIX}/include
	${INSTALL_LIB} ${WRKSRC}/bin/libfrobby.a ${STAGEDIR}${PREFIX}/lib

do-install-EXEDOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_MAN} ${WRKSRC}/bin/manual.ps ${STAGEDIR}${DOCSDIR}
	${INSTALL_MAN} ${WRKSRC}/bin/manual.pdf ${STAGEDIR}${DOCSDIR}

do-install-LIBDOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_MAN} ${WRKSRC}/bin/develDoc/develDoc.ps ${STAGEDIR}${DOCSDIR}
	${INSTALL_MAN} ${WRKSRC}/bin/develDoc/develDoc.pdf ${STAGEDIR}${DOCSDIR}
	cd ${WRKSRC}/bin/develDoc && ${COPYTREE_SHARE} html ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>