2015-02-26 15:02:31 +00:00
|
|
|
|
2015-06-01 15:28:29 +00:00
|
|
|
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
ifneq ($(HDF5),)
|
|
|
|
TRICK_CXXFLAGS += -DHDF5
|
|
|
|
endif
|
|
|
|
|
|
|
|
TRICK_LIB = $(TRICK_LIB_DIR)/libtrick_pyip.a
|
|
|
|
|
|
|
|
OBJECT_FILES = \
|
|
|
|
$(OBJ_DIR)/PrimitiveAttributesMap.o \
|
|
|
|
$(OBJ_DIR)/swig_convert_units.o \
|
|
|
|
$(OBJ_DIR)/swig_global_vars.o
|
|
|
|
|
|
|
|
SWIG_OBJECT_FILES = \
|
|
|
|
$(OBJ_DIR)/sim_services_wrap.o \
|
|
|
|
$(OBJ_DIR)/swig_double_wrap.o \
|
|
|
|
$(OBJ_DIR)/swig_int_wrap.o \
|
|
|
|
$(OBJ_DIR)/swig_ref_wrap.o
|
|
|
|
|
2015-06-11 19:40:14 +00:00
|
|
|
PY_FILES = \
|
|
|
|
${TRICK_HOME}/share/trick/swig/sim_services.py \
|
|
|
|
${TRICK_HOME}/share/trick/swig/swig_double.py \
|
|
|
|
${TRICK_HOME}/share/trick/swig/swig_int.py \
|
|
|
|
${TRICK_HOME}/share/trick/swig/swig_ref.py
|
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
SWIG_SRC_FILES = $(addprefix swig_${TRICK_HOST_CPU}/, $(notdir $(subst .o,.cpp,$(SWIG_OBJECT_FILES))))
|
|
|
|
TRICK_CXXFLAGS += $(PYTHON_INCLUDES) -Wno-redundant-decls -Wno-shadow -Wno-unused-parameter -Wno-missing-field-initializers
|
|
|
|
|
|
|
|
ifeq ($(IS_CC_CLANG), 1)
|
|
|
|
TRICK_CXXFLAGS += -Wno-self-assign -Wno-sometimes-uninitialized
|
|
|
|
endif
|
|
|
|
|
|
|
|
TEST_DIR = swig_${TRICK_HOST_CPU}_test
|
|
|
|
|
|
|
|
ifneq ($(HDF5),)
|
|
|
|
SWIG_DEFS += -DHDF5
|
|
|
|
ifneq ($(HDF5),/usr)
|
|
|
|
TRICK_CXXFLAGS += -I$(HDF5)/include
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2015-11-18 14:30:21 +00:00
|
|
|
ifneq ($(GSL_HOME),)
|
|
|
|
SWIG_DEFS += -D_HAVE_GSL
|
|
|
|
endif
|
|
|
|
|
2016-02-10 15:32:53 +00:00
|
|
|
ifeq ($(USE_ER7_UTILS), 1)
|
2015-02-26 15:02:31 +00:00
|
|
|
SWIG_DEFS += -DUSE_ER7_UTILS_INTEGRATORS
|
|
|
|
endif
|
|
|
|
|
2016-02-10 15:32:53 +00:00
|
|
|
ifeq ($(USE_ER7_UTILS_CHECKPOINTHELPER), 1)
|
|
|
|
SWIG_DEFS += -DUSE_ER7_UTILS_CHECKPOINTHELPER
|
|
|
|
endif
|
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
default: $(SWIG_OBJECT_FILES) $(TRICK_LIB) $(TEST_DIR)
|
|
|
|
|
|
|
|
trick: $(SWIG_OBJECT_FILES) $(OBJECT_FILES) $(TEST_DIR)
|
|
|
|
|
|
|
|
$(OBJ_DIR):
|
|
|
|
mkdir $@
|
|
|
|
|
|
|
|
$(TEST_DIR): swig_${TRICK_HOST_CPU}
|
|
|
|
ln -s -f $< $@
|
|
|
|
|
|
|
|
$(SWIG_OBJECT_FILES): | $(OBJ_DIR)
|
|
|
|
|
|
|
|
$(SWIG_SRC_FILES): | swig_${TRICK_HOST_CPU}
|
|
|
|
|
|
|
|
swig_${TRICK_HOST_CPU}:
|
|
|
|
mkdir $@
|
|
|
|
|
|
|
|
$(SWIG_OBJECT_FILES): $(OBJ_DIR)/%.o : swig_${TRICK_HOST_CPU}/%.cpp
|
2015-07-22 20:34:54 +00:00
|
|
|
$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -c $< -o $@
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
$(OBJECT_FILES): $(OBJ_DIR)/%.o : %.cpp
|
2015-07-22 20:34:54 +00:00
|
|
|
$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -c $< -o $@
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
$(SWIG_SRC_FILES): swig_${TRICK_HOST_CPU}/%_wrap.cpp : %.i
|
2015-06-17 19:07:52 +00:00
|
|
|
$(SWIG) $(SWIG_DEFS) -I${TRICK_HOME}/trick_source -I${TRICK_HOME}/include -I${TRICK_HOME} -c++ -python -includeall -ignoremissing -w201,362,389,451 -o $@ -outdir ${TRICK_HOME}/share/trick/swig $<
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
$(TRICK_LIB) : $(SWIG_OBJECT_FILES) $(OBJECT_FILES)
|
|
|
|
ar crs $@ $?
|
|
|
|
|
|
|
|
real_clean: clean
|
|
|
|
|
|
|
|
clean: clean_python
|
2015-06-11 19:40:14 +00:00
|
|
|
$(RM) -rf $(OBJ_DIR) $(TEST_DIR) $(PY_FILES)
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
clean_python:
|
|
|
|
rm -rf swig_${TRICK_HOST_CPU} sim_services.py swig_double.py swig_int.py swig_ref.py
|
|
|
|
|
|
|
|
# some depends
|
|
|
|
swig_int_wrap.cpp: swig_int.cpp
|
|
|
|
swig_double_wrap.cpp: swig_double.cpp
|
|
|
|
swig_ref_wrap.cpp: swig_ref.cpp
|
|
|
|
|