[m-rev.] for review: do not use .exe extension with ug_invocation dependencies

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Jul 21 19:13:52 AEST 2025



On Mon, 21 Jul 2025 16:46:32 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> +# We do not specify the executable extension (.exe) on Windows here because it
> +# will not be present for the launcher scripts generated in the non-C grades.
> +# This does not matter because the PATHEXT mechanism will cause the shell and
> +# gmake to account for it in C grades (where the extension is present).
> +UG_INVOCATION_DEP=../compiler/mercury_compile

I would do an explicit case analysis here:

We do not specify the executable extension $(EXT_FOR_EXE) here because
we need a way to refer to the compiler that works regardless of the grade
in which it is compiled, and on all platforms. The extension that $(EXT_FOR_EXE)
stands for

- will not be present on the launcher scripts generated in the non-C grades,
- will not be present on the executable in C grades on Unix-like systems, and
- while it will be present on the executables in C grades on Windows,
  the Windows-specific PATHEXT mechanism will cause gmake and the shell
  to add it for us (on UG_INVOCATION_DEP and UG_INVOCATION_MC
  respectively).

Note: I don't program on Windows, so the last part  is just a guess.

Zoltan.





More information about the reviews mailing list