star-build

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

libcyaml.mk.in (1976B)


      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 LIBCYAML_TAG=@TAG@
     18 LIBCYAML_URL_ONLINE = https://github.com/tlsa/libcyaml
     19 LIBCYAML_URL_OFFLINE = $(MIRROR)/libcyaml
     20 LIBCYAML_URL = $(LIBCYAML_URL_$(NETWORK))
     21 
     22 # Helper macros
     23 LIBCYAML_DIR=$(CACHE)/libcyaml/$(LIBCYAML_TAG)
     24 
     25 libcyaml: build_libcyaml
     26 	@prefix="$$(cat .prefix)" && \
     27 	cd -- "$(LIBCYAML_DIR)" && \
     28 	find . -name "libcyaml.pc" -exec rm -f {} + && \
     29 	$(MAKE) PREFIX="$${prefix}" install
     30 
     31 build_libcyaml: $(LIBCYAML_DIR)
     32 	@cd -- "$(LIBCYAML_DIR)" && \
     33 	$(MAKE) VARIANT=release
     34 
     35 $(LIBCYAML_DIR):
     36 	@git clone --branch "$(LIBCYAML_TAG)" --depth 1 "$(LIBCYAML_URL)" $@
     37 
     38 clean_libcyaml:
     39 	if [ -d "$(LIBCYAML_DIR)" ]; then \
     40 		cd -- "$(LIBCYAML_DIR)" && $(MAKE) clean; \
     41 	fi
     42 
     43 uninstall_libcyaml:
     44 	prefix="$$(cat .prefix)" && \
     45 	rm -f "$${prefix}"/include/cyaml/cyaml.h && \
     46 	rm -f "$${prefix}"/lib/libcyaml.a && \
     47 	rm -f "$${prefix}"/lib/libcyaml.so* && \
     48 	rm -f "$${prefix}"/lib/pkgconfig/libcyaml.pc
     49 
     50 mirror_libcyaml:
     51 	repo="$$(echo "$(LIBCYAML_URL)" | sed 's/[\/]\{0,\}$$//g')" && \
     52 	repo="$(MIRROR)/$${repo##*/}" && \
     53 	rm -rf "$${repo}" && \
     54 	git clone --bare --branch "$(LIBCYAML_TAG)" $(MIRROR_GIT_OPT) \
     55 	  $(LIBCYAML_URL) "$${repo}"
     56 
     57 clean_all: clean_libcyaml
     58 install_all: libcyaml
     59 uninstall_all: uninstall_libcyaml
     60 mirror_all: mirror_libcyaml