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.

117 lines
4.5 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. # default target
  27. default_tbbproxy: tbbproxy tbbproxy_test
  28. tbb_root ?= $(TBBROOT)
  29. BUILDING_PHASE=1
  30. include $(tbb_root)/build/common.inc
  31. DEBUG_SUFFIX=$(findstring _debug,_$(cfg))
  32. PROXY_ROOT ?= $(tbb_root)/src/tbbproxy
  33. PROXY_SOURCE_ROOT ?= $(PROXY_ROOT)
  34. VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/test
  35. VPATH += $(PROXY_ROOT) $(PROXY_SOURCE_ROOT)
  36. CPLUS_FLAGS += $(DEFINE_KEY)__TBB_DLL_NAME=$(TBB.DLL)
  37. CPLUS_FLAGS += $(DEFINE_KEY)__TBB_LST=$(TBB.LST)
  38. CPLUS_FLAGS += $(foreach dir,$(VPATH),$(INCLUDE_KEY)$(dir))
  39. CPLUS_FLAGS += $(PIC_KEY)
  40. include $(tbb_root)/build/common_rules.inc
  41. #------------------------------------------------------
  42. # Define rules for making the TBB Proxy static library.
  43. #------------------------------------------------------
  44. # Object files that make up TBB Proxy
  45. PROXY_CPLUS.OBJ = tbbproxy.$(OBJ)
  46. PROXY_ASM.OBJ = tbbproxy-asm.$(OBJ)
  47. PROXY.OBJ := $(PROXY_CPLUS.OBJ) $(PROXY_ASM.OBJ)
  48. # Not using intrinsics prevents undesired dependence from ICL libraries (e.g. libirc).
  49. # Not using default libs prevents link issues caused by different CRT versions in tbbproxy and in an app.
  50. $(PROXY.OBJ): CPLUS_FLAGS += $(DEFINE_KEY)ARCH_$(arch) $(DEFINE_KEY)OS_$(tbb_os) $(NOINTRINSIC_KEY) $(NODEFAULTLIB_KEY)
  51. $(PROXY_CPLUS.OBJ): CPLUS_FLAGS+=$(if $(filter windows.%cl,$(tbb_os).$(compiler)),/Fdtbbproxy$(DEBUG_SUFFIX).pdb)
  52. $(PROXY_CPLUS.OBJ): %.$(OBJ): %.cpp
  53. $(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(INCLUDES) $<
  54. $(PROXY.LIB): $(PROXY.OBJ)
  55. $(AR) $(AR_FLAGS) $(AR_OUTPUT_KEY)$@ $^
  56. .PRECIOUS : %.$(ASMEXT)
  57. tbbproxy-asm.$(ASMEXT) : tbbproxy-$(tbb_os).$(ASMEXT) $(TBB.LST) $(TBB-OBJECTS.LST)
  58. $(CPLUS) $(PREPROC_ONLY) $< $(INCLUDES) $(CPLUS_FLAGS) > $@
  59. .PHONY: tbbproxy
  60. ifeq (windows,$(tbb_os))
  61. tbbproxy: $(PROXY.LIB)
  62. else
  63. tbbproxy:
  64. endif
  65. #------------------------------------------------------
  66. # End of rules for making the TBB Proxy static library
  67. #------------------------------------------------------
  68. #------------------------------------------------------
  69. # Define rules for making the TBB Proxy unit tests
  70. #------------------------------------------------------
  71. add_debug=$(basename $(1))_debug$(suffix $(1))
  72. cross_suffix=$(if $(crosstest),$(if $(DEBUG_SUFFIX),$(subst _debug,,$(1)),$(call add_debug,$(1))),$(1))
  73. PROXY_LIB = $(call cross_suffix,$(PROXY.LIB))
  74. PROXY_TESTS_SRCS = test_runtime_loader.cpp
  75. PROXY_TESTS_OBJS = $(PROXY_TESTS_SRCS:.cpp=.$(OBJ))
  76. PROXY_TESTS_EXES = $(PROXY_TESTS_OBJS:.$(OBJ)=.$(TEST_EXT))
  77. # Run rules.
  78. .PHONY: tbbproxy_test
  79. ifeq (windows,$(tbb_os))
  80. tbbproxy_test: $(call cross_suffix,$(PROXY.LIB)) $(TEST_PREREQUISITE) $(PROXY_TESTS_EXES)
  81. $(run_cmd) ./test_runtime_loader.$(TEST_EXT) $(args)
  82. else
  83. tbbproxy_test:
  84. endif
  85. # Link rules.
  86. $(PROXY_TESTS_EXES): %.$(TEST_EXT): %.$(OBJ) $(PROXY_LIB)
  87. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(PROXY_LIB) $(LIBS) $(LIBDL) $(LINK_FLAGS)
  88. # Compilation rules.
  89. $(PROXY_TESTS_OBJS): %.$(OBJ): %.cpp
  90. $(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $(OUTPUT_KEY)$@ $<
  91. #------------------------------------------------------
  92. # End of rules for making the TBB Proxy unit tests
  93. #------------------------------------------------------
  94. # Include automatically generated dependences
  95. -include *.d