www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Usage of -deps

reply bearophile <bearophileHUGS lycos.com> writes:
I don't understand how to use the new -deps command line argument of DMD1/2.
To test it I have created three little modules:

// main.d
import mod1: foo;
void main() {
    printf("%d\n", foo(10));
}


// mod1.d
import mod2: bar;
int foo(int x) { return bar(x) + bar(x); }


// mod2.d
int bar(int x) { return x * x; }

I can compile them normally with:
dmd main.d mod1.d mod2.d

Then I try to use -deps, I use:
dmd -o- -deps=deps.txt main.d mod1.d mod2.d

But the 'deps.txt' file is empty. Can you tell me what's wrong?

Bye and thank you,
bearophile
Jul 06 2009
parent reply bearophile <bearophileHUGS lycos.com> writes:
 But the 'deps.txt' file is empty. Can you tell me what's wrong?
The changelog of D1 and D2 says that both have -deps, and indeed both compilers accept such flag, but DMD1 doesn't seem to work with it. While I've just seen DMD2 produces an output file. Is this a D1 bug? Bye, bearophile
Jul 06 2009
parent Derek Parnell <derek psych.ward> writes:
On Mon, 06 Jul 2009 22:19:40 -0400, bearophile wrote:

 But the 'deps.txt' file is empty. Can you tell me what's wrong?
The changelog of D1 and D2 says that both have -deps, and indeed both compilers accept such flag, but DMD1 doesn't seem to work with it. While I've just seen DMD2 produces an output file. Is this a D1 bug?
I get exactly the same thing. Running with D1 gives an empty file and running with D2 gives a file with content. I'd say it looks like a bug, so bugzilla, here I come :-) -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Jul 06 2009