commit c3fe2b1b71b1a729327a2811f74d06bfcc7d96c3
parent f77eb5d4659170b3bfe2982710000d2063eb36bb
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 25 Jul 2023 18:01:27 +0200
Write Makefile template and build script of scdoc
Diffstat:
2 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/src/scdoc.mk.in b/src/scdoc.mk.in
@@ -0,0 +1,54 @@
+# Copyright (C) 2023 |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
+SCDOC_TAG = @TAG@
+SCDOC_URL = https://git.sr.ht/~sircmpwn/scdoc
+
+# Helper macros
+SCDOC_DIR = scdoc/$(SCDOC_TAG)
+
+scdoc: build_scdoc
+ @prefix=$$(cat .prefix) && \
+ cd -- "$(SCDOC_DIR)" && $(MAKE) PREFIX="$${prefix}" install
+
+build_scdoc: fetch_scdoc prefix
+ @cd -- "$(SCDOC_DIR)" && $(MAKE)
+
+$(SCDOC_DIR):
+ @git clone $(SCDOC_URL) "$@"
+
+fetch_scdoc: $(SCDOC_DIR)
+ @cd -- "$(SCDOC_DIR)" && \
+ git fetch origin && \
+ git checkout -B star-build && \
+ git reset --hard $(SCDOC_TAG)
+
+clean_scdoc:
+ if [ -d "$(SCDOC_DIR)" ]; then \
+ cd -- "$(SCDOC_DIR)" && make clean; \
+ fi
+
+uninstall_scdoc: fetch_scdoc prefix
+ @prefix=$$(cat .prefix) && \
+ cd -- "$(SCDOC_DIR)" && $(MAKE) PREFIX="$${prefix}" uninstall
+
+distclean_scdoc:
+ rm -rf scdoc
+
+clean_all: clean_scdoc
+distclean_all: distclean_scdoc
+install_all: scdoc
+uninstall_all: uninstall_scdoc
diff --git a/src/scdoc_1.11.2-r1.sh b/src/scdoc_1.11.2-r1.sh
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+
+# Copyright (C) 2023 |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/>.
+
+[ -n "${NOWEB_SH}" ] && return
+export NOWEB_SH=1
+
+tag=afeda24
+
+sed "s/@TAG@/${tag}/" "src/scdoc.mk.in"
+
+# Add the template file as a prerequisite for the script invoked
+# i.e. the build file
+printf "%s: src/scdoc.mk.in\n" "$0"