star-build

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

tbb.mk.in (2090B)


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