-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathMakefile
More file actions
265 lines (199 loc) · 11.2 KB
/
Makefile
File metadata and controls
265 lines (199 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# Copyright (c) 2005-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
tbb_root?=..
examples_root:=$(tbb_root)/examples
include $(tbb_root)/build/common.inc
#workaround for non-depend targets tbb and tbbmalloc which both depend on version_string.ver
#According to documentation, recursively invoked make commands can process their targets in parallel
.NOTPARALLEL:
.PHONY: all tbb tbbmalloc tbbproxy test test_no_depends release debug examples clean
all: release debug examples
tbb: tbb_release tbb_debug
tbbmalloc: tbbmalloc_release tbbmalloc_debug
tbbproxy: tbbproxy_release tbbproxy_debug
rml: rml_release rml_debug
test: tbbmalloc_test_release $(if $(use_proxy),tbbproxy_test_release) tbb_test_release tbbmalloc_test_debug $(if $(use_proxy),tbbproxy_test_debug) tbb_test_debug
ifeq (,$(findstring skip,$(target:android=skip) $(offload:mic=skip)))
test: rml_test_debug rml_test_release
endif
test_no_depends: tbbmalloc_test_release_no_depends $(if $(use_proxy),tbbproxy_test_release_no_depends) tbb_test_release_no_depends tbbmalloc_test_debug_no_depends $(if $(use_proxy),tbbproxy_test_debug_no_depends) tbb_test_debug_no_depends
@echo done
release: tbb_release tbbmalloc_release $(if $(use_proxy),tbbproxy_release)
release: $(call cross_cfg,tbbmalloc_test_release) $(call cross_cfg,test_release)
debug: tbb_debug tbbmalloc_debug $(if $(use_proxy),tbbproxy_debug)
debug: $(call cross_cfg,tbbmalloc_test_debug) $(call cross_cfg, test_debug)
examples: tbb tbbmalloc examples_debug clean_examples examples_release
examples_no_depends: examples_release_no_depends examples_debug_no_depends
clean: clean_release clean_debug clean_examples
@echo clean done
.PHONY: full
full:
$(MAKE) -sir --no-print-directory -f Makefile tbb_root=.. clean all
ifeq ($(tbb_os),windows)
$(MAKE) -sir --no-print-directory -f Makefile tbb_root=.. compiler=icl clean all native_examples
else
$(MAKE) -sir --no-print-directory -f Makefile tbb_root=.. compiler=icc clean all native_examples
endif
ifeq ($(arch),intel64)
$(MAKE) -sir --no-print-directory -f Makefile tbb_root=.. arch=ia32 clean all
endif
# it doesn't test compiler=icc arch=ia32 on intel64 systems due to environment settings of icc
native_examples: tbb tbbmalloc
$(MAKE) -C $(examples_root) -r -f Makefile tbb_root=.. compiler=$(native_compiler) debug test
$(MAKE) -C $(examples_root) -r -f Makefile tbb_root=.. compiler=$(native_compiler) clean release test
../examples/% examples/%::
$(MAKE) -C $(examples_root) -r -f Makefile tbb_root=.. $(subst examples/,,$(subst ../,,$@))
debug_%:: cfg:=$(if $(findstring file,$(origin cfg)),debug,$(cfg))
debug_%:: export run_cmd=$(debugger)
debug_malloc_% test_malloc_% debug_ScalableAlloc% test_ScalableAlloc%:: TESTFILE=tbbmalloc
debug_rml_% test_rml_%:: TESTFILE=rml
debug_runtime_load% test_runtime_load%:: TESTFILE=tbbproxy
debug_% test_% stress_% time_% perf_%:: TESTFILE?=test
debug_% test_% stress_% time_% perf_%::
$(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.$(TESTFILE) cfg=$(cfg) $(subst .cpp,,$@)
clean_%::
ifeq ($(origin cfg),file)
@$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release $@
@$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.test cfg=debug $@
else
@$(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.test $@
endif
python_%: mkdir_release
$(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/Makefile $(subst python_,,$@)
.PHONY: test_release test_debug test_release_no_depends test_debug_no_depends
.PHONY: tbb_release tbb_debug tbb_test_release tbb_test_debug tbb_test_release_no_depends tbb_test_debug_no_depends
# do not delete double-space after -C option
tbb_release: mkdir_release
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbb cfg=release
tbb_debug: mkdir_debug
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbb cfg=debug
tbb_test: tbb_test_release tbb_test_debug
tbb_test_release: $(call cross_cfg,tbb_release) $(if $(use_proxy),$(call cross_cfg,tbbproxy_release)) tbb_test_release_no_depends
tbb_test_release_no_depends:$(call cross_cfg,mkdir_release)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_release)" -r -f $(tbb_root)/build/Makefile.test cfg=release
tbb_test_debug: $(call cross_cfg,tbb_debug) $(if $(use_proxy),$(call cross_cfg,tbbproxy_debug)) tbb_test_debug_no_depends
tbb_test_debug_no_depends:$(call cross_cfg,mkdir_debug)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_debug)" -r -f $(tbb_root)/build/Makefile.test cfg=debug
# backward compatibility
test_release: tbb_test_release
test_debug: tbb_test_debug
test_release_no_depends: tbb_test_release_no_depends
test_debug_no_depends: tbb_test_debug_no_depends
.PHONY: tbbmalloc_release tbbmalloc_debug
.PHONY: tbbmalloc_dll_release tbbmalloc_dll_debug tbbmalloc_proxy_dll_release tbbmalloc_proxy_dll_debug
.PHONY: tbbmalloc_test tbbmalloc_test_release tbbmalloc_test_debug tbbmalloc_test_release_no_depends tbbmalloc_test_debug_no_depends
tbbmalloc_release: mkdir_release
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc
tbbmalloc_debug: mkdir_debug
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc
tbbmalloc_dll_release: mkdir_release
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_dll
tbbmalloc_proxy_dll_release: mkdir_release
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_proxy_dll
tbbmalloc_dll_debug: mkdir_debug
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_dll
tbbmalloc_proxy_dll_debug: mkdir_debug
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_proxy_dll
tbbmalloc_test: tbbmalloc_test_release tbbmalloc_test_debug
tbbmalloc_test_release: $(call cross_cfg,tbbmalloc_release) tbbmalloc_test_release_no_depends
tbbmalloc_test_release_no_depends: $(call cross_cfg,mkdir_release)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_release)" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test_no_depends
tbbmalloc_test_debug: $(call cross_cfg,tbbmalloc_debug) tbbmalloc_test_debug_no_depends
tbbmalloc_test_debug_no_depends: $(call cross_cfg,mkdir_debug)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_debug)" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_test_no_depends
.PHONY: tbbproxy_release tbbproxy_debug
.PHONY: tbbproxy_test tbbproxy_test_release tbbproxy_test_debug tbbproxy_test_release_no_depends tbbproxy_test_debug_no_depends
tbbproxy_release: mkdir_release tbb_release
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=release tbbproxy
tbbproxy_debug: mkdir_debug tbb_debug
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=debug tbbproxy
tbbproxy_test: tbbproxy_test_release tbbproxy_test_debug
tbbproxy_test_release: $(call cross_cfg,tbb_release) $(call cross_cfg,tbbproxy_release) tbbproxy_test_release_no_depends
tbbproxy_test_release_no_depends:$(call cross_cfg,mkdir_release)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_release)" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=release tbbproxy_test
tbbproxy_test_debug: $(call cross_cfg,tbb_debug) $(call cross_cfg,tbbproxy_debug) tbbproxy_test_debug_no_depends
tbbproxy_test_debug_no_depends: $(call cross_cfg,mkdir_debug)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_debug)" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=debug tbbproxy_test
.PHONY: rml_release rml_debug rml_test_release rml_test_debug
.PHONY: rml_test_release_no_depends rml_test_debug_no_depends
rml_release: mkdir_release
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.rml cfg=release rml
rml_debug: mkdir_debug
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.rml cfg=debug rml
rml_test: rml_test_release rml_test_debug
rml_test_release: $(call cross_cfg,rml_release) rml_test_release_no_depends
rml_test_release_no_depends: $(call cross_cfg,mkdir_release)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_release)" -r -f $(tbb_root)/build/Makefile.rml cfg=release rml_test
rml_test_debug: $(call cross_cfg,rml_debug) rml_test_debug_no_depends
rml_test_debug_no_depends: $(call cross_cfg,mkdir_debug)
$(MAKE) -C "$(call cross_cfg,$(work_dir)_debug)" -r -f $(tbb_root)/build/Makefile.rml cfg=debug rml_test
.PHONY: examples_release examples_debug examples_release_no_depends examples_debug_no_depends
examples_release: tbb_release tbbmalloc_release examples_release_no_depends
examples_release_no_depends:
$(MAKE) -C $(examples_root) -r -f Makefile tbb_root=.. release test UI=con
examples_debug: tbb_debug tbbmalloc_debug examples_debug_no_depends
examples_debug_no_depends:
$(MAKE) -C $(examples_root) -r -f Makefile tbb_root=.. debug test UI=con
.PHONY: clean_release clean_debug clean_examples
clean_release:
$(shell $(RM) $(work_dir)_release$(SLASH)*.* >$(NUL) 2>$(NUL))
$(shell $(RD) $(work_dir)_release >$(NUL) 2>$(NUL))
clean_debug:
$(shell $(RM) $(work_dir)_debug$(SLASH)*.* >$(NUL) 2>$(NUL))
$(shell $(RD) $(work_dir)_debug >$(NUL) 2>$(NUL))
clean_examples:
$(shell $(MAKE) -s -i -r -C $(examples_root) -f Makefile tbb_root=.. clean >$(NUL) 2>$(NUL))
.PHONY: mkdir_release mkdir_debug codecov do_codecov info tbbvars shell
mkdir_release:
$(shell $(MD) "$(work_dir)_release" >$(NUL) 2>$(NUL))
@echo Created $(work_dir)_release directory
mkdir_debug:
$(shell $(MD) "$(work_dir)_debug" >$(NUL) 2>$(NUL))
@echo Created $(work_dir)_debug directory
ifeq ($(compiler),$(if $(findstring windows,$(tbb_os)),icl,icc))
codecov: codecov=yes
codecov: do_codecov
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release codecov_gen
else
codecov:
$(error Only Intel(R) C++ Compiler is supported for code coverage)
endif
export codecov
do_codecov: tbb_root=..
do_codecov:
$(MAKE) RML=yes tbbmalloc_test_release test_release
$(MAKE) clean_test_* cfg=release
$(MAKE) RML=yes crosstest=yes tbbmalloc_test_debug test_debug
$(MAKE) clean_test_* cfg=release
$(MAKE) rml_test_release
$(MAKE) clean_test_* cfg=release
$(MAKE) crosstest=yes rml_test_debug
info:
@echo OS: $(tbb_os)
@echo arch=$(arch)
@echo compiler=$(compiler)
@echo runtime=$(runtime)
@echo tbb_build_prefix=$(tbb_build_prefix)
@echo work_dir=$(abspath $(tbb_build_dir)$(SLASH)$(tbb_build_prefix)_$(cfg))
# [usage]$ source `make <options> tbbvars`.sh
tbbvars:
@echo $(tbb_build_dir)$(SLASH)$(tbb_build_prefix)_$(cfg)$(SLASH)tbbvars
symbols: args=$(if $(findstring cl,$(compiler)), dumpbin /section:.text *.obj|findstr COMDAT , nm -Pg *.o|grep ' T '|cut -f1 -d' ')
symbols: shell
shell:
ifdef BUILDING_PHASE
-$(run_cmd) $(shell_cmd)
else
@$(MAKE) -C "$(work_dir)_$(cfg)" -rf $(tbb_root)/src/Makefile BUILDING_PHASE=1 shell shell_cmd="$(if $(args),$(args),$(SHELL))"
endif