star-build

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

sleef.mk.in (1883B)


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