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.

141 lines
4.7 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. ####### Detections and Commands ###############################################
  27. ifeq (icc,$(compiler))
  28. export COMPILER_VERSION := ICC: $(shell icc -V </dev/null 2>&1 | grep 'Version')
  29. ifneq (,$(findstring IA-32, $(COMPILER_VERSION)))
  30. export arch:=ia32
  31. endif
  32. ifneq (,$(findstring Intel(R) 64, $(COMPILER_VERSION)))
  33. export arch:=intel64
  34. endif
  35. ifneq (,$(findstring IA-64, $(COMPILER_VERSION)))
  36. export arch:=ia64
  37. endif
  38. ifeq (,$(arch))
  39. $(warning "Unknown Intel compiler")
  40. endif
  41. endif
  42. ifndef arch
  43. uname_m:=$(shell uname -m)
  44. ifeq ($(uname_m),i686)
  45. export arch:=ia32
  46. endif
  47. ifeq ($(uname_m),ia64)
  48. export arch:=ia64
  49. endif
  50. ifeq ($(uname_m),x86_64)
  51. export arch:=intel64
  52. endif
  53. ifeq ($(uname_m),sparc64)
  54. export arch:=sparc
  55. endif
  56. ifndef arch
  57. export arch:=$(uname_m)
  58. endif
  59. endif
  60. ifndef runtime
  61. gcc_version = $(shell gcc -dumpversion)
  62. os_version:=$(shell uname -r)
  63. os_kernel_version:=$(shell uname -r | sed -e 's/-.*$$//')
  64. export os_glibc_version_full:=$(shell getconf GNU_LIBC_VERSION | grep glibc | sed -e 's/^glibc //')
  65. os_glibc_version:=$(shell echo "$(os_glibc_version_full)" | sed -e '2,$$d' -e 's/-.*$$//')
  66. export runtime:=cc$(gcc_version)_libc$(os_glibc_version)_kernel$(os_kernel_version)
  67. endif
  68. native_compiler := gcc
  69. export compiler ?= gcc
  70. debugger ?= gdb
  71. CMD=sh -c
  72. CWD=$(shell pwd)
  73. CP=cp
  74. RM?=rm -f
  75. RD?=rmdir
  76. MD?=mkdir -p
  77. NUL= /dev/null
  78. SLASH=/
  79. MAKE_VERSIONS=sh $(tbb_root)/build/version_info_linux.sh $(CPLUS) $(CPLUS_FLAGS) $(INCLUDES) >version_string.ver
  80. MAKE_TBBVARS=sh $(tbb_root)/build/generate_tbbvars.sh
  81. ifdef LD_LIBRARY_PATH
  82. export LD_LIBRARY_PATH := .:$(LD_LIBRARY_PATH)
  83. else
  84. export LD_LIBRARY_PATH := .
  85. endif
  86. ####### Build settings ########################################################
  87. OBJ = o
  88. DLL = so
  89. LIBEXT = so
  90. SONAME_SUFFIX =$(shell grep TBB_COMPATIBLE_INTERFACE_VERSION $(tbb_root)/include/tbb/tbb_stddef.h | egrep -o [0-9.]+)
  91. ifeq ($(arch),ia64)
  92. def_prefix = lin64ipf
  93. endif
  94. ifeq ($(arch),sparc)
  95. def_prefix = lin64
  96. endif
  97. ifeq (,$(def_prefix))
  98. ifeq (64,$(findstring 64,$(arch)))
  99. def_prefix = lin64
  100. else
  101. def_prefix = lin32
  102. endif
  103. endif
  104. TBB.LST = $(tbb_root)/src/tbb/$(def_prefix)-tbb-export.lst
  105. TBB.DEF = $(TBB.LST:.lst=.def)
  106. TBB.DLL = $(TBB_NO_VERSION.DLL).$(SONAME_SUFFIX)
  107. TBB.LIB = $(TBB.DLL)
  108. TBB_NO_VERSION.DLL=libtbb$(CPF_SUFFIX)$(DEBUG_SUFFIX).$(DLL)
  109. LINK_TBB.LIB = $(TBB_NO_VERSION.DLL)
  110. MALLOC_NO_VERSION.DLL = libtbbmalloc$(DEBUG_SUFFIX).$(DLL)
  111. MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
  112. MALLOC.DLL = $(MALLOC_NO_VERSION.DLL).$(SONAME_SUFFIX)
  113. MALLOC.LIB = $(MALLOC_NO_VERSION.DLL)
  114. LINK_MALLOC.LIB = $(MALLOC_NO_VERSION.DLL)
  115. MALLOCPROXY_NO_VERSION.DLL = libtbbmalloc_proxy$(DEBUG_SUFFIX).$(DLL)
  116. MALLOCPROXY.DEF = $(MALLOC_ROOT)/$(def_prefix)-proxy-export.def
  117. MALLOCPROXY.DLL = $(MALLOCPROXY_NO_VERSION.DLL).$(SONAME_SUFFIX)
  118. MALLOCPROXY.LIB = $(MALLOCPROXY_NO_VERSION.DLL)
  119. LINK_MALLOCPROXY.LIB = $(MALLOCPROXY.LIB)
  120. RML_NO_VERSION.DLL = libirml$(DEBUG_SUFFIX).$(DLL)
  121. RML.DEF = $(RML_SERVER_ROOT)/lin-rml-export.def
  122. RML.DLL = $(RML_NO_VERSION.DLL).1
  123. RML.LIB = $(RML_NO_VERSION.DLL)
  124. TBB_NOSTRICT=1
  125. TEST_LAUNCHER=sh $(tbb_root)/build/test_launcher.sh $(largs)