automake: EXEEXT
1
1 8.20 Support for executable extensions
1 ======================================
1
1 On some platforms, such as Windows, executables are expected to have an
1 extension such as ‘.exe’. On these platforms, some compilers (GCC among
1 them) will automatically generate ‘foo.exe’ when asked to generate
1 ‘foo’.
1
1 Automake provides mostly-transparent support for this. Unfortunately
1 _mostly_ doesn’t yet mean _fully_. Until the English dictionary is
1 revised, you will have to assist Automake if your package must support
1 those platforms.
1
1 One thing you must be aware of is that, internally, Automake rewrites
1 something like this:
1
1 bin_PROGRAMS = liver
1
1 to this:
1
1 bin_PROGRAMS = liver$(EXEEXT)
1
1 The targets Automake generates are likewise given the ‘$(EXEEXT)’
1 extension.
1
1 The variables ‘TESTS’ and ‘XFAIL_TESTS’ (⇒Simple Tests) are
1 also rewritten if they contain filenames that have been declared as
1 programs in the same ‘Makefile’. (This is mostly useful when some
1 programs from ‘check_PROGRAMS’ are listed in ‘TESTS’.)
1
1 However, Automake cannot apply this rewriting to ‘configure’
1 substitutions. This means that if you are conditionally building a
1 program using such a substitution, then your ‘configure.ac’ must take
1 care to add ‘$(EXEEXT)’ when constructing the output variable.
1
1 Sometimes maintainers like to write an explicit link rule for their
1 program. Without executable extension support, this is easy—you simply
1 write a rule whose target is the name of the program. However, when
1 executable extension support is enabled, you must instead add the
1 ‘$(EXEEXT)’ suffix.
1
1 This might be a nuisance for maintainers who know their package will
1 never run on a platform that has executable extensions. For those
1 maintainers, the ‘no-exeext’ option (⇒Options) will disable this
1 feature. This works in a fairly ugly way; if ‘no-exeext’ is seen, then
1 the presence of a rule for a target named ‘foo’ in ‘Makefile.am’ will
1 override an ‘automake’-generated rule for ‘foo$(EXEEXT)’. Without the
1 ‘no-exeext’ option, this use will give a diagnostic.
1