diff options
| -rw-r--r-- | comfignat.mk | 19 | 
1 files changed, 13 insertions, 6 deletions
| diff --git a/comfignat.mk b/comfignat.mk index b71efb2..13aadc2 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. @@ -281,9 +281,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. @@ -614,6 +612,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 +716,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 |