The function you execute is Development.Shake.FilePath.exe
, which evaluates to "exe"
on Windows and ""
on all other platforms. Usually you write:
want ["MyExecutable" <.> exe] "MyExecutable" <.> exe *> \out -> cmd "MyCompiler" "-o" [out]
For an example, see .Self.Main Examples , which builds Main
on Linux and Main.exe
on Windows.
The only potential distortion is that all file templates to the left of *>
must be unique. If you define "//*" <.> exe *> ...
then on Windows, which will only match executable files (good), but on Linux, which will match every file, when faced with all other patterns (bad) . The solution is to make the executable names different, for example, put them in a special output directory, hard-type the names as "Main" <.> exe
, etc. Alternatively, you can rely on the fact that only executable files do not have an extension on Linux with:
(\x -> drop 1 (takeExtension x) == exe) ?> \out -> ...
source share