2015-02-26 15:02:31 +00:00
i f e q ( $( shell test -e $ {TRICK_HOME }/trick_source /er 7_utils ) , 0 )
$( info ER7 Utils Exists#########)
e n d i f
export TRICK_HOST_TYPE := $( shell export TRICK_HOME = $( TRICK_HOME) && $( TRICK_HOME) /bin/gte TRICK_HOST_TYPE)
export TRICK_VERSION := $( shell export TRICK_HOME = $( TRICK_HOME) && $( TRICK_HOME) /bin/trick_version -v)
export TRICK_MAJOR := $( shell export TRICK_HOME = $( TRICK_HOME) && $( TRICK_HOME) /bin/trick_version -y)
export TRICK_MINOR := $( shell export TRICK_HOME = $( TRICK_HOME) && $( TRICK_HOME) /bin/trick_version -m)
- i n c l u d e $( TRICK_HOME ) / c o n f i g _ $ { T R I C K _ H O S T _ T Y P E } . m k
i f n d e f T R I C K _ C C
export TRICK_CC := $( CC)
e n d i f
i f n d e f T R I C K _ C P P C
export TRICK_CPPC := $( CXX)
e n d i f
i f n d e f T R I C K _ L D
export TRICK_LD := $( LD)
e n d i f
i f n d e f T R I C K _ S F L A G S
export TRICK_SFLAGS :=
e n d i f
2018-01-18 15:11:06 +00:00
export TRICK_CFLAGS := $( TRICK_CFLAGS)
export TRICK_CXXFLAGS := $( TRICK_CXXFLAGS)
export TRICK_LDFLAGS := $( TRICK_LDFLAGS)
export TRICK_SFLAGS := $( TRICK_SFLAGS)
export TRICK_ICG_EXCLUDE := $( TRICK_ICG_EXCLUDE)
export TRICK_ICG_NOCOMMENT := $( TRICK_ICG_NOCOMMENT)
export TRICK_SWIG_EXCLUDE := $( TRICK_SWIG_EXCLUDE)
export TRICK_PYTHON_PATH := $( TRICK_PYTHON_PATH)
export TRICK_GTE_EXT := $( TRICK_GTE_EXT)
2015-02-26 15:02:31 +00:00
export TRICK_HOST_CPU := $( shell export TRICK_CC = $( TRICK_CC) && $( TRICK_HOME) /bin/gte TRICK_HOST_CPU)
i f n d e f C O N F I G _ M K
i f n e q ( $( MAKECMDGOALS ) , c l e a n )
$( error Please run $ ( TRICK_HOME ) /configure before running make )
e n d i f
e n d i f
# Check if configure script has modifications
i f e q ( $( shell test $ {TRICK_HOME }/configure -nt \
$ { T R I C K _ H O M E } / c o n f i g _ $ { T R I C K _ H O S T _ T Y P E } . m k & & e c h o "NEW_CONFIG" ) , N E W _ C O N F I G )
# Ignore check if using installation path of /usr/local/trick (i.e. SLAX CD)
# Timestamps during ISO creation may be misleading due to file copy prodecures
TEMP = $( shell echo " ${ TRICK_HOME } " | sed -e 's/\/usr\/local\/trick.*/LINUXLIVE/' )
ifneq ( $( TEMP) , LINUXLIVE)
# Force running of the configure script if it is newer than config_*.mk)
$( warning [ 31mPlease rerun " ${ TRICK_HOME } / [1m [7mconfigure [0m " to get the newest configuration changes. Then follow by running " [2m [3m [4mmake -C $$ TRICK_HOME clean all [0m " )
endif
e n d i f
# Do this section only once
i f n d e f T R I C K _ M A K E _ C O M M O N
export TRICK_MAKE_COMMON := 1
export TRICK_INCLUDES := -I${ TRICK_HOME } /trick_source -I../include
export TRICK_VERSIONS := -DTRICK_VER= $( TRICK_MAJOR) -DTRICK_MINOR= $( TRICK_MINOR)
TRICK_CFLAGS += $( TRICK_INCLUDES) $( TRICK_VERSIONS) -fpic
i f d e f T R I C K _ C X X F L A G S
TRICK_CXXFLAGS += $( TRICK_INCLUDES) $( TRICK_VERSIONS) -fpic
e l s e
TRICK_CXXFLAGS := ${ TRICK_CFLAGS }
e n d i f
TRICK_SFLAGS += $( TRICK_INCLUDES) $( TRICK_VERSIONS)
# append additional c and cxx flags defined in config_*.mk files.
TRICK_CFLAGS += $( TRICK_ADDITIONAL_CFLAGS)
TRICK_CXXFLAGS += $( TRICK_ADDITIONAL_CXXFLAGS)
# -fexceptions is included to propogate execptions through C code.
TRICK_CFLAGS += -fexceptions
i f e q ( $( HAVE_ZEROCONF ) , 1 )
TRICK_CFLAGS += -DHAVE_ZEROCONF
TRICK_CXXFLAGS += -DHAVE_ZEROCONF
e n d i f
2016-02-10 15:32:53 +00:00
i f e q ( $( USE_ER 7_UTILS ) , 1 )
2015-03-03 22:06:02 +00:00
ER7_UTILS_HOME := $( TRICK_HOME) /trick_source/er7_utils
TRICK_CFLAGS += -DUSE_ER7_UTILS_INTEGRATORS
TRICK_CXXFLAGS += -DUSE_ER7_UTILS_INTEGRATORS
2016-02-10 15:32:53 +00:00
i f n e q ( $( wildcard $ {ER 7_UTILS_HOME }/CheckpointHelper ) , )
USE_ER7_UTILS_CHECKPOINTHELPER = 1
TRICK_SYSTEM_CFLAGS += -DUSE_ER7_UTILS_CHECKPOINTHELPER
TRICK_SYSTEM_CXXFLAGS += -DUSE_ER7_UTILS_CHECKPOINTHELPER
e n d i f
2015-02-26 15:02:31 +00:00
e n d i f
e n d i f #TRICK_MAKE_COMMON
i f e q ( $( TRICK_FORCE_ 32BIT ) , 1 )
TRICK_CFLAGS += -m32
TRICK_CXXFLAGS += -m32
TRICK_LDFLAGS += -m32
e n d i f
IS_CC_CLANG = $( shell ${ TRICK_CPPC } -xc /dev/null -dM -E | grep -c __clang__)
i f e q ( $( IS_CC_CLANG ) , 1 )
TRICK_CFLAGS += -fcolor-diagnostics
TRICK_CXXFLAGS += -fcolor-diagnostics
e l s e
GCC_MAJOR:= $( shell $( TRICK_CC) -dumpversion | cut -f1 -d.)
GCC_MINOR:= $( shell $( TRICK_CC) -dumpversion | cut -f2 -d.)
e n d i f
i f n e q ( $( HDF 5) , )
i f n e q ( $( HDF 5) , / u s r )
HDF5_LIB := -L$( HDF5) /lib -lhdf5_hl -lhdf5 -lsz
HAVE_HDF5_HOME_LIB64 := $( shell test -e ${ HDF5 } /lib64 && echo "1" )
ifeq ( $( HAVE_HDF5_HOME_LIB64) ,1)
HDF5_LIB = -L$( HDF5) /lib64 $( HDF5_LIB)
endif
e l s e
HDF5_LIB = -lhdf5_hl -lhdf5
e n d i f
e n d i f
HAVE_GSL := $( shell test -e ${ GSL_HOME } /include/gsl && echo "1" )
i f e q ( $( HAVE_GSL ) , 1 )
ifneq ( $( GSL_HOME) ,/usr)
HAVE_GSL_HOME_LIB64 := $( shell test -e ${ GSL_HOME } /lib64 && echo "1" )
ifeq ( $( HAVE_GSL_HOME_LIB64) ,1)
TRICK_EXEC_LINK_LIBS += -L$( GSL_HOME) /lib64
endif
TRICK_EXEC_LINK_LIBS += -L$( GSL_HOME) /lib
endif
TRICK_EXEC_LINK_LIBS += -lgsl -lgslcblas
2016-05-11 14:16:55 +00:00
TRICK_CFLAGS += -D_HAVE_GSL
TRICK_CXXFLAGS += -D_HAVE_GSL
2015-02-26 15:02:31 +00:00
e n d i f
TRICK_INCLUDE = $( shell $( PERL) -e '@inc_paths = "${TRICK_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i "}' )
TRICK_DEFINES = $( shell $( PERL) -e '@defines = "${TRICK_CFLAGS}" =~ /-D\s*(\S+)/g ; foreach $$i (@defines) { print "-D$$i "}' )
IO_SRC_DIR := io_src/
OBJ_DIR := object_${ TRICK_HOST_CPU }
TRICK_LIB_DIR := ${ TRICK_HOME } /lib_${ TRICK_HOST_CPU }
TRICK_BIN_DIR := ${ TRICK_HOME } /bin_${ TRICK_HOST_CPU }
MASTER := ${ TRICK_LIB_DIR } /master.o
TRICK_LIBS := ${ TRICK_LIB_DIR } /libtrick.a ${ TRICK_LIB_DIR } /libtrick_pyip.a
DEPFILE = $( PWD) /Makefile_deps
DEPTEMPFILE = $( PWD) /Makefile_temp_depends