1 # --------------------------------------------------------------------------
4 # Markus Wittmann, 2016, 2017
5 # RRZE, University of Erlangen-Nuremberg, Germany
6 # markus.wittmann -at- fau.de or hpc -at- rrze.fau.de
9 # LSS, University of Erlangen-Nuremberg, Germany
11 # Michael Hussnaetter, 2017-2018
12 # University of Erlangen-Nuremberg, Germany
13 # michael.hussnaetter -at- fau.de
15 # This file is part of the Lattice Boltzmann Benchmark Kernels (LbmBenchKernels).
17 # LbmBenchKernels is free software: you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation, either version 3 of the License, or
20 # (at your option) any later version.
22 # LbmBenchKernels is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with LbmBenchKernels. If not, see <http://www.gnu.org/licenses/>.
30 # --------------------------------------------------------------------------
33 # ------------------------------------------------------------------------
34 # C compiler/linker to use.
35 # Flags are specified at the end of the file.
36 # ------------------------------------------------------------------------
40 # ------------------------------------------------------------------------
42 # Preprocessing variables.
47 # Architecture to optimize for.
50 # Generated dependencies, can be left empty.
51 MAKE_DEPEND = $(CC) -MM -MQ'$(OBJECT_DIR)/$(<:%.c=%.o)' -MF'$(DEP_DIR)/$(<:%.c=%.d)' $(PP_FLAGS) $< > /dev/null
53 # Generates dependencies, can be left empty.
54 # $(call make_depend,<source-file>,<source-file-to-generate-dependency-for)
56 $(CC) -MM -MQ'$(OBJECT_DIR)/$(2:%.c=%.o)' -MF'$(DEP_DIR)/$(2:%.c=%.d)' $(PP_FLAGS) $1 > /dev/null
60 OPENMP_C_FLAGS += -qopenmp
61 OPENMP_LD_FLAGS += -qopenmp
64 ifeq (release,$(BUILD))
66 C_FLAGS += -O3 $(TARCH)
67 LD_FLAGS += -O3 $(TARCH)
74 C_FLAGS += -O0 $(TARCH) -g -fstack-protector -debug inline-debug-info -debug extended -debug variable-locations
75 LD_FLAGS += -O0 $(TARCH) -g -fstack-protector -debug inline-debug-info -debug extended -debug variable-locations
77 # Intel compiler intrinsic reference:
78 # debugging: compile with -D__INTEL_COMPILER_USE_INTRINSIC_PROTOTYPES for
79 # improved compile-time checking
80 # release: remove this option as it significantly increases compile time
82 PP_FLAGS += $(D)DEBUG $(D)__INTEL_COMPILER_USE_INTRINSIC_PROTOTYPES
85 $(error unknown BUILD=$(BUILD), specify release or debug)
89 ifeq (on,$(DEBUG_SYMBOLS))
95 # ------------------------------------------------------------------------
96 # C compiler/linker flags to use.
97 # ------------------------------------------------------------------------
98 C_FLAGS += -Wall -Wcheck -Wabi -Wdeprecated -Wextra-tokens -Wformat -Wformat-security -Wshadow -Wuninitialized -Wunused-variable \
99 -fno-alias -fargument-noalias -fno-fnalias -std=c99 \
100 -MT $@ -MF $(patsubst $(OBJECT_DIR)/%.o,$(DEP_DIR)/%.d,$@) -MMD -diag-disable 10010 $(OPENMP_C_FLAGS)
101 LD_FLAGS += -Wall -Wcheck $(OPENMP_LD_FLAGS)