trick/trick_source/sim_services/MemoryManager/test/Makefile

219 lines
9.7 KiB
Makefile
Raw Normal View History

2015-02-26 15:02:31 +00:00
#SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../share/trick/makefiles/Makefile.common
2015-02-26 15:02:31 +00:00
#COVERAGE_FLAGS += -fprofile-arcs -ftest-coverage -O0
#TRICK_SYSTEM_LDFLAGS += ${COVERAGE_FLAGS}
2015-02-26 15:02:31 +00:00
# Flags passed to the preprocessor.
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra ${COVERAGE_FLAGS} -std=c++11
TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick_mm -ltrick_units -ltrick -ltrick_mm -ltrick_units -ltrick
TRICK_EXEC_LINK_LIBS += -L${GTEST_HOME}/lib64 -L${GTEST_HOME}/lib -lgtest -lgtest_main -lpthread
2015-02-26 15:02:31 +00:00
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = MM_creation_unittest \
MM_declare_var_unittest \
MM_declare_var_2_unittest \
MM_declare_extern_var_unittest \
MM_delete_var_unittest \
MM_ref_attributes_unittest \
MM_resize_array_unittest \
MM_strdup_unittest \
MM_write_var_unittest \
MM_sizeof_type_unittest\
MM_read_checkpoint\
MM_clear_var_unittest\
MM_alloc_deps\
MM_write_checkpoint\
MM_write_checkpoint_hexfloat \
MM_get_enumerated\
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
2015-02-26 15:02:31 +00:00
# House-keeping build targets.
all : test
test: $(TESTS)
./MM_creation_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_creation.xml
./MM_declare_var_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_declare_var.xml
./MM_declare_var_2_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_declare_var_2.xml
./MM_declare_extern_var_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_declare_extern_var.xml
./MM_delete_var_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_delete_var.xml
./MM_ref_attributes_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_ref_attributes.xml
./MM_resize_array_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_resize_array.xml
./MM_strdup_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_strdup.xml
./MM_write_var_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_write_var.xml
./MM_sizeof_type_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_sizeof_type.xml
./MM_read_checkpoint --gtest_output=xml:${TRICK_HOME}/trick_test/MM_read_checkpoint_from_string.xml
./MM_clear_var_unittest --gtest_output=xml:${TRICK_HOME}/trick_test/MM_clear_var.xml
./MM_alloc_deps --gtest_output=xml:${TRICK_HOME}/trick_test/MM_alloc_deps.xml
./MM_write_checkpoint --gtest_output=xml:${TRICK_HOME}/trick_test/MM_write_checkpoint.xml
./MM_write_checkpoint_hexfloat --gtest_output=xml:${TRICK_HOME}/trick_test/MM_write_checkpoint_hexfloat.xml
./MM_get_enumerated --gtest_output=xml:${TRICK_HOME}/trick_test/MM_get_enumerated.xml
./MM_ref_name_from_address --gtest_output=xml:${TRICK_HOME}/trick_test/MM_ref_name_from_address.xml
./Bitfield_tests --gtest_output=xml:${TRICK_HOME}/trick_test/Bitfield_tests.xml
code-coverage: test
# Give rid of any old code-coverage HTML we may have.
rm -rf lcov_html
# Gather coverage information about the src code.
lcov --capture \
--directory ../object_${TRICK_HOST_CPU} \
--base-directory ../src \
--output-file src_coverage.info
# Filter out information about directories that we don't care about.
lcov --remove src_coverage.info '/Applications/*' '/usr/include/*' \
--output-file MemoryManager_code_coverage.info
# Generate HTML
genhtml MemoryManager_code_coverage.info \
--output-directory lcov_html
# Clean up
# rm *.info
clean :
rm -f $(TESTS)
rm -f *.o
# Remove gcov/gprof files.
rm -f *.gcno
rm -rf io_src xml
# Builds gtest.a and gtest_main.a.
io_MM_user_defined_types.o : MM_user_defined_types.hh
${TRICK_HOME}/bin/trick-ICG -s -o ./io_src $(TRICK_CPPFLAGS) $<
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c io_src/io_MM_user_defined_types.cpp
2015-02-26 15:02:31 +00:00
io_MM_alloc_deps.o : MM_alloc_deps.hh
${TRICK_HOME}/bin/trick-ICG -s -o ./io_src $(TRICK_CPPFLAGS) $<
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c io_src/io_MM_alloc_deps.cpp
2015-02-26 15:02:31 +00:00
io_MM_write_checkpoint.o : MM_write_checkpoint.hh
${TRICK_HOME}/bin/trick-ICG -s -o ./io_src $(TRICK_CPPFLAGS) $<
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c io_src/io_MM_write_checkpoint.cpp
2015-02-26 15:02:31 +00:00
io_MM_get_enumerated.o : MM_get_enumerated.hh
${TRICK_HOME}/bin/trick-ICG -s -o ./io_src $(TRICK_CPPFLAGS) $<
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c io_src/io_MM_get_enumerated.cpp
2015-02-26 15:02:31 +00:00
io_MM_ref_name_from_address.o : MM_ref_name_from_address.hh
${TRICK_HOME}/bin/trick-ICG -s -o ./io_src $(TRICK_CPPFLAGS) $<
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c io_src/io_MM_ref_name_from_address.cpp
2015-02-26 15:02:31 +00:00
MM_creation_unittest.o : MM_creation_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_declare_var_unittest.o : MM_declare_var_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_declare_var_2_unittest.o : MM_declare_var_2_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_declare_extern_var_unittest.o : MM_declare_extern_var_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_delete_var_unittest.o : MM_delete_var_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_ref_attributes_unittest.o : MM_ref_attributes_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_resize_array_unittest.o : MM_resize_array_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_strdup_unittest.o : MM_strdup_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_write_var_unittest.o : MM_write_var_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_sizeof_type_unittest.o : MM_sizeof_type_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_read_checkpoint.o : MM_read_checkpoint.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_clear_var_unittest.o : MM_clear_var_unittest.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_alloc_deps.o : MM_alloc_deps.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_write_checkpoint.o : MM_write_checkpoint.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_get_enumerated.o : MM_get_enumerated.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_ref_name_from_address.o : MM_ref_name_from_address.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_write_checkpoint_hexfloat.o : MM_write_checkpoint_hexfloat.cc
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
Bitfield_tests.o : Bitfield_tests.cpp
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
2015-02-26 15:02:31 +00:00
MM_creation_unittest : MM_creation_unittest.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_declare_var_unittest : MM_declare_var_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_declare_var_2_unittest : MM_declare_var_2_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_declare_extern_var_unittest : MM_declare_extern_var_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_delete_var_unittest : MM_delete_var_unittest.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_ref_attributes_unittest : MM_ref_attributes_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_resize_array_unittest : MM_resize_array_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_strdup_unittest : MM_strdup_unittest.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_write_var_unittest : MM_write_var_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_sizeof_type_unittest : MM_sizeof_type_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_read_checkpoint : MM_read_checkpoint.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_clear_var_unittest : MM_clear_var_unittest.o io_MM_user_defined_types.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_alloc_deps : MM_alloc_deps.o io_MM_alloc_deps.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_write_checkpoint : MM_write_checkpoint.o io_MM_write_checkpoint.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_get_enumerated : MM_get_enumerated.o io_MM_get_enumerated.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_ref_name_from_address : MM_ref_name_from_address.o io_MM_ref_name_from_address.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
MM_write_checkpoint_hexfloat : MM_write_checkpoint_hexfloat.o io_MM_write_checkpoint.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
2015-02-26 15:02:31 +00:00
Bitfield_tests : Bitfield_tests.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)