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 := icc
80 CPPROCFLAGS :=
81 CMISCFLAGS := -mmic -fasm-blocks -std=c99 -openmp
82 CPICFLAGS := -fPIC
83 CDBGFLAGS :=
84 CWARNFLAGS := -Wall
85 COPTFLAGS := -O3
86 CKOPTFLAGS := $(COPTFLAGS)
87 CVECFLAGS :=
89 # Aggregate all of the flags into multiple groups: one for standard
90 # compilation, and one for each of the supported "special" compilation
91 # modes.
92 CFLAGS_NOOPT := $(CDBGFLAGS) $(CWARNFLAGS) $(CPICFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS)
93 CFLAGS := $(COPTFLAGS) $(CVECFLAGS) $(CFLAGS_NOOPT)
94 CFLAGS_KERNELS := $(CKOPTFLAGS) $(CVECFLAGS) $(CFLAGS_NOOPT)
96 # --- Determine the archiver and related flags ---
97 AR := ar
98 ARFLAGS := cru
100 # --- Determine the linker and related flags ---
101 LINKER := $(CC)
102 SOFLAGS := -shared
103 LDFLAGS := -mmic -lm -openmp
107 # end of ifndef MAKE_DEFS_MK_INCLUDED conditional block
108 endif