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.

173 lines
6.2 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. #------------------------------------------------------------------------------
  27. # Define compiler-specific variables.
  28. #------------------------------------------------------------------------------
  29. #------------------------------------------------------------------------------
  30. # Setting default configuration to release.
  31. #------------------------------------------------------------------------------
  32. cfg ?= release
  33. #------------------------------------------------------------------------------
  34. # End of setting default configuration to release.
  35. #------------------------------------------------------------------------------
  36. #------------------------------------------------------------------------------
  37. # Setting compiler flags.
  38. #------------------------------------------------------------------------------
  39. CPLUS = icl /nologo $(VCCOMPAT_FLAG)
  40. LINK_FLAGS = /link /nologo
  41. LIB_LINK_FLAGS= /link /nologo /DLL /MAP /DEBUG /fixed:no /INCREMENTAL:NO /DYNAMICBASE /NXCOMPAT
  42. ifeq ($(arch), ia32)
  43. LIB_LINK_FLAGS += /SAFESEH
  44. endif
  45. # ICC 11.0 and higher support -std=c++0x
  46. ifeq (ok,$(shell cmd /C "cscript /nologo /E:jscript $(tbb_root)/build/detect.js /minversion icl 11"))
  47. CPP11_FLAGS = /Qstd=c++0x /D_TBB_CPP0X
  48. endif
  49. # ICC 12.0 and higher provide Intel(R) Cilk Plus
  50. ifeq (ok,$(shell cmd /C "cscript /nologo /E:jscript $(tbb_root)/build/detect.js /minversion icl 12"))
  51. CILK_AVAILABLE = yes
  52. endif
  53. ifeq ($(runtime), vc_mt)
  54. MS_CRT_KEY = /MT$(if $(findstring debug,$(cfg)),d)
  55. else
  56. MS_CRT_KEY = /MD$(if $(findstring debug,$(cfg)),d)
  57. endif
  58. EH_FLAGS = /EHsc /GR
  59. ifeq ($(cfg), release)
  60. CPLUS_FLAGS = $(MS_CRT_KEY) /O2 /Zi $(EH_FLAGS) /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=$(TBB.LIB)
  61. ASM_FLAGS =
  62. endif
  63. ifeq ($(cfg), debug)
  64. CPLUS_FLAGS = $(MS_CRT_KEY) /Od /Ob0 /Zi $(EH_FLAGS) /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=$(TBB.LIB)
  65. ASM_FLAGS = /DUSE_FRAME_POINTER
  66. endif
  67. CPLUS_FLAGS += /GS
  68. COMPILE_ONLY = /c /QMMD
  69. # PREPROC_ONLY should really use /TP which applies to all files in the command line.
  70. # But with /TP, ICL does not preprocess *.def files.
  71. PREPROC_ONLY = /EP /Tp
  72. INCLUDE_KEY = /I
  73. DEFINE_KEY = /D
  74. OUTPUT_KEY = /Fe
  75. OUTPUTOBJ_KEY = /Fo
  76. WARNING_AS_ERROR_KEY = /WX
  77. WARNING_KEY = /W3
  78. DYLIB_KEY = /DLL
  79. EXPORT_KEY = /DEF:
  80. NODEFAULTLIB_KEY = /Zl
  81. NOINTRINSIC_KEY = /Oi-
  82. ifneq (,$(codecov))
  83. CPLUS_FLAGS += /Qprof-genx
  84. else
  85. CPLUS_FLAGS += /DDO_ITT_NOTIFY
  86. endif
  87. OPENMP_FLAG = /Qopenmp
  88. CPLUS_FLAGS += /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE \
  89. /D_WIN32_WINNT=$(_WIN32_WINNT)
  90. ifeq ($(runtime),vc8)
  91. CPLUS_FLAGS += /D_USE_RTM_VERSION
  92. endif
  93. C_FLAGS = $(CPLUS_FLAGS)
  94. ifneq (00,$(lambdas)$(cpp0x))
  95. CPLUS_FLAGS += $(CPP11_FLAGS)
  96. endif
  97. VCVERSION:=$(runtime)
  98. VCCOMPAT_FLAG ?= $(if $(findstring vc7.1, $(VCVERSION)),/Qvc7.1)
  99. ifeq ($(VCCOMPAT_FLAG),)
  100. VCCOMPAT_FLAG := $(if $(findstring vc8, $(VCVERSION)),/Qvc8)
  101. endif
  102. ifeq ($(VCCOMPAT_FLAG),)
  103. VCCOMPAT_FLAG := $(if $(findstring vc_mt, $(VCVERSION)),/Qvc10)
  104. endif
  105. ifeq ($(VCCOMPAT_FLAG),)
  106. VCCOMPAT_FLAG := $(if $(findstring vc9, $(VCVERSION)),/Qvc9)
  107. endif
  108. ifeq ($(VCCOMPAT_FLAG),)
  109. VCCOMPAT_FLAG := $(if $(findstring vc10, $(VCVERSION)),/Qvc10)
  110. endif
  111. ifeq ($(VCCOMPAT_FLAG),)
  112. VCCOMPAT_FLAG := $(if $(findstring vc11, $(VCVERSION)),/Qvc11)
  113. endif
  114. ifeq ($(VCCOMPAT_FLAG),)
  115. $(error VC version not detected correctly: $(VCVERSION) )
  116. endif
  117. export VCCOMPAT_FLAG
  118. #------------------------------------------------------------------------------
  119. # End of setting compiler flags.
  120. #------------------------------------------------------------------------------
  121. #------------------------------------------------------------------------------
  122. # Setting assembler data.
  123. #------------------------------------------------------------------------------
  124. ASSEMBLY_SOURCE=$(arch)-masm
  125. ifeq (intel64,$(arch))
  126. ASM=ml64 /nologo
  127. ASM_FLAGS += /DEM64T=1 /c /Zi
  128. TBB_ASM.OBJ = atomic_support.obj intel64_misc.obj
  129. MALLOC_ASM.OBJ = atomic_support.obj
  130. else
  131. ASM=ml /nologo
  132. ASM_FLAGS += /c /coff /Zi /safeseh
  133. TBB_ASM.OBJ = atomic_support.obj lock_byte.obj
  134. endif
  135. #------------------------------------------------------------------------------
  136. # End of setting assembler data.
  137. #------------------------------------------------------------------------------
  138. #------------------------------------------------------------------------------
  139. # Setting tbbmalloc data.
  140. #------------------------------------------------------------------------------
  141. M_CPLUS_FLAGS = $(subst $(EH_FLAGS),/EHs-,$(CPLUS_FLAGS))
  142. #------------------------------------------------------------------------------
  143. # End of setting tbbmalloc data.
  144. #------------------------------------------------------------------------------
  145. #------------------------------------------------------------------------------
  146. # End of define compiler-specific variables.
  147. #------------------------------------------------------------------------------