summaryrefslogtreecommitdiffstats
path: root/src/cblas.mk
blob: 777d3065fb13e8c8789a9612553a6957165fc816 (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
# This file is part of MXE.
# See index.html for further information.

PKG             := cblas
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 1
$(PKG)_CHECKSUM := 0f6354fd67fabd909baf57ced2ef84e962db58fae126e4f41b21dd4fec60a2a3
$(PKG)_SUBDIR   := CBLAS
$(PKG)_FILE     := $(PKG).tgz
$(PKG)_URL      := http://www.netlib.org/blas/blast-forum/$($(PKG)_FILE)
$(PKG)_URL_2    := ftp://ftp.eq.uc.pt/pub/software/math/netlib/blas/blast-forum/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc blas

define $(PKG)_UPDATE
    echo 1
endef

define $(PKG)_BUILD
    $(SED) -i 's, make , $(MAKE) ,g' '$(1)/Makefile'
    $(MAKE) -C '$(1)' -j '$(JOBS)' \
        CBDIR='$(1)' \
        CBLIB='$(1)/lib/libcblas.a' \
        CC='$(TARGET)-gcc' \
        FC='$(TARGET)-gfortran' \
        ARCH='$(TARGET)-ar' \
        RANLIB='$(TARGET)-ranlib' \
        alllib

    $(INSTALL) -d                               '$(PREFIX)/$(TARGET)/lib'
    $(INSTALL) -m644 '$(1)/lib/libcblas.a'      '$(PREFIX)/$(TARGET)/lib/'
    $(INSTALL) -d                               '$(PREFIX)/$(TARGET)/include'
    $(INSTALL) -m644 '$(1)/include/cblas.h'     '$(PREFIX)/$(TARGET)/include/'
    $(INSTALL) -m644 '$(1)/include/cblas_f77.h' '$(PREFIX)/$(TARGET)/include/'

    '$(TARGET)-gcc' \
        -W -Wall -Werror -ansi -pedantic \
        '$(1)/examples/cblas_example1.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
        -lcblas -lblas -lgfortran -lquadmath

    '$(TARGET)-gcc' \
        -W -Wall -Werror -ansi -pedantic \
        '$(1)/examples/cblas_example2.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG)-F77.exe' \
        -lcblas -lblas -lgfortran -lquadmath -DADD_
endef