sleef.mk.in (1852B)
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 SLEEF_TAG = @TAG@ 18 SLEEF_URL = https://github.com/shibatch/sleef 19 20 # Helper macros 21 SLEEF_DIR = $(CACHE)/sleef/$(SLEEF_TAG) 22 SLEEF_CMAKE_OPTIONS =\ 23 -G "Unix Makefiles"\ 24 -DBUILD_TESTS=OFF\ 25 -DCMAKE_BUILD_TYPE=Release\ 26 -DCMAKE_INSTALL_LIBDIR=lib 27 28 sleef: build_sleef prefix 29 @prefix="$$(cat .prefix)" &&\ 30 cd -- "$(SLEEF_DIR)/build" &&\ 31 cmake -DCMAKE_INSTALL_PREFIX="$${prefix}" .. > /dev/null 2>&1 &&\ 32 $(MAKE) install 33 34 build_sleef: fetch_sleef 35 @cd -- "$(SLEEF_DIR)/build" &&\ 36 cmake $(SLEEF_CMAKE_OPTIONS) .. &&\ 37 $(MAKE) 38 39 $(SLEEF_DIR): 40 @git clone "$(SLEEF_URL)" "$@" 41 @mkdir -p "$@/build" 42 43 fetch_sleef: $(SLEEF_DIR) 44 @cd -- "$(SLEEF_DIR)" &&\ 45 git fetch origin &&\ 46 git checkout -B star-build &&\ 47 git reset --hard $(SLEEF_TAG) 48 49 clean_sleef: 50 if [ -d "$(SLEEF_DIR)/build" ]; then\ 51 cd -- "$(SLEEF_DIR)/build" && $(MAKE) clean;\ 52 fi 53 54 uninstall_sleef: fetch_sleef prefix 55 @prefix=$$(cat .prefix) &&\ 56 cd -- "$(SLEEF_DIR)/build" &&\ 57 cmake -DCMAKE_INSTALL_PREFIX="$${prefix}" .. &&\ 58 $(MAKE) install 59 xargs rm -f < "$(SLEEF_DIR)/build/install_manifest.txt" 60 61 clean_all: clean_sleef 62 install_all: sleef 63 uninstall_all: uninstall_sleef