###############################################################################
##
## Copyright(c) 2003-2015 Fraunhofer Gesellschaft. All rights reserved.
##              Institut Integrierte Schaltungen - EAS Dresden
##
## Copyright(c) 2015 COSEDA Technologies GmbH.
##              All rights reserved.
##
###############################################################################


###############################################################################
# Libraries configuration
###############################################################################

SYSTEMC_AMS                  ?= yes
SYSTEMC                      ?= yes
SC_INCLUDE_DYNAMIC_PROCESSES ?= no
SC_INCLUDE_FX                ?= no
SCA_BASIC_LIBRARIES          ?= yes
SCA_PWL_LIBRARIES            ?= no
SCA_MECHANICAL_LIBRARIES     ?= no
COSEDA_RF_STATIC_ANALYZER    ?= no
SCA_RF_SYSTEM_LIBRARIES      ?= no
SCA_NGSPICE_LIBRARIES        ?= no
COSEDA_STATISTICS            ?= no
STATECHART2SYSTEMC           ?= no
COSEDA_TLM_LIBRARIES         ?= no
COSEDA_REGISTER_LIBRARIES    ?= no
UVM_SYSTEMC                  ?= no
SCV                          ?= no
CCI                          ?= no
SIMULINK_IMPORT              ?= no
COSEDA_SNPS_VSI              ?= no
SCSIMCONTROL                 ?= yes
SYSTEMQ                      ?= no
COSEDA_MATH_ENGINE           ?= no
ARM_MODEL_LIBRARIES          ?= no
VIVADO_XSI_UTILITIES         ?= no

PYTHON_LIBRARIES             ?= no
LUA_LIBRARIES                ?= no
MATLAB_ENGINE                ?= no
VERILATOR                    ?= no

###############################################################################
# Optimization options, enable tools
###############################################################################
#------------------------------------------------------------------------------
# if you want to build for debugging                       -> BUILD_DEBUG = yes
# enabling this will disable compiler optimizations and symbol stripping!
# optimization switch is overruled (BUILD_OPTIMIZED = no)
# if you want to build COSIDE default                      -> BUILD_DEBUG = no
# DEBUG_FLAGS are used case if BUILD_DEBUG = yes
#------------------------------------------------------------------------------
BUILD_DEBUG ?= no

#------------------------------------------------------------------------------
# if you need SystemC profiling support
# profiling support for SystemC, SystemC AMS, SCA Basic Lib., ... -> SYSTEMC_GPROF = yes
# enabling SystemC profiling support disables compiler optimizations!
# GPROF_FLAGS are used case if SYSTEMC_GPROF = yes
#------------------------------------------------------------------------------
SYSTEMC_GPROF ?= no

#------------------------------------------------------------------------------
# if you want to build with compiler optimizations enabled -> BUILD_OPTIMIZED = yes
# enabling this will disable including debug symbols!
# if you want to build with debug version                  -> BUILD_OPTIMIZED = no
# OPT_FLAGS are used case if BUILD_OPTIMIZED = yes
#------------------------------------------------------------------------------
BUILD_OPTIMIZED ?= yes

#------------------------------------------------------------------------------
# if you want to build a shared library -> BUILD_SHLIB = yes
#------------------------------------------------------------------------------
BUILD_SHLIB ?= no

#------------------------------------------------------------------------------
# if you want to build executables using shared libraries -> USE_SHLIB = yes
#------------------------------------------------------------------------------
USE_SHLIB ?= no

#------------------------------------------------------------------------------
# if you need SystemC with pthread support -> SYSTEMC_PTHREAD = yes
#------------------------------------------------------------------------------
SYSTEMC_PTHREAD ?= no

#------------------------------------------------------------------------------
# if you want to build executables using gold linker -> USE_GOLD_LINKER = yes
#------------------------------------------------------------------------------
USE_GOLD_LINKER ?= no

#------------------------------------------------------------------------------
# if you want to build with clang static code analyzer -> USE_CLANG_ANALYZER = yes
#------------------------------------------------------------------------------
USE_CLANG_ANALYZER ?= no

