1 #!/bin/bash
2 #
3 # BLIS
4 # An object-based framework for developing high-performance BLAS-like
5 # libraries.
6 #
7 # Copyright (C) 2014, The University of Texas at Austin
8 #
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions are
11 # met:
12 # - Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # - Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
17 # - Neither the name of The University of Texas at Austin nor the names
18 # of its contributors may be used to endorse or promote products
19 # derived from this software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #
33 #
35 # Only include this block of code once.
36 ifndef MAKE_DEFS_MK_INCLUDED
37 MAKE_DEFS_MK_INCLUDED := yes
41 #
42 # --- Build definitions --------------------------------------------------------
43 #
45 # Variables corresponding to other configure-time options.
46 BLIS_ENABLE_VERBOSE_MAKE_OUTPUT := no
47 BLIS_ENABLE_STATIC_BUILD := yes
48 BLIS_ENABLE_DYNAMIC_BUILD := no
52 #
53 # --- Utility program definitions ----------------------------------------------
54 #
56 SH := /bin/sh
57 MV := mv
58 MKDIR := mkdir -p
59 RM_F := rm -f
60 RM_RF := rm -rf
61 SYMLINK := ln -sf
62 FIND := find
63 GREP := grep
64 XARGS := xargs
65 RANLIB := ranlib
66 INSTALL := install -c
68 # Used to refresh CHANGELOG.
69 GIT := git
70 GIT_LOG := $(GIT) log --decorate
74 #
75 # --- Development tools definitions --------------------------------------------
76 #
78 # --- Determine the C compiler and related flags ---
79 CC := gcc
80 # Enable IEEE Standard 1003.1-2004 (POSIX.1d).
81 # NOTE: This is needed to enable posix_memalign().
82 CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
83 CMISCFLAGS := -std=c99 -m64 -mcpu=power7 #-fopenmp -pg
84 CPICFLAGS := -fPIC
85 CDBGFLAGS := -g
86 CWARNFLAGS := -Wall
87 COPTFLAGS := -O3 -mtune=power7
88 CKOPTFLAGS := $(COPTFLAGS)
89 CVECFLAGS := -mvsx
91 # Aggregate all of the flags into multiple groups: one for standard
92 # compilation, and one for each of the supported "special" compilation
93 # modes.
94 CFLAGS_NOOPT := $(CDBGFLAGS) $(CWARNFLAGS) $(CPICFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS)
95 CFLAGS := $(COPTFLAGS) $(CVECFLAGS) $(CFLAGS_NOOPT)
96 CFLAGS_KERNELS := $(CKOPTFLAGS) $(CVECFLAGS) $(CFLAGS_NOOPT)
98 # --- Determine the archiver and related flags ---
99 AR := ar
100 ARFLAGS := cru
102 # --- Determine the linker and related flags ---
103 LINKER := $(CC)
104 SOFLAGS := -shared
105 LDFLAGS := -lm
109 # end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
110 endif