This is how they behave in LDC at the moment. If you can come up with a more consistent/intuitive setup, please make a ticket.
- ldc somefile.d
- output somefile.o
- link somefile unless -c
- ldc somefile.d <ouput switches>
- output somefile.*
- link somefile if .o is output and not -c
- ldc somefile.d -of<name>
- output name.o
- link name
- ldc -c somefile.d -of<name>.<ext>
- if ext is known, output name.ext of correct type
- if ext is unknown, output name.ext.o object file
- ldc somefile.d -of<name> <output switches>
- output name.*
- link name if .o is output
- ldc -c somefile.d -of<name>.<ext> <output switches>
- if ext is known, output name.ext of correct type and name.*
- if ext is unknown, output name.ext.*
TODO: Add cases for multiple source files.