star-build

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

commit a6a1979a9d9bbcebba58544dcffea05e089f39b3
parent 6253b2af04e210b965f28f1852bcd6d13e97f73a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sun, 21 May 2023 10:20:01 +0200

Add support for profile files

Add a profile template file and its Makefile defining its targets for
generation, cleaning, installation and uninstallation. Add the "profile"
function to build.sh: it declares a profile file to be generated and
installed whose name prefix is given as input argument.

Diffstat:
Abuild.profile.in | 14++++++++++++++
Mbuild.sh | 6++++++
Mconfig.mk | 2+-
Aprofile.mk.in | 16++++++++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/build.profile.in b/build.profile.in @@ -0,0 +1,14 @@ +#!/bin/sh + +# Copyright (C) 2023 |Méso|Star> (contact@meso-star.com) +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice and +# this notice are preserved. This file is offered as-is, without any warranty. + +export CPATH="@PREFIX@/lib":${CPATH} +export LD_LIBRARY_PATH="@PREFIX@/lib":${LD_LIBRARY_PATH} +export LIBRARY_PATH="@PREFIX@/lib":${LIBRARY_PATH} +export MANPATH="@PREFIX@/share/man":${MANPATH} +export PATH="@PREFIX@/bin":${PATH} +export PKG_CONFIG_PATH="@PREFIX@/lib/pkgconfig":${PKG_CONFIG_PATH} diff --git a/build.sh b/build.sh @@ -59,6 +59,12 @@ bin_spkg() url="" } +# Generate the targets of a profile +profile() +{ + sed -e "s#@NAME@#$1#g" profile.mk.in +} + # Register the submitted names as targets to install build() { diff --git a/config.mk b/config.mk @@ -14,7 +14,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Installation path -PREFIX = ./local/ +PREFIX = ./local # List of repositories REPO = https://gitlab.com/meso-star diff --git a/profile.mk.in b/profile.mk.in @@ -0,0 +1,16 @@ +@NAME@: build.profile.in prefix + sed "s#@PREFIX@#$$(cat .prefix)#g" build.profile.in > $@ + +install_@NAME@: @NAME@ + mkdir -p "$$(cat .prefix)/etc" + cp @NAME@ "$$(cat .prefix)/etc" + +uninstall_@NAME@: prefix + rm -f "$$(cat .prefix)/etc/@NAME@" + +clean_@NAME@: + rm -f @NAME@ + +clean_all: clean_@NAME@ +install_all: install_@NAME@ +uninstall_all: uninstall_@NAME@