22PKG_CXXFLAGS = @CXX11STD@
33
44ifdef TBB_INC
5- PKG_CPPFLAGS = -I../inst/include -I$(TBB_INC)
5+ PKG_CPPFLAGS = -I../inst/include -I$(TBB_INC)
66else
7- PKG_CPPFLAGS = -I../inst/include
7+ PKG_CPPFLAGS = -I../inst/include
88endif
99
1010ifdef TBB_LIB
11- PKG_LIBS = -Wl,-L,"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc
11+ PKG_LIBS = -Wl,-L,"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc
1212endif
1313
1414ifeq ($(OS), Windows_NT)
1515
1616 USE_TBB=Windows
1717 TBB_COPY_PATTERN=tbb*.dll
18-
18+
1919 MAKE = make
2020 MAKEFLAGS = -e -s -j1
2121 MAKE_CMD = \
4545 endif
4646 endif
4747
48- MAKEFLAGS = -e -s
48+ MAKEFLAGS + = -e -s
4949 MAKE_CMD = \
5050 CONLY="@CC@ $(PKG_CPPFLAGS) @CPPFLAGS@" \
5151 CPLUS="@CXX11@ $(PKG_CPPFLAGS) @CPPFLAGS@" \
@@ -83,18 +83,18 @@ endif
8383
8484# For Solaris detect if this is 32-bit R on x86 and if so forward that to TBB
8585ifeq ($(USE_TBB), SunOS)
86- R_32BIT = $(shell ${R_HOME}/bin/Rscript -e 'cat(.Machine$$sizeof.pointer == 4)')
87- ifeq ($(R_32BIT), TRUE)
88- MAKE_ARGS += arch=ia32
89- endif
86+ R_32BIT = $(shell ${R_HOME}/bin/Rscript -e 'cat(.Machine$$sizeof.pointer == 4)')
87+ ifeq ($(R_32BIT), TRUE)
88+ MAKE_ARGS += arch=ia32
89+ endif
9090endif
9191
9292# Silence some compilation warnings. This is a dirty trick, but is necessary
9393# as TBB uses a number of #pragmas and compiler-specific switches depending
9494# on the compiler and machine being compiled for, and it selects and activates
9595# those switches only after confirming the specific compiler features it needs.
9696ifneq ($(OS), Windows_NT)
97- MAKE_ARGS += >/dev/null 2>&1
97+ MAKE_ARGS += >/dev/null 2>&1
9898endif
9999
100100.PHONY: all tbb
@@ -108,13 +108,18 @@ ifdef TBB_LIB
108108 mkdir -p ../inst/lib/$(ARCH_DIR); \
109109 cp $(TBB_LIB)/libtbb.so ../inst/lib/$(ARCH_DIR)/libtbb.so 2>/dev/null || :; \
110110 cp $(TBB_LIB)/libtbbmalloc.so ../inst/lib/$(ARCH_DIR)/libtbbmalloc.so 2>/dev/null || :; \
111+ rm -Rf ../inst/include/serial/; \
112+ rm -Rf ../inst/include/tbb/; \
113+ rm -Rf ../inst/include/tbb_local/; \
111114 mkdir -p ../inst/include; \
112115 cp -R $(TBB_INC)/serial ../inst/include/ 2>/dev/null || :; \
113116 cp -R $(TBB_INC)/oneapi ../inst/include/ 2>/dev/null || :; \
114117 cp -R $(TBB_INC)/tbb ../inst/include/ 2>/dev/null || :
115118else
116119 echo "Using bundled TBB library ..."; \
117- mkdir -p ../inst/lib/$(ARCH_DIR); \
120+ rm -Rf ../inst/include/serial/; \
121+ rm -Rf ../inst/include/tbb/; \
122+ rm -Rf ../inst/include/tbb_local/; \
118123 cp -R tbb/include/* ../inst/include/; \
119124 cd tbb/src; \
120125 if [ -n "$(shell echo $(CC) | grep clang)" ]; then \
125130 $(MAKE_CMD) stdver=@STDVER@ $(MAKE_ARGS); \
126131 fi; \
127132 cd ../..; \
133+ mkdir -p ../inst/lib/$(ARCH_DIR); \
128134 cp tbb/build/lib_release/$(TBB_COPY_PATTERN) ../inst/lib/$(ARCH_DIR)
129135endif
130136
0 commit comments