# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

BOOST_ROOT_FOR_TIDY = /mnt/c/boost/boost_1_78_0
CC                  = clang++
STD                 = c++14

ifneq ($(MY_BOOST_ROOT),)
BOOST_ROOT_FOR_TIDY := $(MY_BOOST_ROOT)
endif

ifneq ($(MY_CC),)
CC                  := $(MY_CC)
endif

ifneq ($(MY_STD),)
STD                 := $(MY_STD)
endif

CXX_FLAGS    = $(CC)                                      \
               -march=native                              \
               -mtune=native                              \
               -O3                                        \
               -Wall                                      \
               -Wextra                                    \
               -Wconversion                               \
               -Wsign-conversion                          \
               -std=$(STD)

C_DEFINES    = WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL

C_INCLUDES   = $(PATH_SRC)                                          \
               $(BOOST_ROOT_FOR_TIDY)

C_DEFINES   :=$(addprefix -D,$(C_DEFINES))
C_INCLUDES  :=$(addprefix -I,$(C_INCLUDES))


TIDY_CHECKS  = "*,                                                                \
                -altera-struct-pack-align,                                        \
                -altera-unroll-loops,                                             \
                -fuchsia-*,                                                       \
                -llvmlibc-*"

TIDY_FLAGS   = --extra-arg-before=--driver-mode=g++                 \
               --header-filter=uintwide_t                           \
               -warnings-as-errors=*                                \
               -checks=$(TIDY_CHECKS)
