aboutsummaryrefslogtreecommitdiffstats
path: root/math/openblas/files/patch-Makefile
blob: e45ce9f89e8f7416475262dde3a1fec296788989 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
--- Makefile.orig   2012-07-06 23:09:12.000000000 +0900
+++ Makefile    2012-08-28 23:16:44.000000000 +0900
@@ -203,7 +203,7 @@
 netlib : 
 
 else
-netlib : lapack-3.4.1 patch.for_lapack-3.4.1 $(NETLIB_LAPACK_DIR)/make.inc
+netlib : lapack-%%LAPACKVER%% patch.for_lapack-%%LAPACKVER%% $(NETLIB_LAPACK_DIR)/make.inc
 ifndef NOFORTRAN
    -@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapacklib
 endif
@@ -212,7 +212,7 @@
 endif
 endif
 
-prof_lapack : lapack-3.4.1 $(NETLIB_LAPACK_DIR)/make.inc
+prof_lapack : lapack-%%LAPACKVER%% $(NETLIB_LAPACK_DIR)/make.inc
    -@$(MAKE) -C $(NETLIB_LAPACK_DIR) lapack_prof
 
 $(NETLIB_LAPACK_DIR)/make.inc :
@@ -225,7 +225,7 @@
    -@echo "LOADOPTS    = $(FFLAGS) $(EXTRALIB)" >> $(NETLIB_LAPACK_DIR)/make.inc
    -@echo "CC          = $(CC)" >> $(NETLIB_LAPACK_DIR)/make.inc
    -@echo "CFLAGS      = $(CFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
-   -@echo "ARCH        = $(AR)" >> $(NETLIB_LAPACK_DIR)/make.inc
+   -@echo "ARCH_       = $(AR)" >> $(NETLIB_LAPACK_DIR)/make.inc
    -@echo "ARCHFLAGS   = -ru" >> $(NETLIB_LAPACK_DIR)/make.inc
    -@echo "RANLIB      = $(RANLIB)" >> $(NETLIB_LAPACK_DIR)/make.inc
    -@echo "LAPACKLIB   = ../$(LIBNAME)" >> $(NETLIB_LAPACK_DIR)/make.inc
@@ -237,24 +237,19 @@
    -@cat  make.inc >> $(NETLIB_LAPACK_DIR)/make.inc
 endif
 
-lapack-3.4.1 : lapack-3.4.1.tgz
+lapack-%%LAPACKVER%% : lapack-%%LAPACKVER%%.tgz
 ifndef NOFORTRAN
 ifndef NO_LAPACK
-   @if test `$(MD5SUM) lapack-3.4.1.tgz | $(AWK) '{print $$1}'` = 44c3869c38c8335c2b9c2a8bb276eb55; then \
-       echo $(TAR) zxf $< ;\
-       $(TAR) zxf $< && (cd $(NETLIB_LAPACK_DIR); $(PATCH) -p1 < ../patch.for_lapack-3.4.1) ;\
-       rm -f $(NETLIB_LAPACK_DIR)/lapacke/make.inc ;\
-   else \
-       rm -rf $(NETLIB_LAPACK_DIR) ;\
-       echo "  Cannot download lapack-3.4.1.tgz or the MD5 check sum is wrong (Please use orignal)."; \
-       exit 1; \
-   fi
+   echo $(TAR) zxf $< ;\
+   $(TAR) zxf $< && (cd $(NETLIB_LAPACK_DIR); $(PATCH) -p1 < ../patch.for_lapack-%%LAPACKVER%%)
+   %%FIND%% $(NETLIB_LAPACK_DIR) -name "Makefile*" -type f|\
+       %%XARGS%% %%REINPLACE_CMD%% -e 's;$$(ARCH);$$(ARCH_);g'
 endif
 endif
 
-LAPACK_URL=http://www.netlib.org/lapack/lapack-3.4.1.tgz
+LAPACK_URL=http://www.netlib.org/lapack/lapack-%%LAPACKVER%%.tgz
 
-lapack-3.4.1.tgz :
+lapack-%%LAPACKVER%%.tgz :
 ifndef NOFORTRAN
 #http://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or
 ifeq ($(OSNAME), $(filter $(OSNAME),Darwin NetBSD))
@@ -278,7 +273,7 @@
    -wget http://www.netlib.org/lapack/timing/timing.tgz
 endif
 
-lapack-timing : lapack-3.4.1 large.tgz timing.tgz
+lapack-timing : lapack-%%LAPACKVER%% large.tgz timing.tgz
 ifndef NOFORTRAN
    (cd $(NETLIB_LAPACK_DIR); $(TAR) zxf ../timing.tgz TIMING)
    (cd $(NETLIB_LAPACK_DIR)/TIMING; $(TAR) zxf ../../large.tgz )
@@ -316,4 +311,4 @@
    rm -rf $(NETLIB_LAPACK_DIR) ;\
    fi
    @rm -f *.grd Makefile.conf_last config_last.h
-   @echo Done.
\ No newline at end of file
+   @echo Done.