summaryrefslogtreecommitdiffstats
path: root/src/cblas.mk
blob: 8f0d58482d337e11284899005756834b1e960a56 (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 := d6970cf52592ef67674a61c78bbd055a4e9d4680
$(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

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