1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
# Threading Building Blocks is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# Threading Building Blocks is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Threading Building Blocks; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# As a special exception, you may use this file as part of a free software
# library without restriction. Specifically, if other files instantiate
# templates or use macros or inline functions from this file, or you compile
# this file and link it with other files to produce an executable, this
# file does not by itself cause the resulting executable to be covered by
# the GNU General Public License. This exception does not however
# invalidate any other reasons why the executable file might be covered by
# the GNU General Public License.
#------------------------------------------------------------------------------
# Define rules for making the TBB tests.
#------------------------------------------------------------------------------
.PHONY: default test_tbb_plain clean
tbb_root ?= $(TBB20_INSTALL_DIR)
BUILDING_PHASE=1
include $(tbb_root)/build/common.inc
default: test_tbb_plain # test_tbb_alt test_tbb_cross
#------------------------------------------------------------
# Define static pattern rules dealing with .cpp source files
#------------------------------------------------------------
VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/test
CPLUS_FLAGS += $(WARNING_KEY)
ifeq (1,$(TBB_NOSTRICT))
# GNU 3.2.3 headers have a ISO syntax that is rejected by Intel compiler in -strict_ansi mode.
# The Mac uses gcc, so the list is empty for that platform.
# The files below need the -strict_ansi flag downgraded to -ansi to compile
KNOWN_NOSTRICT += \
test_concurrent_hash_map.o \
test_concurrent_vector.o \
test_handle_perror.o \
test_cache_aligned_allocator_STL.o \
test_task_scheduler_init.o \
test_model_plugin.o \
test_parallel_sort.o
endif
include $(tbb_root)/build/common_rules.inc
# KNOWN_WARNINGS is empty now! Kept here as a placeholder
$(KNOWN_WARNINGS): %.$(OBJ): %.cpp
$(CPLUS) $(COMPILE_ONLY) $(subst $(WARNING_KEY),,$(CPLUS_FLAGS)) $(INCLUDES) $<
# Rule for generating executable test
%.exe: %.$(OBJ) $(TBB.LIB)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(TBB.LIB) $(LIBS) $(LINK_FLAGS)
# Rule for generating test using Windows compiler with different flags
#%-cross.exe: %.cpp
# cl $(OUTPUT_KEY)$@ $(SECURITY_FLAG) $(CPLUS_CROSS_FLAGS) $(INCLUDES) $< $(TBB.LIB) $(LIBS) $(LINK_FLAGS)
# Rules for generating a test DLL
%.$(DLL).$(OBJ): %.cpp
$(CPLUS) $(COMPILE_ONLY) $(OUTPUTOBJ_KEY)$@ $(CPLUS_FLAGS_NOSTRICT) $(PIC_KEY) $(DEFINE_KEY)_USRDLL $(INCLUDES) $<
%.$(DLL): %.$(DLL).$(OBJ) $(TBB.LIB)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(TBB.LIB) $(LIBS) $(LINK_FLAGS) $(PIC_KEY) $(DYLIB_KEY)
# Rules for the tests, which use TBB in a dynamically loadable library
test_model_plugin.exe: test_model_plugin.$(OBJ) test_model_plugin.$(DLL)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(LIBS) $(LINK_FLAGS) $(LIBDL)
test_assembly.exe: test_assembly.$(OBJ) $(TBB_ASM.OBJ) cache_aligned_allocator.$(OBJ) tbb_misc.$(OBJ) itt_notify.$(OBJ) spin_mutex.$(OBJ) mutex.$(OBJ)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $^ $(LIBS) $(TBB.LIB)
test_task_leaks.exe: test_task_leaks.$(OBJ) $(TBB_ASM.OBJ) cache_aligned_allocator.$(OBJ) tbb_misc.$(OBJ) itt_notify.$(OBJ) mutex.$(OBJ)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $^ $(LIBS) $(TBB.LIB)
test_handle_perror.exe: test_handle_perror.$(OBJ) tbb_misc.$(OBJ) $(TBB_ASM.OBJ)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $^ $(LIBS) $(TBB.LIB)
# Rules for the tests, which depend on tbbmalloc
test_concurrent_hash_map_string.exe: test_concurrent_hash_map_string.$(OBJ)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(LIBS) $(LINK_FLAGS) $(TBB.LIB) $(MALLOC.LIB)
# These are in alphabetical order
TEST_TBB_PLAIN.EXE = test_assembly.exe \
test_aligned_space.exe \
test_atomic.exe \
test_blocked_range.exe \
test_blocked_range2d.exe \
test_blocked_range3d.exe \
test_concurrent_queue.exe \
test_concurrent_vector.exe \
test_concurrent_hash_map.exe \
test_handle_perror.exe \
test_halt.exe \
test_model_plugin.exe \
test_mutex.exe \
test_mutex_native_threads.exe \
test_rwm_upgrade_downgrade.exe \
test_cache_aligned_allocator_STL.exe \
test_cache_aligned_allocator.exe \
test_parallel_for.exe \
test_parallel_reduce.exe \
test_parallel_sort.exe \
test_parallel_scan.exe \
test_parallel_while.exe \
test_pipeline.exe \
test_task_scheduler_init.exe \
test_task.exe \
test_task_leaks.exe \
test_tick_count.exe \
test_inits_loop.exe \
test_yield.exe
ifdef OPENMP_FLAG
TEST_TBB_PLAIN.EXE += test_tbb_openmp
test_openmp.exe: test_openmp.cpp
$(CPLUS) $(OPENMP_FLAG) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(INCLUDES) $^ $(LIBS) $(TBB.LIB)
.PHONY: test_tbb_openmp
test_tbb_openmp: test_openmp.exe
./test_openmp.exe 1:4
endif
# Run tests that are in TEST_PLAIN.EXE
# The test are ordered so that simpler components are tested first.
# If a component Y uses component X, then tests for Y should come after tests for X.
test_tbb_plain: $(TEST_TBB_PLAIN.EXE)
./test_assembly.exe
# Yes, 4:8 is intended on the next line.
./test_yield.exe 4:8
./test_handle_perror.exe
./test_task_scheduler_init.exe 1:4
./test_task.exe 1:4
./test_task_leaks.exe
./test_atomic.exe
./test_cache_aligned_allocator.exe
./test_cache_aligned_allocator_STL.exe
./test_blocked_range.exe 1:4
./test_blocked_range2d.exe 1:4
./test_blocked_range3d.exe 1:4
./test_parallel_for.exe 1:4
./test_parallel_sort.exe 1:4
./test_aligned_space.exe
./test_parallel_reduce.exe 1:4
./test_parallel_scan.exe 1:4
./test_parallel_while.exe 1:4
./test_inits_loop.exe
./test_mutex.exe 1
./test_mutex.exe 2
./test_mutex.exe 4
./test_mutex_native_threads.exe 1
./test_mutex_native_threads.exe 2
./test_mutex_native_threads.exe 4
./test_rwm_upgrade_downgrade.exe 4
# Yes, 4:8 is intended on the next line.
./test_halt.exe 4:8
./test_pipeline.exe 1:4
./test_tick_count.exe 1:4
./test_concurrent_queue.exe 1:4
./test_concurrent_vector.exe 1:4
./test_concurrent_hash_map.exe 1:4
./test_model_plugin.exe 4
ifeq (true,$(codecov))
profmerge
codecov -demang -comp $(tbb_root)/build/codecov.txt
endif
debug_%: test_%.exe
$(debugger) ./$^ $(debug_args)
clean_%:
$(RM) test_$*.$(OBJ) test_$*.exe test_$*.$(DLL) test_$*.$(LIBEXT) test_$*.res test_$*.map test_$*.ilk test_$*.pdb test_$*.exp test_$*.*manifest test_$*.tmp test_$*.d
clean:
$(RM) *.$(OBJ) *.exe *.$(DLL) *.$(LIBEXT) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9]
# Include automatically generated dependences
-include *.d
|