commit 479ae057846f271c1e237bc4b3d564d120a46528
parent ed099c1cd18d66cfdc24e6e694a79bb51d91ba8f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 7 May 2024 10:29:35 +0200
Add the build script for libcyaml 1.3.1
It is built directly on the target machine from its sources, since
compilation is fast and libcyaml dependencies can be assumed to be
installed on the system.
Diffstat:
2 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/src/libcyaml.mk.in b/src/libcyaml.mk.in
@@ -0,0 +1,53 @@
+# Copyright (C) 2023, 2024 |Méso|Star> (contact@meso-star.com)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Configuration macros
+LIBCYAML_TAG=@TAG@
+LIBCYAML_URL=https://github.com/tlsa/libcyaml
+
+# Helper macros
+LIBCYAML_DIR=libcyaml/$(LIBCYAML_TAG)
+
+libcyaml: build_libcyaml
+ @prefix="$$(cat .prefix)" && \
+ cd -- "$(LIBCYAML_DIR)" && \
+ $(MAKE) PREFIX="$${prefix}" install
+
+build_libcyaml: $(LIBCYAML_DIR)
+ @cd -- "$(LIBCYAML_DIR)" && \
+ $(MAKE) VARIANT=release
+
+$(LIBCYAML_DIR):
+ @git clone --branch "$(LIBCYAML_TAG)" --depth 1 "$(LIBCYAML_URL)" $@
+
+clean_libcyaml:
+ if [ -d "$(LIBCYAML_DIR)" ]; then \
+ cd -- "$(LIBCYAML_DIR)" && $(MAKE) clean; \
+ fi
+
+uninstall_libcyaml:
+ prefix="$$(cat .prefix)" && \
+ rm -f "$${prefix}"/include/cyaml/cyaml.h && \
+ rm -f "$${prefix}"/lib/libcyaml.a && \
+ rm -f "$${prefix}"/lib/libcyaml.so* && \
+ rm -f "$${prefix}"/lib/pkgconfig/libcyaml.pc
+
+distclean_libcyaml:
+ rm -rf libcyaml
+
+clean_all: clean_libcyaml
+distclean_all: distclean_libcyaml
+install_all: libcyaml
+uninstall_all: uninstall_libcyaml
diff --git a/src/libcyaml_1.3.1.sh b/src/libcyaml_1.3.1.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Copyright (C) 2023, 2024 |Méso|Star> (contact@meso-star.com)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+[ -n "${LIBCYAML_SH}" ] && return
+export LIBCYAML_SH=1
+
+tag="v1.3.1"
+
+sed "s/@TAG@/${tag}/" "src/libcyaml.mk.in"
+
+# Add the template file as a prerequisite for the script invoked
+# i.e. the build file
+printf "%s: src/libcyaml.mk.in\n" "$0"