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 # This file is part of the Lattice Boltzmann Benchmark Kernels (LbmBenchKernels).
13 # LbmBenchKernels is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation, either version 3 of the License, or
16 # (at your option) any later version.
18 # LbmBenchKernels is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with LbmBenchKernels. If not, see <http://www.gnu.org/licenses/>.
26 # --------------------------------------------------------------------------
29 # ------------------------------------------------------------------------
30 # C compiler/linker to use.
31 # Flags are specified at the end of the file.
32 # ------------------------------------------------------------------------
36 # ------------------------------------------------------------------------
38 # Preprocessing variables.
43 # Architecture to optimize for.
46 # Generated dependencies, can be left empty.
47 MAKE_DEPEND = $(CC) -MM -MQ'$(OBJECT_DIR)/$(<:%.c=%.o)' -MF'$(DEP_DIR)/$(<:%.c=%.d)' $(PP_FLAGS) $< > /dev/null
49 # Generates dependencies, can be left empty.
50 # $(call make_depend,<source-file>,<source-file-to-generate-dependency-for)
52 $(CC) -MM -MQ'$(OBJECT_DIR)/$(2:%.c=%.o)' -MF'$(DEP_DIR)/$(2:%.c=%.d)' $(PP_FLAGS) $1 > /dev/null
56 OPENMP_C_FLAGS += -qopenmp
57 OPENMP_LD_FLAGS += -qopenmp
60 ifeq (release,$(BUILD))
62 C_FLAGS += -O3 $(TARCH)
63 LD_FLAGS += -O3 $(TARCH)
70 C_FLAGS += -O0 $(TARCH) -g -fstack-protector -debug inline-debug-info -debug extended -debug variable-locations
71 LD_FLAGS += -O0 $(TARCH) -g -fstack-protector -debug inline-debug-info -debug extended -debug variable-locations
73 # Intel compiler intrinsic reference:
74 # debugging: compile with -D__INTEL_COMPILER_USE_INTRINSIC_PROTOTYPES for
75 # improved compile-time checking
76 # release: remove this option as it significantly increases compile time
78 PP_FLAGS += $(D)DEBUG $(D)__INTEL_COMPILER_USE_INTRINSIC_PROTOTYPES
81 $(error unknown BUILD=$(BUILD), specify release or debug)
85 ifeq (on,$(DEBUG_SYMBOLS))
91 # ------------------------------------------------------------------------
92 # C compiler/linker flags to use.
93 # ------------------------------------------------------------------------
94 C_FLAGS += -Wall -Wcheck -Wabi -Wdeprecated -Wextra-tokens -Wformat -Wformat-security -Wshadow -Wuninitialized -Wunused-variable \
95 -fno-alias -fargument-noalias -fno-fnalias -std=c99 \
96 -MT $@ -MF $(patsubst $(OBJECT_DIR)/%.o,$(DEP_DIR)/%.d,$@) -MMD -diag-disable 10010 $(OPENMP_C_FLAGS)
97 LD_FLAGS += -Wall -Wcheck $(OPENMP_LD_FLAGS)