From 03284bf97da76a1c6652ea64a26043a5224e5561 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Tue, 30 Jun 2015 17:57:26 -0500 Subject: [PATCH] Break the Memory Manager out of libtrick.a into libtrick_mm.a. --- Makefile | 1 + share/trick/makefiles/Makefile.common | 2 +- trick_source/sim_services/Clock/test/Makefile | 6 +-- .../sim_services/Executive/test/Makefile | 2 +- .../sim_services/MemoryManager/Makefile | 28 +++++++++---- .../sim_services/MemoryManager/test/Makefile | 42 +++++++++---------- .../sim_services/MonteCarlo/test/Makefile | 2 +- .../ScheduledJobQueue/test/Makefile | 2 +- trick_source/sim_services/Timer/test/Makefile | 2 +- 9 files changed, 50 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 8171d169..440693a1 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ SIM_SERV_DIRS = \ ${TRICK_HOME}/trick_source/sim_services/mains SIM_SERV_OBJS = $(addsuffix /object_$(TRICK_HOST_CPU)/*.o ,$(SIM_SERV_DIRS)) +SIM_SERV_OBJS := $(filter-out ${TRICK_HOME}/trick_source/sim_services/MemoryManager/%, $(SIM_SERV_OBJS)) ER7_UTILS_DIRS = \ ${ER7_UTILS_HOME}/integration/abm4 \ diff --git a/share/trick/makefiles/Makefile.common b/share/trick/makefiles/Makefile.common index 157fe9e0..c1774b72 100644 --- a/share/trick/makefiles/Makefile.common +++ b/share/trick/makefiles/Makefile.common @@ -38,7 +38,7 @@ 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 +export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm IO_SRC_DIR := io_src/ OBJ_DIR := object_${TRICK_HOST_CPU} diff --git a/trick_source/sim_services/Clock/test/Makefile b/trick_source/sim_services/Clock/test/Makefile index a5388238..076d58f6 100644 --- a/trick_source/sim_services/Clock/test/Makefile +++ b/trick_source/sim_services/Clock/test/Makefile @@ -10,15 +10,15 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common # Flags passed to the preprocessor. TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0 -TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units +TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units -ltrick_mm TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a # All tests produced by this Makefile. Remember to add new tests you # created to the list. TESTS = TPROCTEClock_test BC635Clock_test -OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \ - ../../include/object_${TRICK_HOST_CPU}/io_SimObject.o +#OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \ +# ../../include/object_${TRICK_HOST_CPU}/io_SimObject.o # House-keeping build targets. diff --git a/trick_source/sim_services/Executive/test/Makefile b/trick_source/sim_services/Executive/test/Makefile index 250bf0f5..a28edefd 100644 --- a/trick_source/sim_services/Executive/test/Makefile +++ b/trick_source/sim_services/Executive/test/Makefile @@ -10,7 +10,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common # Flags passed to the preprocessor. TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0 -TRICK_LIBS = -L ${TRICK_LIB_DIR} -ltrick -ltrick_units +TRICK_LIBS = -L ${TRICK_LIB_DIR} -ltrick -ltrick_units -ltrick_mm TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a # All tests produced by this Makefile. Remember to add new tests you diff --git a/trick_source/sim_services/MemoryManager/Makefile b/trick_source/sim_services/MemoryManager/Makefile index e7cf5896..9ad63d91 100644 --- a/trick_source/sim_services/MemoryManager/Makefile +++ b/trick_source/sim_services/MemoryManager/Makefile @@ -1,17 +1,29 @@ +# set CONFIG_MK to allow compilation without running configure +CONFIG_MK = 1 include ${TRICK_HOME}/share/trick/makefiles/Makefile.common +# set the TRICK_LIB variable to create a separate library for the Memory Manager. +TRICK_LIB := $(TRICK_LIB_DIR)/libtrick_mm.a include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib -include Makefile_deps -$(L_OBJS) : TRICK_CXXFLAGS += -Wno-unused-parameter -Wno-unused-function -Wno-sign-compare -x c++ -$(Y_OBJS) : TRICK_CXXFLAGS += -Wno-unused-parameter -Wno-unused -x c++ +# make the Memory Manager library when called by the master makefile. +trick: ${TRICK_LIB} -ifeq ($(IS_CC_CLANG), 1) -$(Y_OBJS) : TRICK_CXXFLAGS += -Wno-parentheses-equality -endif - -# suppress warnings files with shadowing. -$(CPP_OBJS) : TRICK_CXXFLAGS += -Wno-shadow +#include ${TRICK_HOME}/share/trick/makefiles/Makefile.common +#include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib +#-include Makefile_deps +# +#$(L_OBJS) : TRICK_CXXFLAGS += -Wno-unused-parameter -Wno-unused-function -Wno-sign-compare -x c++ +#$(Y_OBJS) : TRICK_CXXFLAGS += -Wno-unused-parameter -Wno-unused -x c++ +# +#ifeq ($(IS_CC_CLANG), 1) +#$(Y_OBJS) : TRICK_CXXFLAGS += -Wno-parentheses-equality +#endif +# +## suppress warnings files with shadowing. +#$(CPP_OBJS) : TRICK_CXXFLAGS += -Wno-shadow +# docs: MM.doxygen doxygen MM.doxygen diff --git a/trick_source/sim_services/MemoryManager/test/Makefile b/trick_source/sim_services/MemoryManager/test/Makefile index 58a807d4..161b8725 100644 --- a/trick_source/sim_services/MemoryManager/test/Makefile +++ b/trick_source/sim_services/MemoryManager/test/Makefile @@ -13,7 +13,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common # Flags passed to the preprocessor. TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra ${COVERAGE_FLAGS} -TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units +TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units -ltrick_mm TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a # All tests produced by this Makefile. Remember to add new tests you @@ -37,8 +37,8 @@ TESTS = MM_creation_unittest \ MM_ref_name_from_address \ Bitfield_tests -OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \ - ../../include/object_${TRICK_HOST_CPU}/io_SimObject.o +#OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \ +# ../../include/object_${TRICK_HOST_CPU}/io_SimObject.o # House-keeping build targets. @@ -165,56 +165,56 @@ Bitfield_tests.o : Bitfield_tests.cpp $(TRICK_CPPC) $(TRICK_CPPFLAGS) -c $< MM_creation_unittest : MM_creation_unittest.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_declare_var_unittest : MM_declare_var_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_declare_var_2_unittest : MM_declare_var_2_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_declare_extern_var_unittest : MM_declare_extern_var_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_delete_var_unittest : MM_delete_var_unittest.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_ref_attributes_unittest : MM_ref_attributes_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_resize_array_unittest : MM_resize_array_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_strdup_unittest : MM_strdup_unittest.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_write_var_unittest : MM_write_var_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_sizeof_type_unittest : MM_sizeof_type_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_read_checkpoint : MM_read_checkpoint.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_clear_var_unittest : MM_clear_var_unittest.o io_MM_user_defined_types.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_alloc_deps : MM_alloc_deps.o io_MM_alloc_deps.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_write_checkpoint : MM_write_checkpoint.o io_MM_write_checkpoint.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_get_enumerated : MM_get_enumerated.o io_MM_get_enumerated.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_ref_name_from_address : MM_ref_name_from_address.o io_MM_ref_name_from_address.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) MM_write_checkpoint_hexfloat : MM_write_checkpoint_hexfloat.o io_MM_write_checkpoint.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) Bitfield_tests : Bitfield_tests.o - $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) + $(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS) diff --git a/trick_source/sim_services/MonteCarlo/test/Makefile b/trick_source/sim_services/MonteCarlo/test/Makefile index d94656c0..71dc3bdc 100644 --- a/trick_source/sim_services/MonteCarlo/test/Makefile +++ b/trick_source/sim_services/MonteCarlo/test/Makefile @@ -16,7 +16,7 @@ TRICK_CXXFLAGS += -I${GSL_HOME}/include endif endif -TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_units -ltrick_math +TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_units -ltrick_math -ltrick_mm TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a # All tests produced by this Makefile. Remember to add new tests you diff --git a/trick_source/sim_services/ScheduledJobQueue/test/Makefile b/trick_source/sim_services/ScheduledJobQueue/test/Makefile index e491d92a..b75f36f6 100644 --- a/trick_source/sim_services/ScheduledJobQueue/test/Makefile +++ b/trick_source/sim_services/ScheduledJobQueue/test/Makefile @@ -10,7 +10,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common # Flags passed to the preprocessor. TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0 -TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units +TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units -ltrick_mm TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a # All tests produced by this Makefile. Remember to add new tests you diff --git a/trick_source/sim_services/Timer/test/Makefile b/trick_source/sim_services/Timer/test/Makefile index 5fac0230..96b5c70a 100644 --- a/trick_source/sim_services/Timer/test/Makefile +++ b/trick_source/sim_services/Timer/test/Makefile @@ -10,7 +10,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common # Flags passed to the preprocessor. TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0 -TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units +TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick -ltrick_units -ltrick_mm TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a # All tests produced by this Makefile. Remember to add new tests you