aboutsummaryrefslogtreecommitdiffstats
path: root/math/matio/Makefile
blob: cbae06e581425cc8cf0f360376f35651cd1977b1 (plain) (blame)
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
# New ports collection makefile for:    matio
# Date created:             14 February 2010
# Whom:                 rfarmer@predatorlabs.net
#
# $FreeBSD$
#

PORTNAME=   matio
PORTVERSION=    1.3.4
CATEGORIES= math
MASTER_SITES=   SF

MAINTAINER= rfarmer@predatorlabs.net
COMMENT=    Library for reading/writing Matlab files

GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes

CFLAGS+=    -fPIC

OPTIONS=    FORTRAN "Build Fortran bindings" OFF

.include <bsd.port.options.mk>

PLIST_FILES=    include/matio.h \
        include/matioConfig.h \
        lib/libmatio.a \
        lib/libmatio.la \
        lib/libmatio.so.1 \
        libdata/pkgconfig/matio.pc

.if !defined(WITHOUT_FORTRAN)
USE_FORTRAN=    yes

FFLAGS+=    -fPIC

CONFIGURE_ARGS+=    --enable-fortran
CONFIGURE_ENV+= FCFLAGS="${FFLAGS}"

PLIST_FILES+=   include/matio.mod
.endif

post-build:
.if defined(WITHOUT_FORTRAN)
    (cd ${WRKSRC}/src && ${CC} ${CFLAGS} -shared -o libmatio.so.1 snprintf.o \
    endian.o io.o inflate.o read_data.o mat5.o mat4.o mat.o)
.else
    (cd ${WRKSRC}/src && ${CC} ${CFLAGS} -shared -o libmatio.so.1 snprintf.o \
    endian.o io.o inflate.o read_data.o mat5.o mat4.o mat.o matio_internal.o \
    matio.o)
.endif

do-install:
    ${INSTALL_DATA} ${WRKSRC}/src/.libs/libmatio.lai ${PREFIX}/lib/libmatio.la
    ${INSTALL_DATA} ${WRKSRC}/src/.libs/libmatio.a ${PREFIX}/lib
    ${INSTALL_DATA} ${WRKSRC}/src/matio.h ${PREFIX}/include
    ${INSTALL_DATA} ${WRKSRC}/src/matioConfig.h ${PREFIX}/include
    ${INSTALL_PROGRAM} ${WRKSRC}/src/libmatio.so.1 ${PREFIX}/lib
    ${INSTALL_DATA} ${WRKSRC}/matio.pc ${PREFIX}/libdata/pkgconfig
.if !defined(WITHOUT_FORTRAN)
    ${INSTALL_DATA} ${WRKSRC}/src/matio.mod ${PREFIX}/include
.endif

.include <bsd.port.mk>