How to get DMD to stop littering my source dir with .o files?

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Oct 26 04:55:45 PDT 2015


The subject line says it all. Every time I compile a D file to an executable 
I get an unwanted .o file and have to manually clean up things. I'm using 
DMD 2.0.68.2.

-of doesn't help, and my God, it doesn't even allow a space or equal sign 
between itself and the desired name of the output file making the 
commandline all the more horrible to read.

-o- is totally misleadingly labeled "Suppress generation of object file" – 
when all it suppresses is the generation of the executable file but it still 
produces the .o file.

With GCC or Clang I'm able to do clang -o exec exec.c and there's no exec.o 
littering my directly. I am not expert enough to submit a PR for the 
compiler while I have attempted some for Phobos. Is there already some way 
to avoid the .o files or shall I submit a bug request for it?

In the meanwhile, can someone please give the CLI syntax some love? 
Comparing to standard compilers like GCC and Clang, the totally strange 
syntax puts one off... Again, I'm not expert enough to do a PR for DMD.

-- 
Shriramana Sharma, Penguin #395953


More information about the Digitalmars-d-learn mailing list