star-build

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

libcyaml.mk.in (2007B)


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