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.

145 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. 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 = -Wall
  35. TEST_WARNING_KEY = -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor $(if $(findstring cc4., $(runtime)),-Wextra)
  36. WARNING_SUPPRESS = -Wno-parentheses -Wno-non-virtual-dtor
  37. DYLIB_KEY = -shared
  38. EXPORT_KEY = -Wl,--version-script,
  39. LIBDL = -ldl
  40. TBB_NOSTRICT = 1
  41. CPLUS = g++
  42. CONLY = gcc
  43. LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
  44. LIBS += -lpthread -lrt
  45. LINK_FLAGS = -Wl,-rpath-link=.
  46. C_FLAGS = $(CPLUS_FLAGS)
  47. # gcc 4.4 and higher support -std=c++0x
  48. ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[4-9]|[5-9])"))
  49. CPP11_FLAGS = -std=c++0x -D_TBB_CPP0X
  50. endif
  51. # gcc 4.2 and higher support OpenMP
  52. ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[2-9]|[5-9])"))
  53. OPENMP_FLAG = -fopenmp
  54. endif
  55. ifeq ($(cfg), release)
  56. CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
  57. endif
  58. ifeq ($(cfg), debug)
  59. CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
  60. endif
  61. ifneq (00,$(lambdas)$(cpp0x))
  62. CXX_ONLY_FLAGS += $(CPP11_FLAGS)
  63. endif
  64. TBB_ASM.OBJ=
  65. MALLOC_ASM.OBJ=
  66. ifeq (ia64,$(arch))
  67. # Position-independent code (PIC) is a must on IA-64, even for regular (not shared) executables
  68. CPLUS_FLAGS += $(PIC_KEY)
  69. endif
  70. ifeq (intel64,$(arch))
  71. ITT_NOTIFY = -DDO_ITT_NOTIFY
  72. CPLUS_FLAGS += -m64
  73. LIB_LINK_FLAGS += -m64
  74. endif
  75. ifeq (ia32,$(arch))
  76. ITT_NOTIFY = -DDO_ITT_NOTIFY
  77. CPLUS_FLAGS += -m32 -march=pentium4
  78. LIB_LINK_FLAGS += -m32
  79. endif
  80. ifeq (ppc64,$(arch))
  81. CPLUS_FLAGS += -m64
  82. LIB_LINK_FLAGS += -m64
  83. endif
  84. ifeq (ppc32,$(arch))
  85. CPLUS_FLAGS += -m32
  86. LIB_LINK_FLAGS += -m32
  87. endif
  88. ifeq (bgp,$(arch))
  89. CPLUS = mpicxx
  90. CONLY = mpicc
  91. endif
  92. # for some gcc versions on Solaris, -m64 may imply V9, but perhaps not everywhere (TODO: verify)
  93. ifeq (sparc,$(arch))
  94. CPLUS_FLAGS += -mcpu=v9 -m64
  95. LIB_LINK_FLAGS += -mcpu=v9 -m64
  96. endif
  97. #------------------------------------------------------------------------------
  98. # Setting assembler data.
  99. #------------------------------------------------------------------------------
  100. ASM = as
  101. ifeq (intel64,$(arch))
  102. ASM_FLAGS += --64
  103. endif
  104. ifeq (ia32,$(arch))
  105. ASM_FLAGS += --32
  106. endif
  107. ifeq ($(cfg),debug)
  108. ASM_FLAGS += -g
  109. endif
  110. ASSEMBLY_SOURCE=$(arch)-gas
  111. ifeq (ia64,$(arch))
  112. ASM_FLAGS += -xexplicit
  113. TBB_ASM.OBJ += atomic_support.o lock_byte.o log2.o pause.o ia64_misc.o
  114. MALLOC_ASM.OBJ += atomic_support.o lock_byte.o pause.o log2.o
  115. endif
  116. #------------------------------------------------------------------------------
  117. # End of setting assembler data.
  118. #------------------------------------------------------------------------------
  119. #------------------------------------------------------------------------------
  120. # Setting tbbmalloc data.
  121. #------------------------------------------------------------------------------
  122. M_CPLUS_FLAGS = $(CPLUS_FLAGS) -fno-rtti -fno-exceptions -fno-schedule-insns2
  123. #------------------------------------------------------------------------------
  124. # End of setting tbbmalloc data.
  125. #------------------------------------------------------------------------------