Skip to content

Conversation

@vtjnash
Copy link
Contributor

@vtjnash vtjnash commented Dec 11, 2025

Define EXE variable in Makefile.system (set to .exe on Windows,
empty otherwise) and update all test executables to use it for
Windows compatibility.

  • Makefile.system: Add EXE variable definition
  • test/Makefile: Update all executables with $(EXE) suffix
  • ctest/Makefile: Update all executables with $(EXE) suffix
  • utest/Makefile: Update UTESTBIN and UTESTEXTBIN with $(EXE) suffix
  • Makefile.install: Update install_tests target with $(EXE) suffix
  • .gitignore: Add *.exe pattern

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Define EXE variable in Makefile.system (set to .exe on Windows,
empty otherwise) and update all test executables to use it for
Windows compatibility.

- Makefile.system: Add EXE variable definition
- test/Makefile: Update all executables with $(EXE) suffix
- ctest/Makefile: Update all executables with $(EXE) suffix
- utest/Makefile: Update UTESTBIN and UTESTEXTBIN with $(EXE) suffix
- Makefile.install: Update install_tests target with $(EXE) suffix
- .gitignore: Add *.exe pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@martin-frbg
Copy link
Collaborator

The make binary included in the Ubuntu/x86_64 version of the mingw-llvm cross-compiler does this automatically (as does regular mingw - or at least the MXE version I use for cross-compiling to Windows/x86_64. Is it the native aarch64/WoA version of this toolchain that gets it "wrong" by default, or which version (and context) of make are you using that needs to be told the appropriate EXE extension ?

@vtjnash
Copy link
Contributor Author

vtjnash commented Dec 24, 2025

The make binary doesn't (couldn't?) do this anywhere ever, since it doesn't know that the rule will produce an executable file. The linker usually does automatically add the suffix, but it means the rules in the make binary don't end up producing the files that was specified in the Makefile to be made by that rule, which can cause make to get confused later. It is compiler hack to provide basic support for unix-only makefiles, but not intended to be relied upon:

https://sourceware.org/binutils/docs-2.20/ld/Options.html

--force-exe-suffix
Make sure that an output file has a .exe suffix.
If a successfully built fully linked output file does not have a .exe or .dll suffix, this option forces the linker to copy the output file to one of the same name with a .exe suffix. This option is useful when using unmodified Unix makefiles on a Microsoft Windows host, since some versions of Windows won't run an image unless it ends in a .exe suffix.

@vtjnash
Copy link
Contributor Author

vtjnash commented Dec 24, 2025

I guess the customary name for this is EXEEXT if you prefer autotools conventions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants