star-build

Automation tool for project installation
git clone git://git.meso-star.com/star-build.git
Log | Files | Refs | README | LICENSE

tbb.mk.in (2121B)


      1 # Copyright (C) 2023-2026 |Méso|Star> (contact@meso-star.com)
      2 #
      3 # This file is part of Star-Build.
      4 #
      5 # Star-Build is free software: you can redistribute it and/or modify
      6 # it under the terms of the GNU General Public License as published by
      7 # the Free Software Foundation, either version 3 of the License, or
      8 # (at your option) any later version.
      9 #
     10 # Star-Build is distributed in the hope that it will be useful,
     11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     13 # GNU General Public License for more details.
     14 #
     15 # You should have received a copy of the GNU General Public License
     16 # along with Star-Build. If not, see <http://www.gnu.org/licenses/>.
     17 
     18 # Configuration macros
     19 TBB_TAG = @TAG@
     20 TBB_URL_ONLINE = https://github.com/oneapi-src/oneTBB
     21 TBB_URL_OFFLINE = $(MIRROR)/oneTBB
     22 TBB_URL = $(TBB_URL_$(NETWORK))
     23 
     24 # Helper macros
     25 TBB_DIR = $(CACHE)/TBB/$(TBB_TAG)
     26 TBB_CMAKE_OPTIONS =\
     27  -G "Unix Makefiles"\
     28  -DCMAKE_BUILD_TYPE=Release\
     29  -DCMAKE_INSTALL_LIBDIR="lib"\
     30  -DTBB_BUILD=ON\
     31  -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=ON\
     32  -DTBBMALLOC_BUILD=ON\
     33  -DTBBMALLOC_PROXY_BUILD=OFF\
     34  -DTBB_TEST=OFF
     35 
     36 tbb: build_tbb prefix
     37 	prefix="$$(cat .prefix)" && \
     38 	cd -- $(TBB_DIR)/build && \
     39 	cmake -DCMAKE_INSTALL_PREFIX="$${prefix}" .. && \
     40 	$(MAKE) install
     41 
     42 build_tbb: $(TBB_DIR)
     43 	@cd -- $(TBB_DIR)/build && \
     44 	cmake $(TBB_CMAKE_OPTIONS) .. && \
     45 	$(MAKE)
     46 
     47 $(TBB_DIR):
     48 	git clone --branch $(TBB_TAG) --depth 1 $(TBB_URL) "$@"
     49 	mkdir -p "$@/build"
     50 
     51 clean_tbb:
     52 	if [ -d $(TBB_DIR)/build ]; then \
     53 		cd -- $(TBB_DIR)/build && $(MAKE) clean; \
     54 	fi
     55 
     56 uninstall_tbb: prefix
     57 	@prefix=$$(cat .prefix) && \
     58 	cd -- "$(TBB_DIR)/build" && \
     59 	cmake -DCMAKE_INSTALL_PREFIX="$${prefix}" .. && \
     60 	$(MAKE) install
     61 	xargs rm -f < "$(TBB_DIR)/build/install_manifest.txt"
     62 
     63 mirror_tbb:
     64 	repo="$$(echo $(TBB_URL) | sed 's/[\/]\{0,\}$$//g')" && \
     65 	repo="$(MIRROR)/$${repo##*/}" && \
     66 	rm -rf "$${repo}" && \
     67 	git clone --bare --branch $(TBB_TAG) $(MIRROR_GIT_OPT) \
     68 	  $(TBB_URL) "$${repo}"
     69 
     70 clean_all: clean_tbb
     71 install_all: tbb
     72 uninstall_all: uninstall_tbb
     73 mirror_all: mirror_tbb