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.

126 lines
4.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. COMPILE_ONLY = -c -MMD
  27. PREPROC_ONLY = -E -x c++
  28. INCLUDE_KEY = -I
  29. DEFINE_KEY = -D
  30. OUTPUT_KEY = -o #
  31. OUTPUTOBJ_KEY = -o #
  32. PIC_KEY = -fPIC
  33. WARNING_AS_ERROR_KEY = -Werror
  34. WARNING_KEY = -w1
  35. DYLIB_KEY = -shared
  36. EXPORT_KEY = -Wl,--version-script,
  37. NOINTRINSIC_KEY = -fno-builtin
  38. LIBDL = -ldl
  39. TBB_NOSTRICT = 1
  40. CPLUS = icpc
  41. CONLY = icc
  42. ITT_NOTIFY = -DDO_ITT_NOTIFY
  43. ifeq (release,$(cfg))
  44. CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -g -DUSE_PTHREAD
  45. else
  46. CPLUS_FLAGS = $(ITT_NOTIFY) -O0 -g -DUSE_PTHREAD -DTBB_USE_DEBUG
  47. endif
  48. OPENMP_FLAG = -openmp
  49. LIB_LINK_FLAGS = -shared -i-static -Wl,-soname=$(BUILDING_LIBRARY)
  50. LIBS += -lpthread -lrt
  51. C_FLAGS = $(CPLUS_FLAGS)
  52. # ICC 11.0 and higher support -std=c++0x
  53. ifneq (,$(shell icc -dumpversion | egrep "^1[1-9]\."))
  54. CPP11_FLAGS = -std=c++0x -D_TBB_CPP0X
  55. endif
  56. # ICC 12.0 and higher provide Intel(R) Cilk Plus
  57. ifneq (,$(shell icc -dumpversion | egrep "^1[2-9]\."))
  58. CILK_AVAILABLE = yes
  59. endif
  60. TBB_ASM.OBJ=
  61. MALLOC_ASM.OBJ=
  62. ifeq (ia32,$(arch))
  63. CPLUS_FLAGS += -m32 -falign-stack=maintain-16-byte
  64. LIB_LINK_FLAGS += -m32
  65. endif
  66. ifeq (ia64,$(arch))
  67. ITT_NOTIFY =
  68. # Position-independent code (PIC) is a must on IA-64, even for regular (not shared) executables
  69. # strict-ansi does not work with <signal.h> on RHEL 4 AS
  70. CPLUS_FLAGS += $(PIC_KEY) $(if $(findstring cc3.,$(runtime)),-ansi,-strict-ansi)
  71. else
  72. CPLUS_FLAGS += -strict-ansi
  73. endif
  74. ifneq (,$(codecov))
  75. # no tool support for code coverage, need profile data generation
  76. ITT_NOTIFY = -prof-genx
  77. endif
  78. ifneq (00,$(lambdas)$(cpp0x))
  79. CPLUS_FLAGS += $(CPP11_FLAGS)
  80. endif
  81. #------------------------------------------------------------------------------
  82. # Setting assembler data.
  83. #------------------------------------------------------------------------------
  84. ASM = as
  85. ifeq (intel64,$(arch))
  86. ASM_FLAGS += --64
  87. endif
  88. ifeq (ia32,$(arch))
  89. ASM_FLAGS += --32
  90. endif
  91. ifeq ($(cfg),debug)
  92. ASM_FLAGS += -g
  93. endif
  94. ASSEMBLY_SOURCE=$(arch)-gas
  95. ifeq (ia64,$(arch))
  96. ASM_FLAGS += -xexplicit
  97. TBB_ASM.OBJ += atomic_support.o lock_byte.o log2.o pause.o ia64_misc.o
  98. MALLOC_ASM.OBJ += atomic_support.o lock_byte.o pause.o log2.o
  99. endif
  100. #------------------------------------------------------------------------------
  101. # End of setting assembler data.
  102. #------------------------------------------------------------------------------
  103. #------------------------------------------------------------------------------
  104. # Setting tbbmalloc data.
  105. #------------------------------------------------------------------------------
  106. M_CPLUS_FLAGS = $(CPLUS_FLAGS) -fno-rtti -fno-exceptions
  107. #------------------------------------------------------------------------------
  108. # End of setting tbbmalloc data.
  109. #------------------------------------------------------------------------------