Rombobjörn

summaryrefslogtreecommitdiff
path: root/comfignat.mk
diff options
context:
space:
mode:
authorBjörn Persson <Bjorn@Rombobjörn.se>2025-09-07 08:20:09 +0200
committerBjörn Persson <Bjorn@Rombobjörn.se>2025-09-07 08:20:09 +0200
commit2bdc3fb8383d0a412464295f50d8101a8941571b (patch)
treebeb28e8b98785212118332a95f36cb87b862ae6e /comfignat.mk
parent057cb5ab06f569842e8f4285328f2f4e86813c0e (diff)
Updated Comfignat to version 1.6.HEADmaster
Diffstat (limited to 'comfignat.mk')
-rw-r--r--comfignat.mk30
1 files changed, 22 insertions, 8 deletions
diff --git a/comfignat.mk b/comfignat.mk
index b71efb2..a574a17 100644
--- a/comfignat.mk
+++ b/comfignat.mk
@@ -1,5 +1,5 @@
# Comfignat makefile foundation for configuring and building GNAT projects
-# Copyright 2013 - 2016 B. Persson, Bjorn@Rombobeorn.se
+# Copyright 2013 - 2025 B. Persson, Bjorn@Rombobeorn.se
#
# This material is provided as is, with absolutely no warranty expressed
# or implied. Any use is at your own risk.
@@ -11,9 +11,9 @@
# modified is included with the above copyright notice.
-# This file is part of Comfignat 1.5 – common, convenient, command-line-
+# This file is part of Comfignat 1.6 – common, convenient, command-line-
# controlled compile-time configuration of software built with the GNAT tools.
-# For information about Comfignat, see http://www.Rombobeorn.se/Comfignat/.
+# For information about Comfignat, see https://www.Rombobeorn.se/Comfignat/.
# This file contains generic Make code. It is designed to be included by other
@@ -168,6 +168,8 @@ cachedir = ${localstatedir}/cache
logdir = ${localstatedir}/log
runstatedir = /run
lockdir = ${runstatedir}/lock
+unitdir = ${prefix}/lib/systemd/system
+userunitdir = ${prefix}/lib/systemd/user
includedir = ${prefix}/include
archincludedir = ${includedir}
libdir = ${exec_prefix}/lib
@@ -233,6 +235,8 @@ stage_sysconfdir = ${stagedir}${sysconfdir}
stage_statedir = ${stagedir}${statedir}
stage_cachedir = ${stagedir}${cachedir}
stage_logdir = ${stagedir}${logdir}
+stage_unitdir = ${stagedir}${unitdir}
+stage_userunitdir = ${stagedir}${userunitdir}
stage_includedir = ${stagedir}${includedir}
stage_archincludedir = ${stagedir}${archincludedir}
stage_libdir = ${stagedir}${libdir}
@@ -257,6 +261,8 @@ Make_sysconfdir = ${call Make_pathname,stage_sysconfdir}
Make_statedir = ${call Make_pathname,stage_statedir}
Make_cachedir = ${call Make_pathname,stage_cachedir}
Make_logdir = ${call Make_pathname,stage_logdir}
+Make_unitdir = ${call Make_pathname,stage_unitdir}
+Make_userunitdir = ${call Make_pathname,stage_userunitdir}
Make_includedir = ${call Make_pathname,stage_includedir}
Make_archincludedir = ${call Make_pathname,stage_archincludedir}
Make_libdir = ${call Make_pathname,stage_libdir}
@@ -281,9 +287,7 @@ preprocess_file = "${GNATPREP}" ${firstword ${filter %.gp,$^}} $@ \
# it as Gnatprep symbols. Otherwise srcdir is conveyed, as it's needed by
# preprocessed build projects.
-build_GPR = "${GNAT_BUILDER}" -P ${firstword ${filter %.gpr,$^}} \
- ${addprefix -aP,${VPATH}} -p \
- ${options_building} ${builder_arguments} ${GNATFLAGS}
+build_GPR = ${call build_specified_GPR,${firstword ${filter %.gpr,$^}}}
# build_GPR is a command for use in recipes. It performs a build controlled by
# the first project file among the rule's prerequisites.
@@ -415,6 +419,7 @@ configuration_variables += \
prefix exec_prefix datarootdir localstatedir \
bindir libexecdir \
datadir sysconfdir statedir cachedir logdir runstatedir lockdir \
+ unitdir userunitdir \
includedir archincludedir libdir alidir gprdir \
localedir mandir infodir miscdocdir \
objdir stagedir \
@@ -614,6 +619,9 @@ preprocessed_files_in_builddir = ${addprefix ${Make_builddir}/,${preprocessed_fi
# preprocessed files are assumed to be needed during the build and are written
# to builddir.
+build_specified_GPR = "${GNAT_BUILDER}" -P ${1} ${addprefix -aP,${VPATH}} -p \
+ ${options_building} ${builder_arguments} ${GNATFLAGS}
+
#
# Make rules:
@@ -715,11 +723,17 @@ ${Make_gprdir}/%: % | ${Make_gprdir}/
preprocess: $${preprocessed_files_in_builddir}
# How to build a project:
-%.gpr.phony_target: %.gpr preprocess
- ${build_GPR}
+%.gpr.phony_target: preprocess
+ ${call build_specified_GPR,${basename $@}}
# Instead of tracking dependencies between project files, this rule simply
# requires that all preprocessing of files that are needed during the build is
# done before any project is built.
+# "%.gpr" isn't mentioned as a prerequisite because that stopped working in GNU
+# Make 4.4. This rule is phony so that the builder is always run and gets to
+# determine whether the project needs rebuilding. Thus there's no need to have
+# Make check whether the project file has been changed. The dependency on
+# preprocess ensures that the project file is generated if needed, and its name
+# is known from the target name.
.PHONY: base
base: $${build_targets} preprocess