#------------------------------------------------------------------------------
# if you want to use precompiled header -> USE_PRECOMPILED_HEADER = yes
#------------------------------------------------------------------------------
USE_PRECOMPILED_HEADER ?= no

#------------------------------------------------------------------------------
# if you want to see preprocessor output -> ENABLE_PREPROCESSING_ONLY = yes
#------------------------------------------------------------------------------
ENABLE_PREPROCESSING_ONLY ?= no

###############################################################################
# Compiler & linker flags for building and linking
###############################################################################

CC             = $(GCC_HOME)/bin/gcc
CXX            = $(GCC_HOME)/bin/g++
CXXLD          = $(GCC_HOME)/bin/g++
AR             = $(BINUTILS_HOME)/bin/ar

DEBUG_FLAGS    = -O0 -g
GPROF_FLAGS    = -g -pg -fno-inline
OPT_FLAGS      = -O3
PIC_FLAGS      = -fPIC

EXTRA_CFLAGS   = -Wall -Wfatal-errors
EXTRA_CXXFLAGS = -Wall -Wfatal-errors
EXTRA_LDFLAGS  = 
EXTRA_LIBS     = 


###############################################################################
# Internal tool configuration (USUALLY NO CHANGES REQUIRED)
###############################################################################

# path to Makefile creation utilities
# MAKEFLOW_HOME = $(COSIDE_TOOLS_PATH)/makefileCreation_COSIDE

# show makeflow details (default: yes) 
# MAKEFLOW_VERBOSE ?= no

# make command
MAKE = make

# show make details e.g. executed commands
MAKE_VERBOSE ?= no

# remove all symbol table and relocation information from the executable.
STRIP_DEBUG_SYMBOLS ?= yes

# enable big objects support (solve mingw: "too many sections" issue)
# ENABLE_BIG_OBJECTS = yes

# runtime library search path for customer customization
# LIBRARY_RPATH = /opt/gcc-4.9.4/lib /usr/gcc/lib

# customize object extension
# OBJECT_EXTENSION = obj

# customize object folder (e.g: obj-$(TARGET_ARCH), default: . )
OBJECT_FOLDER ?= .

# customize COSIDE Coupling Framework (CCF) location
# COUPLING_FRAMEWORK_LOCATION = /my_location/coside_coupling_framework

# add module/library to black-list to exclude it for compilation
# MODULE_BLACK_LIST  = library/sub/library/module 
# LIBRARY_BLACK_LIST = 

# add module/library to white-list to explicitly include it for compilation
# MODULE_WHITE_LIST  = 
# LIBRARY_WHITE_LIST = 

# if headers are included without path set this to yes
# ADD_MODULE_LIBRARIES_TO_INCLUDE_PATH = yes

#------------------------------------------------------------------------------
# choose COSIDE compiler tool chain:
#   - GNU/GCC*                COMPILER_TOOLCHAIN = GCC   (default)
#   - Microsoft Visual Studio COMPILER_TOOLCHAIN = MSVS
#
#   *GCC or derivatives with similar cmd-line interface e.g. GCC/ARM,GCC/dSPACE
#------------------------------------------------------------------------------
COMPILER_TOOLCHAIN = GCC

#------------------------------------------------------------------------------
# make rules customization - create 'Makefile_local_pre.mk' file and:
# - use COSIDE_SC_LIBS_HOOK variable to invoke user defined rule prior
#   executables are linked
# - use COSIDE_SC_CLEAN_HOOK variable to invoke user defined clean rule
# - use COSIDE_SC_DISTCLEAN_HOOK variable to invoke user defined distclean rule
# - automatically invoked Makefile_local_(pre/post).mk should define the rule
# example see: $MAKEFLOW_HOME/Makefile_local_pre.mk
#------------------------------------------------------------------------------

#==============================================================================
#= add included.libs and included.modules to CONFIG_DEPENDENCY_FILES 
#=   dependency list
#==============================================================================
#ENABLE_INCLUDED_MOD_LIB_DEPENDENCY = yes

###############################################################################
# add to global dependencies (DO NOT MODIFY)
###############################################################################
CONFIG_DEPENDENCY_FILES += $(CONFIG_DATA)
