You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
7.0 KiB

  1. # Copyright 2005-2013 Intel Corporation. All Rights Reserved.
  2. #
  3. # This file is part of Threading Building Blocks.
  4. #
  5. # Threading Building Blocks is free software; you can redistribute it
  6. # and/or modify it under the terms of the GNU General Public License
  7. # version 2 as published by the Free Software Foundation.
  8. #
  9. # Threading Building Blocks is distributed in the hope that it will be
  10. # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  11. # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with Threading Building Blocks; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. #
  18. # As a special exception, you may use this file as part of a free software
  19. # library without restriction. Specifically, if other files instantiate
  20. # templates or use macros or inline functions from this file, or you compile
  21. # this file and link it with other files to produce an executable, this
  22. # file does not by itself cause the resulting executable to be covered by
  23. # the GNU General Public License. This exception does not however
  24. # invalidate any other reasons why the executable file might be covered by
  25. # the GNU General Public License.
  26. tbb_root ?= $(TBBROOT)
  27. BUILDING_PHASE=1
  28. TEST_RESOURCE = $(RML.RES)
  29. include $(tbb_root)/build/common.inc
  30. DEBUG_SUFFIX=$(findstring _debug,_$(cfg))
  31. # default target
  32. default_rml: rml rml_test
  33. RML_ROOT ?= $(tbb_root)/src/rml
  34. RML_SERVER_ROOT = $(RML_ROOT)/server
  35. VPATH = $(tbb_root)/src/tbb $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE)
  36. VPATH += $(RML_ROOT)/server $(RML_ROOT)/client $(RML_ROOT)/test $(tbb_root)/src/test
  37. include $(tbb_root)/build/common_rules.inc
  38. #--------------------------------------------------------------------------
  39. # Define rules for making the RML server shared library and client objects.
  40. #--------------------------------------------------------------------------
  41. # Object files that make up RML server
  42. RML_SERVER.OBJ = rml_server.$(OBJ)
  43. # Object files that RML clients need
  44. RML_TBB_CLIENT.OBJ ?= rml_tbb.$(OBJ) dynamic_link_rml.$(OBJ)
  45. RML_OMP_CLIENT.OBJ ?= rml_omp.$(OBJ) omp_dynamic_link.$(OBJ)
  46. RML.OBJ = $(RML_SERVER.OBJ) $(RML_TBB_CLIENT.OBJ) $(RML_OMP_CLIENT.OBJ)
  47. ifeq (windows,$(tbb_os))
  48. RML_ASM.OBJ = $(if $(findstring intel64,$(arch)),$(TBB_ASM.OBJ))
  49. endif
  50. ifeq (linux,$(tbb_os))
  51. RML_ASM.OBJ = $(if $(findstring ia64,$(arch)),$(TBB_ASM.OBJ))
  52. endif
  53. RML_TBB_DEP= cache_aligned_allocator_rml.$(OBJ) dynamic_link_rml.$(OBJ) concurrent_vector_rml.$(OBJ) semaphore_rml.$(OBJ) tbb_misc_rml.$(OBJ) tbb_misc_ex_rml.$(OBJ)
  54. TBB_DEP_NON_RML_TEST?= cache_aligned_allocator_rml.$(OBJ) dynamic_link_rml.$(OBJ) $(RML_ASM.OBJ) tbb_misc_rml.$(OBJ) tbb_misc_ex_rml.$(OBJ)
  55. ifeq ($(cfg),debug)
  56. RML_TBB_DEP+= spin_mutex_rml.$(OBJ)
  57. TBB_DEP_RML_TEST?= $(RML_ASM.OBJ) tbb_misc_rml.$(OBJ)
  58. else
  59. TBB_DEP_RML_TEST?= $(RML_ASM.OBJ)
  60. endif
  61. LIBS += $(LIBDL)
  62. INCLUDES += $(INCLUDE_KEY)$(RML_ROOT)/include $(INCLUDE_KEY).
  63. T_INCLUDES = $(INCLUDES) $(INCLUDE_KEY)$(tbb_root)/src/test $(INCLUDE_KEY)$(RML_SERVER_ROOT)
  64. # Suppress superfluous warnings for RML compilation
  65. R_CPLUS_FLAGS = $(subst DO_ITT_NOTIFY,DO_ITT_NOTIFY=0,$(CPLUS_FLAGS)) $(WARNING_SUPPRESS) \
  66. $(DEFINE_KEY)TBB_USE_THREADING_TOOLS=0 $(DEFINE_KEY)__TBB_RML_STATIC=1 $(DEFINE_KEY)__TBB_NO_IMPLICIT_LINKAGE=1
  67. %.$(OBJ): %.cpp
  68. $(CPLUS) $(COMPILE_ONLY) $(R_CPLUS_FLAGS) $(PIC_KEY) $(INCLUDES) $<
  69. ifeq (linux,$(tbb_os))
  70. omp_dynamic_link.$(OBJ): CPLUS_FLAGS+=-fno-exceptions
  71. endif
  72. tbb_misc_rml.$(OBJ): version_string.ver
  73. RML_TEST.OBJ = test_job_automaton.$(OBJ) test_thread_monitor.$(OBJ) test_rml_tbb.$(OBJ) test_rml_omp.$(OBJ) test_rml_mixed.$(OBJ)
  74. $(RML_TBB_DEP): %_rml.$(OBJ): %.cpp
  75. $(CPLUS) $(COMPILE_ONLY) $(OUTPUTOBJ_KEY)$@ $(R_CPLUS_FLAGS) $(PIC_KEY) $(INCLUDES) $<
  76. $(RML_TEST.OBJ): %.$(OBJ): %.cpp
  77. $(CPLUS) $(COMPILE_ONLY) $(R_CPLUS_FLAGS) $(PIC_KEY) $(T_INCLUDES) $<
  78. ifneq (,$(RML.DEF))
  79. rml.def: $(RML.DEF)
  80. $(CPLUS) $(PREPROC_ONLY) $< $(CPLUS_FLAGS) $(INCLUDES) > $@
  81. LIB_LINK_FLAGS += $(EXPORT_KEY)rml.def
  82. $(RML.DLL): rml.def
  83. endif
  84. $(RML.DLL): BUILDING_LIBRARY = $(RML.DLL)
  85. $(RML.DLL): $(RML_TBB_DEP) $(RML_SERVER.OBJ) $(RML.RES) $(RML_NO_VERSION.DLL) $(RML_ASM.OBJ)
  86. $(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(RML.DLL) $(RML_SERVER.OBJ) $(RML_TBB_DEP) $(RML_ASM.OBJ) $(RML.RES) $(LIB_LINK_LIBS) $(LIB_LINK_FLAGS)
  87. ifneq (,$(RML_NO_VERSION.DLL))
  88. $(RML_NO_VERSION.DLL):
  89. echo "INPUT ($(RML.DLL))" > $(RML_NO_VERSION.DLL)
  90. endif
  91. rml: $(RML.DLL) $(RML_TBB_CLIENT.OBJ) $(RML_OMP_CLIENT.OBJ)
  92. #------------------------------------------------------
  93. # End of rules for making the RML server shared library
  94. #------------------------------------------------------
  95. #------------------------------------------------------
  96. # Define rules for making the RML unit tests
  97. #------------------------------------------------------
  98. add_debug=$(basename $(1))_debug$(suffix $(1))
  99. cross_suffix=$(if $(crosstest),$(if $(DEBUG_SUFFIX),$(subst _debug,,$(1)),$(call add_debug,$(1))),$(1))
  100. RML_TESTS = test_job_automaton.$(TEST_EXT) test_thread_monitor.$(TEST_EXT) test_rml_tbb.$(TEST_EXT) test_rml_omp.$(TEST_EXT) test_rml_mixed.$(TEST_EXT) test_rml_omp_c_linkage.$(TEST_EXT)
  101. test_rml_tbb.$(TEST_EXT): test_rml_tbb.$(OBJ) $(RML_TBB_CLIENT.OBJ) $(TBB_DEP_RML_TEST)
  102. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) test_rml_tbb.$(OBJ) $(RML_TBB_CLIENT.OBJ) $(TBB_DEP_RML_TEST) $(LIBS) $(LINK_FLAGS)
  103. test_rml_omp.$(TEST_EXT): test_rml_omp.$(OBJ) $(RML_OMP_CLIENT.OBJ) $(TBB_DEP_NON_RML_TEST)
  104. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) test_rml_omp.$(OBJ) $(RML_OMP_CLIENT.OBJ) $(TBB_DEP_NON_RML_TEST) $(LIBS) $(LINK_FLAGS)
  105. test_rml_mixed.$(TEST_EXT): test_rml_mixed.$(OBJ) $(RML_TBB_CLIENT.OBJ) $(RML_OMP_CLIENT.OBJ) $(TBB_DEP_RML_TEST)
  106. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) test_rml_mixed.$(OBJ) $(RML_TBB_CLIENT.OBJ) $(RML_OMP_CLIENT.OBJ) $(TBB_DEP_RML_TEST) $(LIBS) $(LINK_FLAGS)
  107. rml_omp_stub.$(OBJ): rml_omp_stub.cpp
  108. $(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(WARNING_SUPPRESS) $(T_INCLUDES) $(PIC_KEY) $<
  109. test_rml_omp_c_linkage.$(TEST_EXT): test_rml_omp_c_linkage.$(OBJ) rml_omp_stub.$(OBJ) omp_dynamic_link.$(OBJ)
  110. $(CONLY) $(C_FLAGS) $(OUTPUT_KEY)$@ test_rml_omp_c_linkage.$(OBJ) rml_omp_stub.$(OBJ) omp_dynamic_link.$(OBJ) $(LIBS) $(LINK_FLAGS)
  111. test_%.$(TEST_EXT): test_%.$(OBJ) $(TBB_DEP_NON_RML_TEST)
  112. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(TBB_DEP_NON_RML_TEST) $(LIBS) $(LINK_FLAGS)
  113. ### run_cmd is usually empty
  114. rml_test: $(call cross_suffix,$(RML.DLL)) $(TEST_PREREQUISITE) $(RML_TESTS)
  115. $(run_cmd) ./test_job_automaton.$(TEST_EXT) $(args)
  116. $(run_cmd) ./test_thread_monitor.$(TEST_EXT) $(args)
  117. $(run_cmd) ./test_rml_tbb.$(TEST_EXT) $(args)
  118. $(run_cmd) ./test_rml_omp.$(TEST_EXT) $(args)
  119. $(run_cmd) ./test_rml_mixed.$(TEST_EXT) $(args)
  120. $(run_cmd) ./test_rml_omp_c_linkage.$(TEST_EXT) $(args)
  121. #------------------------------------------------------
  122. # End of rules for making the TBBMalloc unit tests
  123. #------------------------------------------------------
  124. # Include automatically generated dependences
  125. -include *.d