@@ -84,7 +84,7 @@ ifdef USE_TBB
8484PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=1
8585PKG_CXXFLAGS += -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1
8686
87- MAKE_ARGS := tbb_release tbbmalloc_release tbb_build_prefix=lib
87+ MAKE_TARGETS = tbb_build_prefix=lib tbb_release tbbmalloc_release
8888
8989ifeq ($(USE_TBB), Windows)
9090
@@ -101,7 +101,7 @@ ifeq ($(USE_TBB), Windows)
101101
102102 # Linker needs access to the tbb dll; otherwise you get errors such as:
103103 # "undefined reference to `tbb::task_scheduler_init::terminate()'"
104- PKG_LIBS += -L../inst/libs/$(ARCH_DIR) -ltbb -ltbbmalloc
104+ PKG_LIBS += -L$(shell pwd)/tbb/build/lib_release -ltbb -ltbbmalloc
105105
106106endif
107107
@@ -113,15 +113,10 @@ ifeq ($(USE_TBB), SunOS)
113113 endif
114114endif
115115
116- # Override arch (mainly for arm64 macOS)
117- ifneq ("$(ARCH)",)
118- MAKE_ARGS += $(ARCH)
119- endif
120-
121116# Write compilation output to file, and log it if installation fails.
122117ifeq ($(VERBOSE),)
123- MAKE_ARGS + = > tbb.log 2>&1 \
124- && echo "(tbb) TBB successfully built and installed ." \
118+ MAKE_LOG = > tbb.log 2>&1 \
119+ && echo "(tbb) TBB compilation finished successfully ." \
125120 || cat tbb.log; rm -f tbb.log
126121endif
127122
@@ -138,17 +133,17 @@ $(OBJECTS): tbb
138133# However, we need to copy headers here so that they are visible during compilation.
139134tbb: tbb-clean
140135ifdef TBB_LIB
141- @echo "(tbb) Using system (Intel/ OneAPI) TBB library .. ."
136+ @echo "(tbb) Using system (Intel / OneAPI) TBB library."
142137 @echo "(tbb) TBB_LIB = $(TBB_LIB)"
143138 @echo "(tbb) TBB_INC = $(TBB_INC)"
144139 @mkdir -p ../inst/include
145140 @cp -R $(TBB_INC)/* ../inst/include/
146141else
147- @echo "(tbb) Using bundled TBB library ..."
142+ @echo "(tbb) Building TBB using bundled sources ..."
148143 @mkdir -p ../inst/include
149144 @cp -R tbb/include/* ../inst/include/
150- @(cd tbb/src && $(MAKE_CMD) info)
151- @(cd tbb/src && $(MAKE_CMD) @STDVER@ $(MAKE_ARGS))
145+ @(cd tbb/src && $(MAKE_CMD) $(MAKE_ARGS) info)
146+ @(cd tbb/src && $(MAKE_CMD) @STDVER@ $(MAKE_ARGS) $(MAKE_TARGETS) $(MAKE_LOG) )
152147endif
153148
154149tbb-clean:
@@ -157,11 +152,11 @@ tbb-clean:
157152 @rm -rf ../inst/include/tbb_local
158153 @rm -rf ../inst/include/serial
159154
160- clean:
155+ clean: tbb-clean
161156ifdef TBB_LIB
162- echo "Nothing to clean for TBB."
157+ @ echo "Nothing to clean for TBB."
163158else
164- (cd tbb/src; make clean)
159+ @ (cd tbb/src; make clean)
165160endif
166161
167162
0 commit comments