|
| 1 | +# Copyright (c) 2005-2017 Intel Corporation |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# |
| 15 | +# |
| 16 | +# |
| 17 | +# |
| 18 | + |
| 19 | +COMPILE_ONLY = -c -MMD |
| 20 | +PREPROC_ONLY = -E -x c++ |
| 21 | +INCLUDE_KEY = -I |
| 22 | +DEFINE_KEY = -D |
| 23 | +OUTPUT_KEY = -o # |
| 24 | +OUTPUTOBJ_KEY = -o # |
| 25 | +PIC_KEY = -fPIC |
| 26 | +WARNING_AS_ERROR_KEY = -Werror |
| 27 | +WARNING_KEY = -Wall |
| 28 | +TEST_WARNING_KEY = -Wextra -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor |
| 29 | +WARNING_SUPPRESS = -Wno-parentheses -Wno-non-virtual-dtor -Wno-dangling-else |
| 30 | +DYLIB_KEY = -shared |
| 31 | +EXPORT_KEY = -Wl,--version-script, |
| 32 | +LIBDL = |
| 33 | + |
| 34 | +CPLUS = clang++ |
| 35 | +CONLY = clang |
| 36 | +LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY) |
| 37 | +LIBS += -lpthread -lrt |
| 38 | +LINK_FLAGS = -Wl,-rpath-link=. -Wl,-rpath=. -rdynamic |
| 39 | +C_FLAGS = $(CPLUS_FLAGS) |
| 40 | + |
| 41 | +ifeq ($(cfg), release) |
| 42 | + CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD |
| 43 | +endif |
| 44 | +ifeq ($(cfg), debug) |
| 45 | + CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD |
| 46 | +endif |
| 47 | + |
| 48 | +ifneq (,$(stdlib)) |
| 49 | + CPLUS_FLAGS += -stdlib=$(stdlib) |
| 50 | + LIB_LINK_FLAGS += -stdlib=$(stdlib) |
| 51 | +endif |
| 52 | + |
| 53 | +TBB_ASM.OBJ= |
| 54 | +MALLOC_ASM.OBJ= |
| 55 | + |
| 56 | +ifeq (intel64,$(arch)) |
| 57 | + ITT_NOTIFY = -DDO_ITT_NOTIFY |
| 58 | + CPLUS_FLAGS += -m64 |
| 59 | + LIB_LINK_FLAGS += -m64 |
| 60 | +endif |
| 61 | + |
| 62 | +ifeq (ia32,$(arch)) |
| 63 | + ITT_NOTIFY = -DDO_ITT_NOTIFY |
| 64 | + CPLUS_FLAGS += -m32 -march=pentium4 |
| 65 | + LIB_LINK_FLAGS += -m32 |
| 66 | +endif |
| 67 | + |
| 68 | +ifeq (ppc64,$(arch)) |
| 69 | + CPLUS_FLAGS += -m64 |
| 70 | + LIB_LINK_FLAGS += -m64 |
| 71 | +endif |
| 72 | + |
| 73 | +ifeq (ppc32,$(arch)) |
| 74 | + CPLUS_FLAGS += -m32 |
| 75 | + LIB_LINK_FLAGS += -m32 |
| 76 | +endif |
| 77 | + |
| 78 | +ifeq (bg,$(arch)) |
| 79 | + CPLUS = bgclang++ |
| 80 | + CONLY = bgclang |
| 81 | +endif |
| 82 | + |
| 83 | +#------------------------------------------------------------------------------ |
| 84 | +# Setting assembler data. |
| 85 | +#------------------------------------------------------------------------------ |
| 86 | +ASM = as |
| 87 | +ifeq (intel64,$(arch)) |
| 88 | + ASM_FLAGS += --64 |
| 89 | +endif |
| 90 | +ifeq (ia32,$(arch)) |
| 91 | + ASM_FLAGS += --32 |
| 92 | +endif |
| 93 | +ifeq ($(cfg),debug) |
| 94 | + ASM_FLAGS += -g |
| 95 | +endif |
| 96 | + |
| 97 | +ASSEMBLY_SOURCE=$(arch)-gas |
| 98 | +#------------------------------------------------------------------------------ |
| 99 | +# End of setting assembler data. |
| 100 | +#------------------------------------------------------------------------------ |
| 101 | + |
| 102 | +#------------------------------------------------------------------------------ |
| 103 | +# Setting tbbmalloc data. |
| 104 | +#------------------------------------------------------------------------------ |
| 105 | + |
| 106 | +M_CPLUS_FLAGS = $(CPLUS_FLAGS) -fno-rtti -fno-exceptions |
| 107 | + |
| 108 | +#------------------------------------------------------------------------------ |
| 109 | +# End of setting tbbmalloc data. |
| 110 | +#------------------------------------------------------------------------------ |
0 commit comments