blob: 669f4dce46bfd4755cf4f9c7609af1a4a4a247be [file] [log] [blame]
# Copyright 2005-2010 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
# Threading Building Blocks is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# Threading Building Blocks is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Threading Building Blocks; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# As a special exception, you may use this file as part of a free software
# library without restriction. Specifically, if other files instantiate
# templates or use macros or inline functions from this file, or you compile
# this file and link it with other files to produce an executable, this
# file does not by itself cause the resulting executable to be covered by
# the GNU General Public License. This exception does not however
# invalidate any other reasons why the executable file might be covered by
# the GNU General Public License.
#------------------------------------------------------------------------------
# Define rules for making the TBB shared library.
#------------------------------------------------------------------------------
tbb_root ?= "$(TBB30_INSTALL_DIR)"
BUILDING_PHASE=1
include $(tbb_root)/build/common.inc
DEBUG_SUFFIX=$(findstring _debug,_$(cfg))
#------------------------------------------------------------
# Define static pattern rules dealing with .cpp source files
#------------------------------------------------------------
$(warning CONFIG: cfg=$(cfg) arch=$(arch) compiler=$(compiler) os=$(tbb_os) runtime=$(runtime))
default_tbb: $(TBB.DLL)
.PHONY: default_tbb tbbvars clean
.PRECIOUS: %.$(OBJ)
VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/old $(tbb_root)/src/rml/client
CPLUS_FLAGS += $(PIC_KEY) $(DEFINE_KEY)__TBB_BUILD=1
ifeq (1,$(TBB_NOSTRICT))
# GNU 3.2.3 headers have a ISO syntax that is rejected by Intel compiler in -strict_ansi mode.
# The Mac uses gcc, so the list is empty for that platform.
# The files below need the -strict_ansi flag downgraded to -ansi to compile
KNOWN_NOSTRICT = concurrent_hash_map.o \
concurrent_queue.o \
concurrent_vector_v2.o \
concurrent_vector.o \
task.o \
task_group_context.o \
governor.o \
market.o \
arena.o \
scheduler.o \
observer_proxy.o \
tbb_main.o \
task_v2.o
endif
# Object files (that were compiled from C++ code) that gmake up TBB
TBB_CPLUS.OBJ = concurrent_hash_map.$(OBJ) \
concurrent_queue.$(OBJ) \
concurrent_vector.$(OBJ) \
dynamic_link.$(OBJ) \
itt_notify.$(OBJ) \
cache_aligned_allocator.$(OBJ) \
pipeline.$(OBJ) \
queuing_mutex.$(OBJ) \
queuing_rw_mutex.$(OBJ) \
reader_writer_lock.$(OBJ) \
spin_rw_mutex.$(OBJ) \
spin_mutex.$(OBJ) \
critical_section.$(OBJ) \
task.$(OBJ) \
tbb_misc.$(OBJ) \
mutex.$(OBJ) \
recursive_mutex.$(OBJ) \
condition_variable.$(OBJ) \
tbb_thread.$(OBJ) \
concurrent_monitor.$(OBJ) \
private_server.$(OBJ) \
rml_tbb.$(OBJ) \
task_group_context.$(OBJ) \
governor.$(OBJ) \
market.$(OBJ) \
arena.$(OBJ) \
scheduler.$(OBJ) \
observer_proxy.$(OBJ) \
tbb_main.$(OBJ)
# OLD/Legacy object files for backward binary compatibility
ifeq (,$(findstring $(DEFINE_KEY)TBB_NO_LEGACY,$(CPLUS_FLAGS)))
TBB_CPLUS_OLD.OBJ = \
concurrent_vector_v2.$(OBJ) \
concurrent_queue_v2.$(OBJ) \
spin_rw_mutex_v2.$(OBJ) \
task_v2.$(OBJ)
endif
# Object files that gmake up TBB (TBB_ASM.OBJ is platform-specific)
TBB.OBJ = $(TBB_CPLUS.OBJ) $(TBB_CPLUS_OLD.OBJ) $(TBB_ASM.OBJ)
# Suppress superfluous warnings for TBB compilation
WARNING_KEY += $(WARNING_SUPPRESS)
include $(tbb_root)/build/common_rules.inc
ifneq (,$(TBB.DEF))
tbb.def: $(TBB.DEF)
$(CMD) "$(CPLUS) $(PREPROC_ONLY) $(TBB.DEF) $(INCLUDES) $(CPLUS_FLAGS) >tbb.def 2>$(NUL) || exit 0"
LIB_LINK_FLAGS += $(EXPORT_KEY)tbb.def
$(TBB.DLL): tbb.def
endif
tbbvars.sh:
$(MAKE_TBBVARS)
$(TBB.DLL): BUILDING_LIBRARY = $(TBB.DLL)
$(TBB.DLL): $(TBB.OBJ) $(TBB.RES) tbbvars.sh $(TBB_NO_VERSION.DLL)
# $(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(TBB.DLL) $(TBB.OBJ) $(TBB.RES) $(LIB_LINK_LIBS) $(LIB_LINK_FLAGS)
$(AR) rcs libtbb.a $(TBB.OBJ)
$(RANLIB) libtbb.a
ifneq (,$(TBB_NO_VERSION.DLL))
$(TBB_NO_VERSION.DLL):
echo "INPUT ($(TBB.DLL))" > $(TBB_NO_VERSION.DLL)
endif
#clean:
# $(RM) *.$(OBJ) *.$(DLL) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9]
# Include automatically generated dependences
-include *.d