On W32 (and when cross-compiling for W32 from a linux system) I'd like to have automake build two executables from the same Makefile.am
that differ in their extension.
E.g.
- foo.exe
- foo.com
Since automake magically handles the extension, i don't really see how to achieve that. E.g.
bin_PROGRAMS=foo foo.com
foo_SOURCES=foo.c
foo_com_SOURCES=foo.c
Will happily produce two binaries foo.exe
and foo.com.exe
:-(
The best I've come up so far with is:
AUTOMAKE_OPTIONS = no-exeext
bin_PROGRAMS=foo
noinst_PROGRAMS=foocom
bin_SCRIPTS=foo.com
foo_SOURCES=foo.c flub.c
foocom_SOURCES=foo.c knark.c
clean-local:
-rm -rf foo.com
foo.com: foocom$(EXEEXT)
cp $^ $@
Could I expect more?
Background
I'm building a cross-platform application (let's call it foo
), with an automake-based buildsystem.
On un*x-like systems, the application stays in the foreground (and outputs to stdout/stderr).
On W32 this is usually unwanted (as it would require the application to be a Console Application with an ugly console-window to stay open while the application is running). Sometimes it is wanted though (e.g. for debugging).
The solution currently applied (with a non-automake based build-system on W32) is to build the same application both as foo.exe
(a native W32 application), and foo.com
(a Console Application).