euc build directory and output filename poll
- Posted by jeremy (admin) Oct 27, 2010
- 1187 views
The euc program will compile a Euphoria program to an executable via a C compiler you have available on your system. During this process a lot of C source is generated as well as compiled object files. Thus, to prevent cluttering your working directory, euc offers a command line option -builddir. In this directory is where euc will generate all of it's files necessary for C translation and compilation of your program.
So:
C:\my_program> euc -builddir build myprogram.ex
will create a directory build and generate a lot of temp stuff there. If everything is a success, the temp stuff is removed. It will leave behind the result which in this case is build\myprogram.exe
euc offers another command line option -o which specifies the name of the output program filename.
So:
C:\my_program> euc -builddir build -o my_program main.ex
Instead of deriving the executable name from main.ex and creating main.exe euc will use what you specified via -o which is my_program. It does add the executable extension if necessary.
There is a debate between a few dev members on IRC about where the resulting executable should be placed. Should the -o be relative to the -builddir and my_program.exe be placed in C:\my_program\build\my_program.exe or should the -o be relative to the location where euc is run and my_program.exe be placed in C:\my_program\my_program.exe ?
It's all a matter of should -o be relative to -builddir or to where euc is running from.
We want the result of least surprise. If you issued:
C:\my_program> euc -builddir build -o my_program my_program.ex
Where would you expect to find my_program.exe:
- C:\my_program\build\my_program.exe
- C:\my_program\my_program.exe
Thanks for your input.
Jeremy