www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Problems with dmd Switches in Makefiles

reply Tom Browder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
I know I'm supposed to use dub, but I'm not ready.

I just found out I can't use dmd switches for file names variable in a
GNU makefile, e.g., see this fragment

%.o : %.d
      dmd -c $< -of $ 

which doesn't work because the "-of" must be followed immediately by a
file name with no intervening spaces.

This simple case works by simply removing the code chunk "-of $ " but
the problem precludes more complex makefiles.

Also, I notice dmd has no simple way to output its version (by the
way, I'm using dmd version 2.065 installed via the Debian apt package
management system).

Am I missing something, or are these situations legitimate bugs?

Thanks.

Best regards,

-Tom
May 17 2014
parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Saturday, 17 May 2014 at 13:01:07 UTC, Tom Browder via 
Digitalmars-d-learn wrote:
 I know I'm supposed to use dub, but I'm not ready.

 I just found out I can't use dmd switches for file names 
 variable in a
 GNU makefile, e.g., see this fragment

 %.o : %.d
       dmd -c $< -of $ 

 which doesn't work because the "-of" must be followed 
 immediately by a
 file name with no intervening spaces.
dmd -c $< -of$ works for me with GNU Make 3.82.
May 17 2014
parent reply Tom Browder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Sat, May 17, 2014 at 8:05 AM, via Digitalmars-d-learn
<digitalmars-d-learn puremagic.com> wrote:
 On Saturday, 17 May 2014 at 13:01:07 UTC, Tom Browder via
 Digitalmars-d-learn wrote:
...
 I just found out I can't use dmd switches for file names variable in a
 GNU makefile, e.g., see this fragment
...
       dmd -c $< -of$ 

 which doesn't work
works for me with GNU Make 3.82.
You're correct, my error. I had another error which I misinterpreted. So GNU make expands the "$ " variable even without the space after "-of"--great! Thanks for the help. Best regards, -Tom
May 17 2014
parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
For the compiler version, I've submitted a PR:

https://github.com/D-Programming-Language/dmd/pull/3558
May 18 2014
parent "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Sunday, 18 May 2014 at 16:15:53 UTC, Marc Schütz wrote:
 For the compiler version, I've submitted a PR:

 https://github.com/D-Programming-Language/dmd/pull/3558
Ok, the outcome is that a dedicated option is not seen as necessary. DMD already prints its version as the first line if you call it without arguments. If you need only the version, you can use: dmd | head -n1
May 19 2014