Compile optional er7_utils code into its own library

Changed the master makefile to compile er7_utils into its own library.
Changed the sim makefile to include -ler7_utils if it is available.

refs #73
This commit is contained in:
Alex Lin 2015-06-29 09:52:18 -05:00
parent 9a32414be4
commit 8dc9966d7f
2 changed files with 17 additions and 10 deletions

View File

@ -168,12 +168,15 @@ no_dp: $(TRICK_LIB) $(TRICK_SWIG_LIB)
@ echo ; echo "Trick libs compiled:" ; date
# 1.1.1 Build libTrick.a
ifeq ($(USE_ER7_UTILS_INTEGRATORS), 1)
$(TRICK_LIB): $(SIM_SERV_DIRS) $(ER7_UTILS_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
ar crs $@ $(SIM_SERV_OBJS) $(ER7_UTILS_OBJS) $(UTILS_OBJS)
else
$(TRICK_LIB): $(SIM_SERV_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
ar crs $@ $(SIM_SERV_OBJS) $(UTILS_OBJS)
ifeq ($(USE_ER7_UTILS_INTEGRATORS), 1)
ER7_UTILS_LIB = $(TRICK_LIB_DIR)/liber7_utils.a
no_dp: $(ER7_UTILS_LIB)
$(ER7_UTILS_LIB): $(ER7_UTILS_DIRS) | $(TRICK_LIB_DIR)
ar crs $@ $(ER7_UTILS_OBJS)
endif
# 1.1.1.1 Compile the objects in the specified sim_services directories.

View File

@ -38,6 +38,12 @@ export TRICK_SWIG_EXCLUDE
export TRICK_GTE_EXT
export TRICK_HOST_CPU := $(shell export TRICK_CC=$(TRICK_CC) && $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU)
export TRICK_EXEC_LINK_LIBS = ${PTHREAD_LIBS} $(PYTHON_LIB)
export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units
IO_SRC_DIR := io_src/
OBJ_DIR := object_${TRICK_HOST_CPU}
TRICK_STATIC_LIB := ${TRICK_LIB_DIR}/libtrick.a
TRICK_RANLIB =
ifndef CONFIG_MK
ifneq ($(MAKECMDGOALS), clean)
@ -88,6 +94,10 @@ endif
endif # MAKELEVEL = 0
ifeq ($(USE_ER7_UTILS_INTEGRATORS), 1)
TRICK_LIBS += -ler7_utils
endif
ifeq ($(TRICK_FORCE_32BIT), 1)
TRICK_CFLAGS += -m32
TRICK_CXXFLAGS += -m32
@ -130,12 +140,6 @@ endif
TRICK_INCLUDE = $(shell $(PERL) -e '@inc_paths = "${TRICK_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$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_LIBS = ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units
TRICK_STATIC_LIB := ${TRICK_LIB_DIR}/libtrick.a
TRICK_RANLIB =
DEPFILE = $(PWD)/Makefile_deps
DEPTEMPFILE = $(PWD)/Makefile_temp_depends