Build tools.

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sat Oct 13 04:35:21 PDT 2007


Alexander Panek wrote:
> Frits van Bommel wrote:
>> Alexander Panek wrote:
>>> The easiest way to achieve the imports/dependencies is to parse the 
>>> output of `dmd -v file1.d file2.d', and grep for "^semantic <fileX>" 
>>> + following "^import".. just take a look yourself, I'm sure it's 
>>> easier than using the frontend itself.
>>
>> Why would you look at the semantic lines instead of the import & file 
>> lines? They don't give you all files a module depends on and they only 
>> give module names (not filenames).
>> On the other hand, the import & file lines give you all imported 
>> modules (transitively) and all import()ed files, with the full 
>> filename for each given between brackets at the end of the line.
> 
> As far as I can tell, all imports listed after a line "semantic Module" 
> are the dependencies of that module. At least that's how it looks like.

Oh, I missed the part where you said '+ following "^import"'.
I just used one invocation of DMD per module, so all imports would 
automatically be for that file.
You did miss 'file' lines though.

>> (-c makes sure this doesn't generate an executable and -o- stops 
>> generation of object files)
> 
> Ay..should have added those, too.

Well, they're not required, just what I used. If you pass -v when 
compiling normally and filter out the right lines it works fine. The 
times you need to recompile are the same ones where dependency 
information needs to be updated anyway.



More information about the Digitalmars-d mailing list