aboutsummaryrefslogtreecommitdiffstats
path: root/math/matio/Makefile
blob: e800e5d33ff6c2d27eaac778005e2c21205bf5cb (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
# Created by: rfarmer@predatorlabs.net
# $FreeBSD$

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

MAINTAINER= ports@FreeBSD.org
COMMENT=    Library for reading/writing Matlab files

GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes

CFLAGS+=    -fPIC

OPTIONS_DEFINE= FORTRAN
FORTRAN_DESC=   Build Fortran bindings

NO_STAGE=   yes
.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 ${PORT_OPTIONS:MFORTRAN}
USE_FORTRAN=    yes

FFLAGS+=    -fPIC

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

PLIST_FILES+=   include/matio.mod
.endif

post-build:
.if !${PORT_OPTIONS:MFORTRAN}
    (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 ${PORT_OPTIONS:MFORTRAN}
    ${INSTALL_DATA} ${WRKSRC}/src/matio.mod ${PREFIX}/include
.endif

.include <bsd.port.mk>